diff options
Diffstat (limited to 'testpar/testphdf5.h')
-rw-r--r-- | testpar/testphdf5.h | 124 |
1 files changed, 65 insertions, 59 deletions
diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h index 9a55f6e..3836ba6 100644 --- a/testpar/testphdf5.h +++ b/testpar/testphdf5.h @@ -30,28 +30,28 @@ /* Define some handy debugging shorthands, routines, ... */ /* debugging tools */ -#define MESG(x) \ - if (verbose) printf("%s\n", x); \ - -#define VRFY(val, mesg) do { \ - if (val) { \ - if (*mesg != '\0'){ \ - MESG(mesg); \ - } \ - } \ - else{ \ - printf("Proc %d: ", mpi_rank); \ - printf("*** PHDF5 ERROR ***\n"); \ - printf(" Assertion (%s) failed at line %4d in %s\n", \ - mesg, (int)__LINE__, __FILE__); \ - nerrors++; \ - fflush(stdout); \ - if (!verbose){ \ - printf("aborting MPI process\n"); \ - MPI_Finalize(); exit(nerrors); \ - } \ - } \ - H5Eclear(H5E_DEFAULT); \ +#define MESG(x) \ + if (verbose) printf("%s\n", x); \ + +#define VRFY(val, mesg) do { \ + if (val) { \ + if (*mesg != '\0') { \ + MESG(mesg); \ + } \ + } else { \ + printf("Proc %d: ", mpi_rank); \ + printf("*** PHDF5 ERROR ***\n"); \ + printf(" Assertion (%s) failed at line %4d in %s\n", \ + mesg, (int)__LINE__, __FILE__); \ + ++nerrors; \ + fflush(stdout); \ + if (!verbose) { \ + printf("aborting MPI process\n"); \ + MPI_Finalize(); \ + exit(nerrors); \ + } \ + } \ + H5Eclear(H5E_DEFAULT); \ } while(0) /* @@ -59,32 +59,36 @@ * If val is false, print mesg; else nothing. * Either case, no error setting. */ -#define INFO(val, mesg) do { \ - if (val) { \ - if (*mesg != '\0'){ \ - MESG(mesg); \ - } \ - } \ - else{ \ - printf("Proc %d: ", mpi_rank); \ - printf("*** PHDF5 REMARK (not an error) ***\n"); \ - printf(" Condition (%s) failed at line %4d in %s\n", \ - mesg, (int)__LINE__, __FILE__); \ - fflush(stdout); \ - } \ - H5Eclear(H5E_DEFAULT); \ +#define INFO(val, mesg) do { \ + if (val) { \ + if (*mesg != '\0') { \ + MESG(mesg); \ + } \ + } else { \ + printf("Proc %d: ", mpi_rank); \ + printf("*** PHDF5 REMARK (not an error) ***\n"); \ + printf(" Condition (%s) failed at line %4d in %s\n", \ + mesg, (int)__LINE__, __FILE__); \ + fflush(stdout); \ + } \ + H5Eclear(H5E_DEFAULT); \ } while(0) -#define MPI_BANNER(mesg)\ - {printf("--------------------------------\n");\ - printf("Proc %d: ", mpi_rank); \ - printf("*** %s\n", mesg);\ - printf("--------------------------------\n");} +#define MPI_BANNER(mesg) do { \ + printf("--------------------------------\n"); \ + printf("Proc %d: ", mpi_rank); \ + printf("*** %s\n", mesg); \ + printf("--------------------------------\n"); \ +} while(0) + +#define MAINPROCESS (!mpi_rank) /* define process 0 as main process */ -#define MAINPROCESS (!mpi_rank) /* define process 0 as main process */ +#define SYNC(comm) do { \ + MPI_BANNER("doing a SYNC"); \ + MPI_Barrier(comm); \ + MPI_BANNER("SYNC DONE"); \ +} while(0) -#define SYNC(comm)\ - {MPI_BANNER("doing a SYNC"); MPI_Barrier(comm); MPI_BANNER("SYNC DONE");} /* End of Define some handy debugging shorthands, routines, ... */ /* Constants definitions */ @@ -95,24 +99,25 @@ #define DATASETNAME2 "Data2" #define DATASETNAME3 "Data3" #define DATASETNAME4 "Data4" -/* hyperslab layout styles */ -#define BYROW 1 /* divide into slabs of rows */ -#define BYCOL 2 /* divide into blocks of columns */ -#define ZROW 3 /* same as BYCOL except process 0 gets 0 rows */ -#define ZCOL 4 /* same as BYCOL except process 0 gets 0 columns */ -#define MAX_ERR_REPORT 10 /* Maximum number of errors reported */ + +/* Hyperslab layout styles */ +#define BYROW 1 /* divide into slabs of rows */ +#define BYCOL 2 /* divide into blocks of columns */ +#define ZROW 3 /* same as BYCOL except process 0 gets 0 rows */ +#define ZCOL 4 /* same as BYCOL except process 0 gets 0 columns */ +#define MAX_ERR_REPORT 10 /* Maximum number of errors reported */ /* File_Access_type bits */ -#define FACC_DEFAULT 0x0 /* default */ -#define FACC_MPIO 0x1 /* MPIO */ -#define FACC_SPLIT 0x2 /* Split File */ -#define FACC_MULTI 0x4 /* Multi File */ -#define FACC_MPIPOSIX 0x8 /* MPIPOSIX */ +#define FACC_DEFAULT 0x0 /* default */ +#define FACC_MPIO 0x1 /* MPIO */ +#define FACC_SPLIT 0x2 /* Split File */ +#define FACC_MULTI 0x4 /* Multi File */ +#define FACC_MPIPOSIX 0x8 /* MPIPOSIX */ -/* dataset data type. Int's can be easily octo dumped. */ +/* Dataset data type. Int's can be easily octo dumped. */ typedef int DATATYPE; -/* shared global variables */ +/* Shared global variables */ extern int dim0, dim1; /*Dataset dimensions */ extern int chunkdim0, chunkdim1; /*Chunk dimensions */ extern int nerrors; /*errors count */ @@ -121,7 +126,7 @@ extern H5E_auto_t old_func; /* previous error handler */ extern void *old_client_data; /*previous error handler arg.*/ extern int facc_type; /*Test file access type */ -/* prototypes */ +/* Prototypes */ hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type, hbool_t use_gpfs); MPI_Offset h5_mpi_get_file_size(const char *filename, MPI_Comm comm, MPI_Info info); void multiple_dset_write(char *filename, int ndatasets); @@ -142,6 +147,7 @@ void extend_readInd(char *filename); void extend_readAll(char *filename); void compact_dataset(char *filename); void big_dataset(const char *filename); -int dataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], DATATYPE *dataset, DATATYPE *original); +int dataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[], + hsize_t block[], DATATYPE *dataset, DATATYPE *original); #endif /* PHDF5TEST_H */ |