diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-12-23 14:54:47 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2014-12-23 14:54:47 (GMT) |
commit | cbd0460b1b2c94611cb02f9d6f240b4d24ce8fe2 (patch) | |
tree | 32f2ad80e8d05c2bb5440f0459cb1bce8d8fb976 /src/H5Smpio.c | |
parent | 443bc1200f2ef81136b1ac2822873bc06ac926bd (diff) | |
download | hdf5-cbd0460b1b2c94611cb02f9d6f240b4d24ce8fe2.zip hdf5-cbd0460b1b2c94611cb02f9d6f240b4d24ce8fe2.tar.gz hdf5-cbd0460b1b2c94611cb02f9d6f240b4d24ce8fe2.tar.bz2 |
[svn-r25921] - wrap MPI 3 usage with MPI_VERSION compile time check.
- build out unbuffered stdout/err for windows
Diffstat (limited to 'src/H5Smpio.c')
-rw-r--r-- | src/H5Smpio.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/H5Smpio.c b/src/H5Smpio.c index 9a1b5a6..81b032f 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -168,18 +168,23 @@ H5S_mpio_create_point_datatype (size_t elmt_size, hsize_t num_points, if(MPI_SUCCESS != (mpi_code = MPI_Type_contiguous((int)elmt_size, MPI_BYTE, &elmt_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_contiguous failed", mpi_code) elmt_type_created = TRUE; - + +#if MPI_VERSION == 3 + /* Create an MPI datatype for the whole point selection */ + if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed_block((int)num_points, 1, disp, elmt_type, new_type))) + HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_indexed_block failed", mpi_code) +#else /* Allocate block sizes for MPI datatype call */ if(NULL == (blocks = (int *)H5MM_malloc(sizeof(int) * num_points))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate array of blocks") - /* Would be nice to have Create_Hindexed_block to avoid this array of all ones */ for(u = 0; u < num_points; u++) blocks[u] = 1; /* Create an MPI datatype for the whole point selection */ if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed((int)num_points, blocks, disp, elmt_type, new_type))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_indexed_block failed", mpi_code) +#endif /* Commit MPI datatype for later use */ if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(new_type))) |