summaryrefslogtreecommitdiffstats
path: root/testpar
diff options
context:
space:
mode:
authorBill Wendling <wendling@ncsa.uiuc.edu>2003-05-05 20:48:33 (GMT)
committerBill Wendling <wendling@ncsa.uiuc.edu>2003-05-05 20:48:33 (GMT)
commitc12f91908be82a3864fbbe23ff48a8a8abe629d4 (patch)
treeba68b0c811b473b1ed9543ee947d9da0f5c12e7e /testpar
parentf69ae67faa5fd78196f5afd417090c7440781687 (diff)
downloadhdf5-c12f91908be82a3864fbbe23ff48a8a8abe629d4.zip
hdf5-c12f91908be82a3864fbbe23ff48a8a8abe629d4.tar.gz
hdf5-c12f91908be82a3864fbbe23ff48a8a8abe629d4.tar.bz2
[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:
Diffstat (limited to 'testpar')
-rw-r--r--testpar/t_dset.c18
-rw-r--r--testpar/t_file.c3
-rw-r--r--testpar/t_mdset.c25
-rw-r--r--testpar/t_ph5basic.c11
-rw-r--r--testpar/testphdf5.c7
-rw-r--r--testpar/testphdf5.h10
6 files changed, 50 insertions, 24 deletions
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);