summaryrefslogtreecommitdiffstats
path: root/testpar/testphdf5.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2000-12-12 23:12:57 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2000-12-12 23:12:57 (GMT)
commit061ed07676eccb82c3d46ae744fb094bcd9169e4 (patch)
treeaae107b6290f66862eaf161ad583be533ea1c92d /testpar/testphdf5.c
parentf401dda2d7b1ef22505d285c14218143be011321 (diff)
downloadhdf5-061ed07676eccb82c3d46ae744fb094bcd9169e4.zip
hdf5-061ed07676eccb82c3d46ae744fb094bcd9169e4.tar.gz
hdf5-061ed07676eccb82c3d46ae744fb094bcd9169e4.tar.bz2
[svn-r3119] Purpose:
New features Description: Some testers found the filename lengths too short. Changed it to use the FILENAME_MAX usually defined in stdio.h. If not, set it to 512 which should be sufficient for users but should not exceed any system limits. Also added a new test parameters of ndatasets so that the tester can specific a different number of datasets for the multiple datasets tests. Changed the datatype of datasets created to DOUBLE. This eliminates the current racing conditions. But the racing bugs during conversion still need to be tracked down and squashed. Platforms tested: Modi4 -64.
Diffstat (limited to 'testpar/testphdf5.c')
-rw-r--r--testpar/testphdf5.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c
index d4d79b9..f78a0be 100644
--- a/testpar/testphdf5.c
+++ b/testpar/testphdf5.c
@@ -6,6 +6,10 @@
#include <testphdf5.h>
+#ifndef FILENAME_MAX
+#define FILENAME_MAX 512
+#endif
+
/* global variables */
int dim0 = DIM0;
int dim1 = DIM1;
@@ -13,6 +17,7 @@ int chunkdim0;
int chunkdim1;
int nerrors = 0; /* errors count */
int verbose = 0; /* verbose, default as no. */
+int ndatasets = 300; /*number of datasets to create*/
herr_t (*old_func)(void*); /* previous error handler */
void *old_client_data; /* previous error handler arg.*/
@@ -20,7 +25,6 @@ void *old_client_data; /* previous error handler arg.*/
/* other option flags */
int doread=1; /* read test */
int dowrite=1; /* write test */
-int domdset=1; /* multiple dataset test */
/* FILENAME and filenames must have the same number of names */
const char *FILENAME[5]={
"ParaEg1",
@@ -28,7 +32,7 @@ const char *FILENAME[5]={
"ParaEg3",
"ParaMdset",
NULL};
-char filenames[5][200];
+char filenames[5][FILENAME_MAX];
hid_t fapl; /* file access property list */
@@ -150,10 +154,12 @@ int MPI_Type_create_resized(MPI_Datatype oldtype, MPI_Aint lb, MPI_Aint extent,
void
usage(void)
{
- printf("Usage: testphdf5 [-r] [-w] [-v] [-f <prefix>] [-d <dim0> <dim1>]\n");
+ printf("Usage: testphdf5 [-r] [-w] [-v] [-m<n_datasets>] "
+ "[-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\t\tno multiple dataset test\n");
+ printf("\t-m<n_datasets>"
+ "\tset number of datasets for the multiple dataset test\n");
printf("\t-v\t\tverbose on\n");
printf("\t-f <prefix>\tfilename prefix\n");
printf("\t-d <dim0> <dim1>\tdataset dimensions\n");
@@ -188,7 +194,11 @@ parse_options(int argc, char **argv)
break;
case 'w': dowrite = 0;
break;
- case 'm': domdset = 0;
+ case 'm': ndatasets = atoi((*argv+1)+1);
+ if (ndatasets < 0){
+ nerrors++;
+ return(1);
+ }
break;
case 'v': verbose = 1;
break;
@@ -296,9 +306,9 @@ main(int argc, char **argv)
goto finish;
}
- if (domdset){
+ if (ndatasets){
MPI_BANNER("multiple datasets write ...");
- multiple_dset_write(filenames[3]);
+ multiple_dset_write(filenames[3], ndatasets);
}
else{
MPI_BANNER("Multiple datasets test skipped");
@@ -335,7 +345,7 @@ main(int argc, char **argv)
MPI_BANNER("read tests skipped");
}
- if (!(dowrite || doread || domdset)){
+ if (!(dowrite || doread || ndatasets)){
usage();
nerrors++;
}