From dd241064c18efe59768cc5b495fe78b2a779b058 Mon Sep 17 00:00:00 2001 From: cvs2svn Date: Thu, 13 Nov 2003 10:20:23 -0500 Subject: [svn-r7843] This commit was manufactured by cvs2svn to create branch 'hdf5_1_6'. --- perform/perf_meta.c | 852 ++++++++++++++++++++++++++++++++++++++ tools/testfiles/tvldtypes4.h5.xml | 55 +++ tools/testfiles/tvldtypes5.ddl | 14 + tools/testfiles/tvldtypes5.h5 | Bin 0 -> 8192 bytes tools/testfiles/tvldtypes5.h5.xml | 41 ++ 5 files changed, 962 insertions(+) create mode 100644 perform/perf_meta.c create mode 100644 tools/testfiles/tvldtypes4.h5.xml create mode 100644 tools/testfiles/tvldtypes5.ddl create mode 100644 tools/testfiles/tvldtypes5.h5 create mode 100644 tools/testfiles/tvldtypes5.h5.xml diff --git a/perform/perf_meta.c b/perform/perf_meta.c new file mode 100644 index 0000000..c1d7044 --- /dev/null +++ b/perform/perf_meta.c @@ -0,0 +1,852 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Raymond Lu + * Friday, Oct 3, 2004 + * + * Purpose: Tests performance of metadata + */ + +#include "h5test.h" +#include + +#ifdef H5_HAVE_PARALLEL +#define MAINPROCESS (!mpi_rank) /* define process 0 as main process */ +#endif /*H5_HAVE_PARALLEL*/ + +/* File_Access_type bits */ +#define FACC_DEFAULT 0x0 /* serial as default */ +#define FACC_MPIO 0x1 /* MPIO */ +#define FACC_MPIPOSIX 0x8 /* MPIPOSIX */ + +/* Which test to run */ +int RUN_TEST = 0x0; /* all tests as default */ +int TEST_1 = 0x1; /* Test 1 */ +int TEST_2 = 0x2; /* Test 2 */ +int TEST_3 = 0x4; /* Test 3 */ + + +const char *FILENAME[] = { + "meta_perf_1", + "meta_perf_2", + "meta_perf_3", + NULL +}; + +/* Default values for performance. Can be changed through command line options */ +int NUM_DSETS = 16; +int NUM_ATTRS = 8; +int BATCH_ATTRS = 2; +hbool_t flush_dset = FALSE; +hbool_t flush_attr = FALSE; +int nerrors = 0; /* errors count */ +hid_t fapl; + +/* Data space IDs */ +hid_t space; +hid_t small_space; + +/* Performance data */ +typedef struct p_time { + double total; + double avg; + double max; + double min; + double start; + char func[32]; +} p_time; + +/*Test file access type for parallel. MPIO as default */ +int facc_type = FACC_DEFAULT; + +double retrieve_time(void); +void perf(p_time *perf_t, double start_t, double end_t); +void print_perf(p_time, p_time, p_time); + + +/*------------------------------------------------------------------------- + * Function: parse_options + * + Purpose: Parse command line options + * + * Programmer: Raymond Lu + * Friday, Oct 3, 2003 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static int +parse_options(int argc, char **argv) +{ + int t; + + /* Use default values */ + if(argc==1) + return(0); + + while (--argc){ + if (**(++argv) != '-'){ + break; + }else{ + switch(*(*argv+1)){ + case 'h': /* Help page */ + return(1); + + case 'd': /* Number of datasets */ + NUM_DSETS = atoi((*argv+1)+1); + if (NUM_DSETS < 0){ + nerrors++; + return(1); + } + break; + + case 'a': /* Number of attributes per dataset */ + NUM_ATTRS = atoi((*argv+1)+1); + if (NUM_ATTRS < 0){ + nerrors++; + return(1); + } + break; + + case 'n': /* Number of attributes to be created in batch */ + BATCH_ATTRS = atoi((*argv+1)+1); + if (BATCH_ATTRS < 0){ + nerrors++; + return(1); + } + break; + + case 'p': /* Use the MPI-POSIX driver access */ + facc_type = FACC_MPIPOSIX; + break; + + case 'm': /* Use the MPI-POSIX driver access */ + facc_type = FACC_MPIO; + break; + + case 'f': /* Call H5Fflush for each dataset or attribute */ + if(!strcmp("a", (*argv+2))) + flush_attr = TRUE; + else if(!strcmp("d", (*argv+2))) + flush_dset = TRUE; + else { + nerrors++; + return(1); + } + break; + + case 't': /* Which test to run */ + t = atoi((*argv+1)+1); + if (t < 1 || t > 3){ + nerrors++; + return(1); + } + if(t == 1) + RUN_TEST |= TEST_1; + else if(t == 2) + RUN_TEST |= TEST_2; + else + RUN_TEST |= TEST_3; + + break; + + default: nerrors++; + return(1); + } + } + } /*while*/ + + /* Check valid values */ + if(facc_type == FACC_MPIO || facc_type == FACC_MPIPOSIX) +#ifdef H5_HAVE_PARALLEL + ; +#else + { + nerrors++; + return(1); + } +#endif /*H5_HAVE_PARALLEL*/ + + if(NUM_ATTRS && !BATCH_ATTRS) + NUM_ATTRS = 0; + + if(!NUM_ATTRS && BATCH_ATTRS) + BATCH_ATTRS = 0; + + if(!NUM_DSETS) { + nerrors++; + return(1); + } + + if(NUM_ATTRS && BATCH_ATTRS) { + if(BATCH_ATTRS > NUM_ATTRS || NUM_ATTRS % BATCH_ATTRS) { + nerrors++; + return(1); + } + } + + return(0); +} + + +/*------------------------------------------------------------------------- + * Function: usage + * + Purpose: Prints help page + * + * Programmer: Raymond Lu + * Friday, Oct 3, 2003 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static void +usage(void) +{ + printf("Usage: perf_meta [-h] [-m] [-p] [-d]" + "[-a]\n" + "\t[-n] [-f