From c12f91908be82a3864fbbe23ff48a8a8abe629d4 Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Mon, 5 May 2003 15:48:33 -0500 Subject: [svn-r6795] Purpose: Feature Add Description: Added knob so that the programmer can enable or disable GPFS hints during runtime instead of having it only enabled at configure/compile time. Some of the public APIs were changed to add an extra parameter for this option... Platforms tested: Blue (LLNL). It only affects the MPI/POSIX driver, so no need to test it on non-GPFS platforms. Misc. update: --- release_docs/RELEASE.txt | 4 +++ src/H5FDmpiposix.c | 77 ++++++++++++++++++++++++++++++++---------------- src/H5FDmpiposix.h | 4 +-- testpar/t_dset.c | 18 +++++++---- testpar/t_file.c | 3 +- testpar/t_mdset.c | 25 +++++++++++----- testpar/t_ph5basic.c | 11 +++---- testpar/testphdf5.c | 7 +++-- testpar/testphdf5.h | 10 ++++++- 9 files changed, 108 insertions(+), 51 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index aae7076..48d8b27 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -283,6 +283,10 @@ Documentation New Features ============ + * Added parameter to the MPI/POSIX driver. If GPFS is enabled (by + modifying the H5FDmpiposix.c file to uncomment the USE_GPFS_HINTS + macro), then this extra parameter will turn GPFS hints on and off + during runtime. BW - 2003/05/05 * Added option to print 1-byte integer datasets as ASCII to h5dump. BW - 2003/04/30 * Added a new utility "h5fc". It can be used to compile easily Fortran diff --git a/src/H5FDmpiposix.c b/src/H5FDmpiposix.c index b456c47..1f50ed4 100644 --- a/src/H5FDmpiposix.c +++ b/src/H5FDmpiposix.c @@ -49,6 +49,9 @@ * REPORT_IO -- if set then report all POSIX file calls to stderr. * */ +/* #define USE_GPFS_HINTS */ +/* #define REPORT_IO */ + #ifdef USE_GPFS_HINTS # include #endif @@ -89,6 +92,7 @@ typedef struct H5FD_mpiposix_t { int op; /* Last file I/O operation */ hsize_t naccess; /* Number of (write) accesses to file */ size_t blksize; /* Block size of file system */ + hbool_t use_gpfs; /* Use GPFS to write things */ #ifndef WIN32 /* * On most systems the combination of device and i-node number uniquely @@ -185,6 +189,7 @@ static herr_t H5FD_mpiposix_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing /* MPIPOSIX-specific file access properties */ typedef struct H5FD_mpiposix_fapl_t { + hbool_t use_gpfs; /*use GPFS hints */ MPI_Comm comm; /*communicator */ } H5FD_mpiposix_fapl_t; @@ -299,10 +304,14 @@ done: * a duplicate of the communicator. Free the old duplicate if * previously set. (Work is actually done by H5P_set_driver.) * + * Bill Wendling, 2003-05-01 + * Modified to take an extra flag indicating that we should + * use the GPFS hints (if available) for this file. + * *------------------------------------------------------------------------- */ herr_t -H5Pset_fapl_mpiposix(hid_t fapl_id, MPI_Comm comm) +H5Pset_fapl_mpiposix(hid_t fapl_id, MPI_Comm comm, hbool_t use_gpfs) { H5FD_mpiposix_fapl_t fa; H5P_genplist_t *plist; /* Property list pointer */ @@ -319,6 +328,7 @@ H5Pset_fapl_mpiposix(hid_t fapl_id, MPI_Comm comm) /* Initialize driver specific properties */ fa.comm = comm; + fa.use_gpfs = use_gpfs; /* duplication is done during driver setting. */ ret_value= H5P_set_driver(plist, H5FD_MPIPOSIX, &fa); @@ -353,10 +363,13 @@ done: * Albert Cheng, 2003-04-24 * Return duplicate of the stored communicator. * + * Bill Wendling, 2003-05-01 + * Return the USE_GPFS flag. + * *------------------------------------------------------------------------- */ herr_t -H5Pget_fapl_mpiposix(hid_t fapl_id, MPI_Comm *comm/*out*/) +H5Pget_fapl_mpiposix(hid_t fapl_id, MPI_Comm *comm/*out*/, hbool_t *use_gpfs/*out*/) { H5FD_mpiposix_fapl_t *fa; H5P_genplist_t *plist; /* Property list pointer */ @@ -379,6 +392,9 @@ H5Pget_fapl_mpiposix(hid_t fapl_id, MPI_Comm *comm/*out*/) HMPI_GOTO_ERROR(FAIL, "MPI_Comm_dup failed", mpi_code); } + if (use_gpfs) + *use_gpfs = fa->use_gpfs; + done: FUNC_LEAVE_API(ret_value); } /* end H5Pget_fapl_mpiposix() */ @@ -528,6 +544,8 @@ H5FD_mpiposix_fapl_get(H5FD_t *_file) if (MPI_SUCCESS != (mpi_code=MPI_Comm_dup(file->comm, &fa->comm))) HMPI_GOTO_ERROR(NULL, "MPI_Comm_dup failed", mpi_code); + fa->use_gpfs = file->use_gpfs; + /* Set return value */ ret_value=fa; @@ -571,6 +589,8 @@ H5FD_mpiposix_fapl_copy(const void *_old_fa) /* Duplicate communicator. */ if (MPI_SUCCESS != (mpi_code=MPI_Comm_dup(old_fa->comm, &new_fa->comm))) HMPI_GOTO_ERROR(NULL, "MPI_Comm_dup failed", mpi_code); + + new_fa->use_gpfs = old_fa->use_gpfs; ret_value = new_fa; done: @@ -679,6 +699,7 @@ H5FD_mpiposix_open(const char *name, unsigned flags, hid_t fapl_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list"); if (H5P_FILE_ACCESS_DEFAULT==fapl_id || H5FD_MPIPOSIX!=H5P_get_driver(plist)) { _fa.comm = MPI_COMM_SELF; /*default*/ + _fa.use_gpfs = FALSE; fa = &_fa; } /* end if */ else { @@ -754,8 +775,9 @@ H5FD_mpiposix_open(const char *name, unsigned flags, hid_t fapl_id, HMPI_GOTO_ERROR(NULL, "MPI_Bcast failed", mpi_code); #ifdef USE_GPFS_HINTS - { - /* Free all byte range tokens. This is a good thing to do if raw data is aligned on 256kB boundaries (a GPFS page is + if (fa->use_gpfs) { + /* + * Free all byte range tokens. This is a good thing to do if raw data is aligned on 256kB boundaries (a GPFS page is * 256kB). Care should be taken that there aren't too many sub-page writes, or the mmfsd may become overwhelmed. This * should probably eventually be passed down here as a property. The gpfs_fcntl() will most likely fail if `fd' isn't * on a GPFS file system. */ @@ -775,7 +797,7 @@ H5FD_mpiposix_open(const char *name, unsigned flags, hid_t fapl_id, HGOTO_ERROR(H5E_FILE, H5E_FCNTL, NULL, "failed to send hints to GPFS"); if (0==mpi_rank) - fprintf(stderr, "HDF5: using GPFS hint mechanism...\n"); + HDfprintf(stderr, "HDF5: using GPFS hint mechanism...\n"); } #endif @@ -784,7 +806,7 @@ H5FD_mpiposix_open(const char *name, unsigned flags, hid_t fapl_id, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); #ifdef REPORT_IO - fprintf(stderr, "open: rank=%d name=%s file=0x%08lx\n", mpi_rank, name, (unsigned long)file); + HDfprintf(stderr, "open: rank=%d name=%s file=0x%08lx\n", mpi_rank, name, (unsigned long)file); #endif /* Set the general file information */ @@ -792,6 +814,9 @@ H5FD_mpiposix_open(const char *name, unsigned flags, hid_t fapl_id, file->eof = sb.st_size; file->blksize = sb.st_blksize; + /* Set this field in the H5FD_mpiposix_t struct for later use */ + file->use_gpfs = fa->use_gpfs; + /* Set the MPI information */ file->comm = comm_dup; file->mpi_rank = mpi_rank; @@ -1161,7 +1186,7 @@ H5FD_mpiposix_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, { int commrank; MPI_Comm_rank(MPI_COMM_WORLD, &commrank); - fprintf(stderr, "read: rank=%d file=0x%08lx type=%d, addr=%lu size=%lu\n", + HDfprintf(stderr, "read: rank=%d file=0x%08lx type=%d, addr=%lu size=%lu\n", commrank, (unsigned long)file, (int)type, (unsigned long)addr, (unsigned long)size); } #endif @@ -1290,7 +1315,7 @@ H5FD_mpiposix_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, { int commrank; MPI_Comm_rank(MPI_COMM_WORLD, &commrank); - fprintf(stderr, "write: rank=%d file=0x%08lx type=%d, addr=%lu size=%lu %s\n", + HDfprintf(stderr, "write: rank=%d file=0x%08lx type=%d, addr=%lu size=%lu %s\n", commrank, (unsigned long)file, (int)type, (unsigned long)addr, (unsigned long)size, 0==file->naccess?"(FIRST ACCESS)":""); } @@ -1299,23 +1324,25 @@ H5FD_mpiposix_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, if (0==file->naccess++) { /* First write access to this file */ #ifdef USE_GPFS_HINTS - struct { - gpfsFcntlHeader_t hdr; - gpfsMultipleAccessRange_t mar; - } hint; - memset(&hint, 0, sizeof hint); - hint.hdr.totalLength = sizeof hint; - hint.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; - hint.mar.structLen = sizeof hint.mar; - hint.mar.structType = GPFS_MULTIPLE_ACCESS_RANGE; - hint.mar.accRangeCnt = 1; - hint.mar.accRangeArray[0].blockNumber = addr / file->blksize; - hint.mar.accRangeArray[0].start = addr % file->blksize; - hint.mar.accRangeArray[0].length = MIN(file->blksize-hint.mar.accRangeArray[0].start, size); - hint.mar.accRangeArray[0].isWrite = 1; - if (gpfs_fcntl(file->fd, &hint)<0) - HGOTO_ERROR(H5E_FILE, H5E_FCNTL, NULL, "failed to send hints to GPFS"); -#endif + if (file->use_gpfs) { + struct { + gpfsFcntlHeader_t hdr; + gpfsMultipleAccessRange_t mar; + } hint; + memset(&hint, 0, sizeof hint); + hint.hdr.totalLength = sizeof hint; + hint.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; + hint.mar.structLen = sizeof hint.mar; + hint.mar.structType = GPFS_MULTIPLE_ACCESS_RANGE; + hint.mar.accRangeCnt = 1; + hint.mar.accRangeArray[0].blockNumber = addr / file->blksize; + hint.mar.accRangeArray[0].start = addr % file->blksize; + hint.mar.accRangeArray[0].length = MIN(file->blksize-hint.mar.accRangeArray[0].start, size); + hint.mar.accRangeArray[0].isWrite = 1; + if (gpfs_fcntl(file->fd, &hint)<0) + HGOTO_ERROR(H5E_FILE, H5E_FCNTL, NULL, "failed to send hints to GPFS"); + } +#endif /* USE_GPFS_HINTS */ } /* Seek to the correct location */ diff --git a/src/H5FDmpiposix.h b/src/H5FDmpiposix.h index 2d1b677..cae9370 100644 --- a/src/H5FDmpiposix.h +++ b/src/H5FDmpiposix.h @@ -44,8 +44,8 @@ extern "C" { #endif H5_DLL hid_t H5FD_mpiposix_init(void); -H5_DLL herr_t H5Pset_fapl_mpiposix(hid_t fapl_id, MPI_Comm comm); -H5_DLL herr_t H5Pget_fapl_mpiposix(hid_t fapl_id, MPI_Comm *comm/*out*/); +H5_DLL herr_t H5Pset_fapl_mpiposix(hid_t fapl_id, MPI_Comm comm, hbool_t use_gpfs); +H5_DLL herr_t H5Pget_fapl_mpiposix(hid_t fapl_id, MPI_Comm *comm/*out*/, hbool_t *use_gpfs/*out*/); H5_DLL MPI_Comm H5FD_mpiposix_communicator(H5FD_t *_file); H5_DLL herr_t H5FD_mpiposix_closing(H5FD_t *file); H5_DLL int H5FD_mpiposix_mpi_rank(H5FD_t *_file); diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 41baf2c..03fee85 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -229,6 +229,7 @@ dataset_writeInd(char *filename) hid_t file_dataspace; /* File dataspace ID */ hid_t mem_dataspace; /* memory dataspace ID */ hid_t dataset1, dataset2; /* Dataset ID */ + hbool_t use_gpfs = FALSE; /* Use GPFS hints */ hsize_t dims[RANK]; /* dataset dim sizes */ DATATYPE *data_array1 = NULL; /* data buffer */ @@ -257,7 +258,7 @@ dataset_writeInd(char *filename) * CREATE AN HDF5 FILE WITH PARALLEL ACCESS * ---------------------------------------*/ /* setup file access template */ - acc_tpl = create_faccess_plist(comm, info, facc_type); + acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs); VRFY((acc_tpl >= 0), ""); /* create the file collectively */ @@ -372,6 +373,7 @@ dataset_readInd(char *filename) hid_t file_dataspace; /* File dataspace ID */ hid_t mem_dataspace; /* memory dataspace ID */ hid_t dataset1, dataset2; /* Dataset ID */ + hbool_t use_gpfs = FALSE; /* Use GPFS hints */ DATATYPE *data_array1 = NULL; /* data buffer */ DATATYPE *data_origin1 = NULL; /* expected data buffer */ @@ -399,7 +401,7 @@ dataset_readInd(char *filename) VRFY((data_origin1 != NULL), "data_origin1 malloc succeeded"); /* setup file access template */ - acc_tpl = create_faccess_plist(comm, info, facc_type); + acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs); VRFY((acc_tpl >= 0), ""); /* open the file collectively */ @@ -495,6 +497,7 @@ dataset_writeAll(char *filename) hid_t mem_dataspace; /* memory dataspace ID */ hid_t dataset1, dataset2, dataset3, dataset4; /* Dataset ID */ hid_t datatype; /* Datatype ID */ + hbool_t use_gpfs = FALSE; /* Use GPFS hints */ hsize_t dims[RANK]; /* dataset dim sizes */ DATATYPE *data_array1 = NULL; /* data buffer */ @@ -523,7 +526,7 @@ dataset_writeAll(char *filename) * START AN HDF5 FILE * -------------------*/ /* setup file access template */ - acc_tpl = create_faccess_plist(comm, info, facc_type); + acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs); VRFY((acc_tpl >= 0), ""); /* create the file collectively */ @@ -851,6 +854,7 @@ dataset_readAll(char *filename) hid_t file_dataspace; /* File dataspace ID */ hid_t mem_dataspace; /* memory dataspace ID */ hid_t dataset1, dataset2; /* Dataset ID */ + hbool_t use_gpfs = FALSE; /* Use GPFS hints */ DATATYPE *data_array1 = NULL; /* data buffer */ DATATYPE *data_origin1 = NULL; /* expected data buffer */ @@ -881,7 +885,7 @@ dataset_readAll(char *filename) * OPEN AN HDF5 FILE * -------------------*/ /* setup file access template */ - acc_tpl = create_faccess_plist(comm, info, facc_type); + acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs); VRFY((acc_tpl >= 0), ""); /* open the file collectively */ @@ -1071,6 +1075,7 @@ extend_writeInd(char *filename) hid_t file_dataspace; /* File dataspace ID */ hid_t mem_dataspace; /* memory dataspace ID */ hid_t dataset1, dataset2; /* Dataset ID */ + hbool_t use_gpfs = FALSE; /* Use GPFS hints */ hsize_t dims[RANK]; /* dataset dim sizes */ hsize_t max_dims[RANK] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* dataset maximum dim sizes */ @@ -1108,7 +1113,7 @@ extend_writeInd(char *filename) * START AN HDF5 FILE * -------------------*/ /* setup file access template */ - acc_tpl = create_faccess_plist(comm, info, facc_type); + acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs); VRFY((acc_tpl >= 0), ""); /* Reduce the number of metadata cache slots, so that there are cache @@ -1293,6 +1298,7 @@ extend_readInd(char *filename) hid_t file_dataspace; /* File dataspace ID */ hid_t mem_dataspace; /* memory dataspace ID */ hid_t dataset1, dataset2; /* Dataset ID */ + hbool_t use_gpfs = FALSE; /* Use GPFS hints */ hsize_t dims[RANK]; /* dataset dim sizes */ DATATYPE *data_array1 = NULL; /* data buffer */ DATATYPE *data_array2 = NULL; /* data buffer */ @@ -1327,7 +1333,7 @@ extend_readInd(char *filename) * OPEN AN HDF5 FILE * -------------------*/ /* setup file access template */ - acc_tpl = create_faccess_plist(comm, info, facc_type); + acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs); VRFY((acc_tpl >= 0), ""); /* open the file collectively */ diff --git a/testpar/t_file.c b/testpar/t_file.c index 375c292..a5cb85b 100644 --- a/testpar/t_file.c +++ b/testpar/t_file.c @@ -41,6 +41,7 @@ test_split_comm_access(char *filename) int newrank, newprocs; hid_t fid; /* file IDs */ hid_t acc_tpl; /* File access properties */ + hbool_t use_gpfs = FALSE; /* Use GPFS hints */ herr_t ret; /* generic return value */ if (verbose) @@ -66,7 +67,7 @@ test_split_comm_access(char *filename) MPI_Comm_rank(comm,&sub_mpi_rank); /* setup file access template */ - acc_tpl = create_faccess_plist(comm, info, facc_type); + acc_tpl = create_faccess_plist(comm, info, facc_type, use_gpfs); VRFY((acc_tpl >= 0), ""); /* create the file collectively */ diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c index f4ae360..9d32cb5 100644 --- a/testpar/t_mdset.c +++ b/testpar/t_mdset.c @@ -41,6 +41,7 @@ void multiple_dset_write(char *filename, int ndatasets) int i, j, n, mpi_size, mpi_rank; hid_t iof, plist, dataset, memspace, filespace; hid_t dcpl; /* Dataset creation property list */ + hbool_t use_gpfs = FALSE; /* Use GPFS hints */ hssize_t chunk_origin [DIM]; hsize_t chunk_dims [DIM], file_dims [DIM]; hsize_t count[DIM]={1,1}; @@ -54,9 +55,12 @@ void multiple_dset_write(char *filename, int ndatasets) VRFY((mpi_size <= SIZE), "mpi_size <= SIZE"); - plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); + plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); + VRFY((plist>=0), "create_faccess_plist succeeded"); iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist); - H5Pclose (plist); + VRFY((iof>=0), "H5Fcreate succeeded"); + ret = H5Pclose (plist); + VRFY((ret>=0), "H5Pclose succeeded"); /* decide the hyperslab according to process number. */ get_slab(chunk_origin, chunk_dims, count, file_dims); @@ -106,6 +110,7 @@ void multiple_dset_write(char *filename, int ndatasets) void compact_dataset(char *filename) { int i, j, mpi_size, mpi_rank, err_num=0; + hbool_t use_gpfs = FALSE; hid_t iof, plist, dcpl, dxpl, dataset, memspace, filespace; hssize_t chunk_origin [DIM]; hsize_t chunk_dims [DIM], file_dims [DIM]; @@ -119,7 +124,7 @@ void compact_dataset(char *filename) VRFY((mpi_size <= SIZE), "mpi_size <= SIZE"); - plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); + plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist); /* decide the hyperslab according to process number. */ @@ -177,7 +182,7 @@ void compact_dataset(char *filename) H5Fclose (iof); /* Open the file and dataset, read and compare the data. */ - plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); + plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); iof = H5Fopen(filename, H5F_ACC_RDONLY, plist); VRFY((iof >= 0), "H5Fopen succeeded"); @@ -213,6 +218,7 @@ void collective_group_write(char *filename, int ngroups) { int mpi_rank, mpi_size; int i, j, m; + hbool_t use_gpfs = FALSE; char gname[64], dname[32]; hid_t fid, gid, did, plist, dcpl, memspace, filespace; DATATYPE outme[SIZE][SIZE]; @@ -224,7 +230,7 @@ void collective_group_write(char *filename, int ngroups) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); + plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist); H5Pclose(plist); @@ -291,11 +297,12 @@ void independent_group_read(char *filename, int ngroups) { int mpi_rank, mpi_size, m; hid_t plist, fid; + hbool_t use_gpfs = FALSE; MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); + plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); fid = H5Fopen(filename, H5F_ACC_RDONLY, plist); H5Pclose(plist); @@ -382,6 +389,7 @@ void multiple_group_write(char *filename, int ngroups) { int mpi_rank, mpi_size; int m; + hbool_t use_gpfs = FALSE; char gname[64]; hid_t fid, gid, plist, memspace, filespace; hssize_t chunk_origin[DIM]; @@ -391,7 +399,7 @@ void multiple_group_write(char *filename, int ngroups) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); + plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist); H5Pclose(plist); @@ -526,6 +534,7 @@ void multiple_group_read(char *filename, int ngroups) { int mpi_rank, mpi_size, error_num; int m; + hbool_t use_gpfs = FALSE; char gname[64]; hid_t plist, fid, gid, memspace, filespace; hssize_t chunk_origin[DIM]; @@ -534,7 +543,7 @@ void multiple_group_read(char *filename, int ngroups) MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); - plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type); + plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); fid = H5Fopen(filename, H5F_ACC_RDONLY, plist); H5Pclose(plist); diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index 762396c..206ac0b 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -219,6 +219,7 @@ test_fapl_mpiposix_dup(void) int mpi_size_tmp, mpi_rank_tmp; int mrc; /* MPI return value */ hid_t acc_pl; /* File access properties */ + hbool_t use_gpfs = FALSE; herr_t ret; /* hdf5 return value */ int nkeys, nkeys_tmp; @@ -244,7 +245,7 @@ test_fapl_mpiposix_dup(void) acc_pl = H5Pcreate (H5P_FILE_ACCESS); VRFY((acc_pl >= 0), "H5P_FILE_ACCESS"); - ret = H5Pset_fapl_mpiposix(acc_pl, comm); + ret = H5Pset_fapl_mpiposix(acc_pl, comm, use_gpfs); VRFY((ret >= 0), ""); /* Case 1: @@ -255,7 +256,7 @@ test_fapl_mpiposix_dup(void) mrc = MPI_Comm_free(&comm); VRFY((mrc==MPI_SUCCESS), "MPI_Comm_free"); - ret = H5Pget_fapl_mpiposix(acc_pl, &comm_tmp); + ret = H5Pget_fapl_mpiposix(acc_pl, &comm_tmp, &use_gpfs); VRFY((ret >= 0), "H5Pget_fapl_mpiposix"); MPI_Comm_size(comm_tmp,&mpi_size_tmp); MPI_Comm_rank(comm_tmp,&mpi_rank_tmp); @@ -275,12 +276,12 @@ test_fapl_mpiposix_dup(void) VRFY((mrc==MPI_SUCCESS), "MPI_Comm_free"); /* check NULL argument options. */ - ret = H5Pget_fapl_mpiposix(acc_pl, NULL); + ret = H5Pget_fapl_mpiposix(acc_pl, NULL, NULL); VRFY((ret >= 0), "H5Pget_fapl_mpiposix neither"); /* now get it again and check validity too. */ - /* Donot free the returned object which are used in the next case. */ - ret = H5Pget_fapl_mpiposix(acc_pl, &comm_tmp); + /* Don't free the returned object which is used in the next case. */ + ret = H5Pget_fapl_mpiposix(acc_pl, &comm_tmp, &use_gpfs); VRFY((ret >= 0), "H5Pget_fapl_mpiposix"); MPI_Comm_size(comm_tmp,&mpi_size_tmp); MPI_Comm_rank(comm_tmp,&mpi_rank_tmp); diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index 4bd7dcb..95ecb22 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -273,7 +273,8 @@ parse_options(int argc, char **argv) * Create the appropriate File access property list */ hid_t -create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type ) +create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type, + hbool_t use_gpfs) { hid_t ret_pl = -1; herr_t ret; /* generic return value */ @@ -316,8 +317,8 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type ) if (l_facc_type == FACC_MPIPOSIX) { /* set Parallel access with communicator */ - ret = H5Pset_fapl_mpiposix(ret_pl, comm); - VRFY((ret >= 0), ""); + ret = H5Pset_fapl_mpiposix(ret_pl, comm, use_gpfs); + VRFY((ret >= 0), "H5Pset_fapl_mpiposix succeeded"); return(ret_pl); } diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h index d7634bd..4f3066f 100644 --- a/testpar/testphdf5.h +++ b/testpar/testphdf5.h @@ -19,6 +19,14 @@ #include "h5test.h" +#ifndef TRUE +#define TRUE 1 +#endif /* !TRUE */ + +#ifndef FALSE +#define FALSE (!TRUE) +#endif /* !FALSE */ + /* Define some handy debugging shorthands, routines, ... */ /* debugging tools */ @@ -114,7 +122,7 @@ extern void *old_client_data; /*previous error handler arg.*/ extern int facc_type; /*Test file access type */ /* prototypes */ -hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type ); +hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type, hbool_t use_gpfs); void multiple_dset_write(char *filename, int ndatasets); void multiple_group_write(char *filename, int ngroups); void multiple_group_read(char *filename, int ngroups); -- cgit v0.12