mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-12-09 07:32:32 +08:00
Fix for parallel compression examples on Windows (#1459)
This commit is contained in:
parent
f46e5db184
commit
80954e8272
@ -43,6 +43,10 @@
|
||||
#define HDF5_DATATYPE H5T_NATIVE_INT
|
||||
typedef int C_DATATYPE;
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 512
|
||||
#endif
|
||||
|
||||
/* Global variables */
|
||||
int mpi_rank, mpi_size;
|
||||
|
||||
@ -234,7 +238,7 @@ write_dataset_no_overlap(hid_t file_id, hid_t dxpl_id)
|
||||
static void
|
||||
write_dataset_overlap(hid_t file_id, hid_t dxpl_id)
|
||||
{
|
||||
C_DATATYPE data[mpi_size][EXAMPLE_DSET_CHUNK_DIM_SIZE];
|
||||
C_DATATYPE *data = NULL;
|
||||
hsize_t dataset_dims[EXAMPLE_DSET_DIMS];
|
||||
hsize_t chunk_dims[EXAMPLE_DSET_DIMS];
|
||||
hsize_t start[EXAMPLE_DSET_DIMS];
|
||||
@ -324,7 +328,9 @@ write_dataset_overlap(hid_t file_id, hid_t dxpl_id)
|
||||
* --------------------------------------
|
||||
*/
|
||||
|
||||
fill_databuf(start, count, stride, &data[0][0]);
|
||||
data = malloc(mpi_size * EXAMPLE_DSET_CHUNK_DIM_SIZE * sizeof(C_DATATYPE));
|
||||
|
||||
fill_databuf(start, count, stride, data);
|
||||
|
||||
/*
|
||||
* ---------------------------------
|
||||
@ -334,6 +340,8 @@ write_dataset_overlap(hid_t file_id, hid_t dxpl_id)
|
||||
|
||||
H5Dwrite(dset_id, HDF5_DATATYPE, H5S_BLOCK, file_dataspace, dxpl_id, data);
|
||||
|
||||
free(data);
|
||||
|
||||
/*
|
||||
* --------------
|
||||
* Close HDF5 IDs
|
||||
|
@ -43,6 +43,10 @@
|
||||
#define HDF5_DATATYPE H5T_NATIVE_INT
|
||||
typedef int C_DATATYPE;
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 512
|
||||
#endif
|
||||
|
||||
/* Global variables */
|
||||
int mpi_rank, mpi_size;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user