diff options
Diffstat (limited to 'testpar/testphdf5.c')
-rw-r--r-- | testpar/testphdf5.c | 94 |
1 files changed, 27 insertions, 67 deletions
diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index 0a99b02..f5f2c6a 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -37,11 +37,6 @@ H5E_auto_t old_func; /* previous error handler */ void *old_client_data; /* previous error handler arg.*/ /* other option flags */ -int doread=1; /* read test */ -int dowrite=1; /* write test */ -int docompact=1; /* compact dataset test */ -int doindependent=1; /* independent test */ -unsigned dobig=0; /* "big" dataset tests */ /* FILENAME and filenames must have the same number of names */ const char *FILENAME[14]={ @@ -119,25 +114,18 @@ int MPI_Init(int *argc, char ***argv) static void usage(void) { - printf(" [-r] [-w] [-v<verbosity>] [-m<n_datasets>] [-n<n_groups>] " + printf(" [-r] [-w] [-m<n_datasets>] [-n<n_groups>] " "[-o] [-f <prefix>] [-d <dim0> <dim1>]\n"); - printf("\t-r\t\tno read test\n"); - printf("\t-w\t\tno write test\n"); printf("\t-m<n_datasets>" "\tset number of datasets for the multiple dataset test\n"); printf("\t-n<n_groups>" "\tset number of groups for the multiple group test\n"); - printf("\t-o\t\tno compact dataset test\n"); - printf("\t-i\t\tno independent read test\n"); - printf("\t-b\t\trun big dataset test\n"); - printf("\t-v<verbosity>\tset verbose level (0-9,l,m,h)\n"); printf("\t-f <prefix>\tfilename prefix\n"); - printf("\t-s\t\tuse Split-file together with MPIO\n"); + printf("\t-2\t\tuse Split-file together with MPIO\n"); printf("\t-p\t\tuse combo MPI-POSIX driver\n"); - printf("\t-d <dim0> <dim1>\tdataset dimensions\n"); - printf("\t-c <dim0> <dim1>\tdataset chunk dimensions\n"); - printf("\tDefault: do write then read with dimensions %dx%d\n", + printf("\t-d <dim0> <dim1>\tdataset dimensions. Defaults (%d,%d)\n", DIM0, DIM1); + printf("\t-c <dim0> <dim1>\tdataset chunk dimensions. Defaults (dim0/10,dim1/10)\n"); printf("\n"); } @@ -162,10 +150,6 @@ parse_options(int argc, char **argv) break; }else{ switch(*(*argv+1)){ - case 'r': doread = 0; - break; - case 'w': dowrite = 0; - break; case 'm': ndatasets = atoi((*argv+1)+1); if (ndatasets < 0){ nerrors++; @@ -178,17 +162,6 @@ parse_options(int argc, char **argv) return(1); } break; - case 'o': docompact = 0; - break; - case 'i': doindependent = 0; - break; - case 'b': dobig = 1; - break; - case 'v': if (*((*argv+1)+1)) - ParseTestVerbosity((*argv+1)+1); - else - SetTestVerbosity(VERBO_MED); - break; case 'f': if (--argc < 1) { nerrors++; return(1); @@ -202,7 +175,7 @@ parse_options(int argc, char **argv) case 'p': /* Use the MPI-POSIX driver access */ facc_type = FACC_MPIPOSIX; break; - case 's': /* Use the split-file driver with MPIO access */ + case '2': /* Use the split-file driver with MPIO access */ /* Can use $HDF5_METAPREFIX to define the */ /* meta-file-prefix. */ facc_type = FACC_MPIO | FACC_SPLIT; @@ -230,7 +203,8 @@ parse_options(int argc, char **argv) break; case 'h': /* print help message--return with nerrors set */ return(1); - default: nerrors++; + default: printf("Illegal option(%s)\n", *argv); + nerrors++; return(1); } } @@ -443,7 +417,6 @@ int main(int argc, char **argv) AddTest("fillvalue", dataset_fillvalue, NULL, "dataset fill value", filenames[8]); - if(mpi_size > 64) { if(MAINPROCESS) { printf("Collective chunk IO tests haven't been tested \n"); @@ -455,13 +428,13 @@ int main(int argc, char **argv) } else { AddTest("coll_chunked1", coll_chunk1,NULL, - "simple collective chunk io",filenames[9]); + "simple collective chunk io",filenames[9]); AddTest("coll_chunked2", coll_chunk2,NULL, - "noncontiguous collective chunk io",filenames[10]); + "noncontiguous collective chunk io",filenames[10]); AddTest("coll_chunked3", coll_chunk3,NULL, - "multi-chunk collective chunk io",filenames[11]); + "multi-chunk collective chunk io",filenames[11]); AddTest("coll_chunked4", coll_chunk4,NULL, - "collective to independent chunk io",filenames[12]); + "collective to independent chunk io",filenames[12]); } /* Display testing information */ @@ -488,42 +461,33 @@ int main(int argc, char **argv) "===================================\n"); } - /* Argument requests */ - if (dobig && sizeof(MPI_Offset)>4){ - SetTest("bigdataset", ONLYTEST); - } - /* Perform requested testing */ PerformTests(); +finish: + /* make sure all processes are finished before final report, cleanup + * and exit. + */ + MPI_Barrier(MPI_COMM_WORLD); + /* Display test summary, if requested */ - if (GetTestSummary()) + if (MAINPROCESS && GetTestSummary()) TestSummary(); /* Clean up test files, if allowed */ if (GetTestCleanup() && !getenv("HDF5_NOCLEANUP")) - TestCleanup(); + h5_cleanup(FILENAME, fapl); + else + /* h5_cleanup would have closed fapl. Now must do it explicitedly */ + H5Pclose(fapl); nerrors += GetTestNumErrs(); - - if (!(dowrite || doread || ndatasets || ngroups || docompact || doindependent || dobig )){ - usage(); - nerrors++; - } - -finish: - /* make sure all processes are finished before final report, cleanup - * and exit. - */ - MPI_Barrier(MPI_COMM_WORLD); - /* Gather errors from all processes */ { int temp; - MPI_Reduce(&nerrors, &temp, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD); - if(mpi_rank==0) - nerrors=temp; + MPI_Allreduce(&nerrors, &temp, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); + nerrors=temp; } if (MAINPROCESS){ /* only process 0 reports */ @@ -534,17 +498,13 @@ finish: printf("PHDF5 tests finished with no errors\n"); printf("===================================\n"); } - if (dowrite) - h5_cleanup(FILENAME, fapl); - else - /* h5_cleanup would have closed fapl. Now must do it explicitedly */ - H5Pclose(fapl); - /* close HDF5 library */ H5close(); /* MPI_Finalize must be called AFTER H5close which may use MPI calls */ MPI_Finalize(); - return(nerrors); + + /* cannot just return (nerrors) because exit code is limited to 1byte */ + return(nerrors!=0); } |