2003-04-01 02:02:10 +08:00
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
|
|
|
* 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. *
|
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
|
|
|
|
1998-07-02 06:10:04 +08:00
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
#ifndef PHDF5TEST_H
|
|
|
|
#define PHDF5TEST_H
|
|
|
|
|
2001-04-06 01:09:42 +08:00
|
|
|
#include "h5test.h"
|
1998-07-02 06:10:04 +08:00
|
|
|
|
2003-05-06 04:48:33 +08:00
|
|
|
#ifndef TRUE
|
|
|
|
#define TRUE 1
|
|
|
|
#endif /* !TRUE */
|
|
|
|
|
|
|
|
#ifndef FALSE
|
|
|
|
#define FALSE (!TRUE)
|
|
|
|
#endif /* !FALSE */
|
|
|
|
|
1998-07-02 06:10:04 +08:00
|
|
|
/* 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{ \
|
2000-11-21 08:55:14 +08:00
|
|
|
printf("Proc %d: ", mpi_rank); \
|
2002-02-15 22:55:38 +08:00
|
|
|
printf("*** PHDF5 ERROR ***\n"); \
|
|
|
|
printf(" Assertion (%s) failed at line %4d in %s\n", \
|
1998-07-02 06:10:04 +08:00
|
|
|
mesg, (int)__LINE__, __FILE__); \
|
|
|
|
nerrors++; \
|
1998-07-13 13:35:14 +08:00
|
|
|
fflush(stdout); \
|
|
|
|
if (!verbose){ \
|
2000-10-10 02:23:20 +08:00
|
|
|
printf("aborting MPI process\n"); \
|
2000-11-21 08:55:14 +08:00
|
|
|
MPI_Finalize(); exit(nerrors); \
|
1998-07-13 13:35:14 +08:00
|
|
|
} \
|
1998-07-02 06:10:04 +08:00
|
|
|
} \
|
|
|
|
H5Eclear(); \
|
|
|
|
} while(0)
|
|
|
|
|
2001-06-07 14:36:08 +08:00
|
|
|
/*
|
|
|
|
* Checking for information purpose.
|
|
|
|
* 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); \
|
2002-02-15 22:55:38 +08:00
|
|
|
printf("*** PHDF5 REMARK (not an error) ***\n"); \
|
|
|
|
printf(" Condition (%s) failed at line %4d in %s\n", \
|
2001-06-07 14:36:08 +08:00
|
|
|
mesg, (int)__LINE__, __FILE__); \
|
|
|
|
fflush(stdout); \
|
|
|
|
} \
|
|
|
|
H5Eclear(); \
|
|
|
|
} while(0)
|
|
|
|
|
1998-07-02 06:10:04 +08:00
|
|
|
#define MPI_BANNER(mesg)\
|
|
|
|
{printf("--------------------------------\n");\
|
|
|
|
printf("Proc %d: ", mpi_rank); \
|
|
|
|
printf("*** %s\n", mesg);\
|
|
|
|
printf("--------------------------------\n");}
|
|
|
|
|
|
|
|
#define MAINPROCESS (!mpi_rank) /* define process 0 as main process */
|
|
|
|
|
|
|
|
#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 */
|
2000-10-20 14:19:21 +08:00
|
|
|
#define DIM0 600 /* Default dataset sizes. */
|
2001-03-20 06:32:23 +08:00
|
|
|
#define DIM1 1200 /* Values are from a monitor pixel sizes */
|
1998-07-02 06:10:04 +08:00
|
|
|
#define RANK 2
|
|
|
|
#define DATASETNAME1 "Data1"
|
|
|
|
#define DATASETNAME2 "Data2"
|
|
|
|
#define DATASETNAME3 "Data3"
|
2002-11-06 00:31:02 +08:00
|
|
|
#define DATASETNAME4 "Data4"
|
1998-07-02 06:10:04 +08:00
|
|
|
/* hyperslab layout styles */
|
|
|
|
#define BYROW 1 /* divide into slabs of rows */
|
|
|
|
#define BYCOL 2 /* divide into blocks of columns */
|
2000-10-10 02:23:20 +08:00
|
|
|
#define ZROW 3 /* same as BYCOL except process 0 gets 0 rows */
|
|
|
|
#define ZCOL 4 /* same as BYCOL except process 0 gets 0 columns */
|
2001-06-07 14:36:08 +08:00
|
|
|
#define MAX_ERR_REPORT 10 /* Maximum number of errors reported */
|
|
|
|
|
2001-11-02 23:21:51 +08:00
|
|
|
/* 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 */
|
2002-07-15 23:21:44 +08:00
|
|
|
#define FACC_MPIPOSIX 0x8 /* MPIPOSIX */
|
1998-07-02 06:10:04 +08:00
|
|
|
|
|
|
|
/* dataset data type. Int's can be easily octo dumped. */
|
|
|
|
typedef int DATATYPE;
|
|
|
|
|
|
|
|
/* shared global variables */
|
2000-12-13 07:12:57 +08:00
|
|
|
extern int dim0, dim1; /*Dataset dimensions */
|
|
|
|
extern int chunkdim0, chunkdim1; /*Chunk dimensions */
|
|
|
|
extern int nerrors; /*errors count */
|
|
|
|
extern int verbose; /*verbose, default as no. */
|
|
|
|
extern herr_t (*old_func)(void*); /*previous error handler */
|
|
|
|
extern void *old_client_data; /*previous error handler arg.*/
|
2001-11-02 23:21:51 +08:00
|
|
|
extern int facc_type; /*Test file access type */
|
|
|
|
|
|
|
|
/* prototypes */
|
2003-05-06 04:48:33 +08:00
|
|
|
hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type, hbool_t use_gpfs);
|
2002-06-19 20:54:53 +08:00
|
|
|
void multiple_dset_write(char *filename, int ndatasets);
|
|
|
|
void multiple_group_write(char *filename, int ngroups);
|
|
|
|
void multiple_group_read(char *filename, int ngroups);
|
2003-02-19 05:50:42 +08:00
|
|
|
void collective_group_write(char *filename, int ngroups);
|
|
|
|
void independent_group_read(char *filename, int ngroups);
|
2003-04-24 05:19:51 +08:00
|
|
|
void test_fapl_mpio_dup(void);
|
2003-04-25 22:27:36 +08:00
|
|
|
void test_fapl_mpiposix_dup(void);
|
2002-06-19 20:54:53 +08:00
|
|
|
void test_split_comm_access(char *filename);
|
|
|
|
void dataset_writeInd(char *filename);
|
|
|
|
void dataset_writeAll(char *filename);
|
|
|
|
void extend_writeInd(char *filename);
|
2003-06-06 04:05:52 +08:00
|
|
|
void extend_writeAll(char *filename);
|
2002-06-19 20:54:53 +08:00
|
|
|
void dataset_readInd(char *filename);
|
|
|
|
void dataset_readAll(char *filename);
|
|
|
|
void extend_readInd(char *filename);
|
2003-06-06 04:05:52 +08:00
|
|
|
void extend_readAll(char *filename);
|
2002-08-27 21:42:40 +08:00
|
|
|
void compact_dataset(char *filename);
|
2002-06-19 20:54:53 +08:00
|
|
|
int dataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], DATATYPE *dataset, DATATYPE *original);
|
1998-07-02 06:10:04 +08:00
|
|
|
|
|
|
|
#endif /* PHDF5TEST_H */
|