From 177d2c795fdf9d9f348172ec6ccdb83d438d3add Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Thu, 5 Jul 2001 16:08:15 -0500 Subject: [svn-r4120] Purpose: Added parallel group testing. Description: See t_mdset.c description. Platforms tested: See t_mdset.c tested platforms. --- testpar/testphdf5.c | 55 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 17 deletions(-) diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index d6cf99f..bade9a1 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -6,9 +6,9 @@ #include "testphdf5.h" -#ifndef FILENAME_MAX -#define FILENAME_MAX 512 -#endif +#ifndef PATH_MAX +#define PATH_MAX 512 +#endif /* !PATH_MAX */ /* global variables */ int dim0 = DIM0; @@ -17,7 +17,9 @@ int chunkdim0; int chunkdim1; int nerrors = 0; /* errors count */ int verbose = 0; /* verbose, default as no. */ -int ndatasets = 300; /*number of datasets to create*/ +int ndatasets = 300; /* number of datasets to create*/ +int ngroups = 512; /* number of groups to create in root + * group. */ herr_t (*old_func)(void*); /* previous error handler */ void *old_client_data; /* previous error handler arg.*/ @@ -26,17 +28,16 @@ void *old_client_data; /* previous error handler arg.*/ int doread=1; /* read test */ int dowrite=1; /* write test */ /* FILENAME and filenames must have the same number of names */ -const char *FILENAME[5]={ +const char *FILENAME[6]={ "ParaEg1", "ParaEg2", "ParaEg3", "ParaMdset", + "ParaMgroup", NULL}; -char filenames[5][FILENAME_MAX]; +char filenames[6][PATH_MAX]; hid_t fapl; /* file access property list */ - - #ifdef USE_PAUSE /* pause the process for a moment to allow debugger to attach if desired. */ /* Will pause more if greenlight file is not persent but will eventually */ @@ -154,12 +155,14 @@ int MPI_Type_create_resized(MPI_Datatype oldtype, MPI_Aint lb, MPI_Aint extent, void usage(void) { - printf("Usage: testphdf5 [-r] [-w] [-v] [-m] " + printf("Usage: testphdf5 [-r] [-w] [-v] [-m] [-n] " "[-f ] [-d ]\n"); printf("\t-r\t\tno read test\n"); printf("\t-w\t\tno write test\n"); printf("\t-m" "\tset number of datasets for the multiple dataset test\n"); + printf("\t-n" + "\tset number of groups for the multiple group test\n"); printf("\t-v\t\tverbose on\n"); printf("\t-f \tfilename prefix\n"); printf("\t-d \tdataset dimensions\n"); @@ -200,6 +203,12 @@ parse_options(int argc, char **argv) return(1); } break; + case 'n': ngroups = atoi((*argv+1)+1); + if (ngroups < 0){ + nerrors++; + return(1); + } + break; case 'v': verbose = 1; break; case 'f': if (--argc < 1) { @@ -306,13 +315,25 @@ main(int argc, char **argv) goto finish; } - if (ndatasets){ - MPI_BANNER("multiple datasets write ..."); - multiple_dset_write(filenames[3], ndatasets); - } - else{ - MPI_BANNER("Multiple datasets test skipped"); - } + if (ndatasets){ + MPI_BANNER("multiple datasets write ..."); + multiple_dset_write(filenames[3], ndatasets); + } + else{ + MPI_BANNER("Multiple datasets test skipped"); + } + + if (ngroups){ + MPI_BANNER("multiple groups write ..."); + multiple_group_write(filenames[4], ngroups); + if (doread) { + MPI_BANNER("multiple groups read ..."); + multiple_group_read(filenames[4], ngroups); + } + } + else{ + MPI_BANNER("Multiple groups test skipped"); + } if (dowrite){ MPI_BANNER("dataset using split communicators..."); @@ -345,7 +366,7 @@ main(int argc, char **argv) MPI_BANNER("read tests skipped"); } - if (!(dowrite || doread || ndatasets)){ + if (!(dowrite || doread || ndatasets || ngroups)){ usage(); nerrors++; } -- cgit v0.12