00001 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 00002 * Copyright by The HDF Group. * 00003 * Copyright by the Board of Trustees of the University of Illinois. * 00004 * All rights reserved. * 00005 * * 00006 * This file is part of HDF5. The full HDF5 copyright notice, including * 00007 * terms governing use, modification, and redistribution, is contained in * 00008 * the files COPYING and Copyright.html. COPYING can be found at the root * 00009 * of the source code distribution tree; Copyright.html can be found at the * 00010 * root level of an installed copy of the electronic HDF5 document set and * 00011 * is linked from the top-level documents page. It can also be found at * 00012 * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * 00013 * access to either file, you may request a copy from help@hdfgroup.org. * 00014 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 00015 00016 /* common definitions used by all parallel hdf5 test programs. */ 00017 00018 #ifndef PHDF5TEST_H 00019 #define PHDF5TEST_H 00020 00021 #include "testpar.h" 00022 00023 enum H5TEST_COLL_CHUNK_API {API_NONE=0,API_LINK_HARD, 00024 API_MULTI_HARD,API_LINK_TRUE,API_LINK_FALSE, 00025 API_MULTI_COLL,API_MULTI_IND}; 00026 00027 #ifndef FALSE 00028 #define FALSE 0 00029 #endif 00030 00031 #ifndef TRUE 00032 #define TRUE 1 00033 #endif 00034 00035 00036 /* Constants definitions */ 00037 #define DIM0 600 /* Default dataset sizes. */ 00038 #define DIM1 1200 /* Values are from a monitor pixel sizes */ 00039 #define ROW_FACTOR 8 /* Nominal row factor for dataset size */ 00040 #define COL_FACTOR 16 /* Nominal column factor for dataset size */ 00041 #define RANK 2 00042 #define DATASETNAME1 "Data1" 00043 #define DATASETNAME2 "Data2" 00044 #define DATASETNAME3 "Data3" 00045 #define DATASETNAME4 "Data4" 00046 00047 /* Hyperslab layout styles */ 00048 #define BYROW 1 /* divide into slabs of rows */ 00049 #define BYCOL 2 /* divide into blocks of columns */ 00050 #define ZROW 3 /* same as BYCOL except process 0 gets 0 rows */ 00051 #define ZCOL 4 /* same as BYCOL except process 0 gets 0 columns */ 00052 00053 /* File_Access_type bits */ 00054 #define FACC_DEFAULT 0x0 /* default */ 00055 #define FACC_MPIO 0x1 /* MPIO */ 00056 #define FACC_SPLIT 0x2 /* Split File */ 00057 #define FACC_MULTI 0x4 /* Multi File */ 00058 #define FACC_MPIPOSIX 0x8 /* MPIPOSIX */ 00059 00060 #define DXFER_COLLECTIVE_IO 0x1 /* Collective IO*/ 00061 #define DXFER_INDEPENDENT_IO 0x2 /* Independent IO collectively */ 00062 /*Constants for collective chunk definitions */ 00063 #define SPACE_DIM1 24 00064 #define SPACE_DIM2 4 00065 #define BYROW_CONT 1 00066 #define BYROW_DISCONT 2 00067 #define BYROW_SELECTNONE 3 00068 #define BYROW_SELECTUNBALANCE 4 00069 #define BYROW_SELECTINCHUNK 5 00070 00071 #define DIMO_NUM_CHUNK 4 00072 #define DIM1_NUM_CHUNK 2 00073 #define LINK_TRUE_NUM_CHUNK 2 00074 #define LINK_FALSE_NUM_CHUNK 6 00075 #define MULTI_TRUE_PERCENT 50 00076 #define LINK_TRUE_CHUNK_NAME "h5_link_chunk_true" 00077 #define LINK_FALSE_CHUNK_NAME "h5_link_chunk_false" 00078 #define LINK_HARD_CHUNK_NAME "h5_link_chunk_hard" 00079 #define MULTI_HARD_CHUNK_NAME "h5_multi_chunk_hard" 00080 #define MULTI_COLL_CHUNK_NAME "h5_multi_chunk_coll" 00081 #define MULTI_INDP_CHUNK_NAME "h5_multi_chunk_indp" 00082 00083 #define DSET_COLLECTIVE_CHUNK_NAME "coll_chunk_name" 00084 00085 00086 /*Constants for MPI derived data type generated from span tree */ 00087 00088 #define MSPACE1_RANK 1 /* Rank of the first dataset in memory */ 00089 #define MSPACE1_DIM 27000 /* Dataset size in memory */ 00090 #define FSPACE_RANK 2 /* Dataset rank as it is stored in the file */ 00091 #define FSPACE_DIM1 9 /* Dimension sizes of the dataset as it is stored in the file */ 00092 #define FSPACE_DIM2 3600 /* We will read dataset back from the file to the dataset in memory with these dataspace parameters. */ 00093 #define MSPACE_RANK 2 00094 #define MSPACE_DIM1 9 00095 #define MSPACE_DIM2 3600 00096 #define FHCOUNT0 1 /* Count of the first dimension of the first hyperslab selection*/ 00097 #define FHCOUNT1 768 /* Count of the second dimension of the first hyperslab selection*/ 00098 #define FHSTRIDE0 4 /* Stride of the first dimension of the first hyperslab selection*/ 00099 #define FHSTRIDE1 3 /* Stride of the second dimension of the first hyperslab selection*/ 00100 #define FHBLOCK0 3 /* Block of the first dimension of the first hyperslab selection*/ 00101 #define FHBLOCK1 2 /* Block of the second dimension of the first hyperslab selection*/ 00102 #define FHSTART0 0 /* start of the first dimension of the first hyperslab selection*/ 00103 #define FHSTART1 1 /* start of the second dimension of the first hyperslab selection*/ 00104 00105 #define SHCOUNT0 1 /* Count of the first dimension of the first hyperslab selection*/ 00106 #define SHCOUNT1 1 /* Count of the second dimension of the first hyperslab selection*/ 00107 #define SHSTRIDE0 1 /* Stride of the first dimension of the first hyperslab selection*/ 00108 #define SHSTRIDE1 1 /* Stride of the second dimension of the first hyperslab selection*/ 00109 #define SHBLOCK0 3 /* Block of the first dimension of the first hyperslab selection*/ 00110 #define SHBLOCK1 768 /* Block of the second dimension of the first hyperslab selection*/ 00111 #define SHSTART0 4 /* start of the first dimension of the first hyperslab selection*/ 00112 #define SHSTART1 0 /* start of the second dimension of the first hyperslab selection*/ 00113 00114 #define MHCOUNT0 6912 /* Count of the first dimension of the first hyperslab selection*/ 00115 #define MHSTRIDE0 1 /* Stride of the first dimension of the first hyperslab selection*/ 00116 #define MHBLOCK0 1 /* Block of the first dimension of the first hyperslab selection*/ 00117 #define MHSTART0 1 /* start of the first dimension of the first hyperslab selection*/ 00118 00119 00120 00121 #define RFFHCOUNT0 3 /* Count of the first dimension of the first hyperslab selection*/ 00122 #define RFFHCOUNT1 768 /* Count of the second dimension of the first hyperslab selection*/ 00123 #define RFFHSTRIDE0 1 /* Stride of the first dimension of the first hyperslab selection*/ 00124 #define RFFHSTRIDE1 1 /* Stride of the second dimension of the first hyperslab selection*/ 00125 #define RFFHBLOCK0 1 /* Block of the first dimension of the first hyperslab selection*/ 00126 #define RFFHBLOCK1 1 /* Block of the second dimension of the first hyperslab selection*/ 00127 #define RFFHSTART0 1 /* start of the first dimension of the first hyperslab selection*/ 00128 #define RFFHSTART1 2 /* start of the second dimension of the first hyperslab selection*/ 00129 00130 00131 #define RFSHCOUNT0 3 /* Count of the first dimension of the first hyperslab selection*/ 00132 #define RFSHCOUNT1 1536 /* Count of the second dimension of the first hyperslab selection*/ 00133 #define RFSHSTRIDE0 1 /* Stride of the first dimension of the first hyperslab selection*/ 00134 #define RFSHSTRIDE1 1 /* Stride of the second dimension of the first hyperslab selection*/ 00135 #define RFSHBLOCK0 1 /* Block of the first dimension of the first hyperslab selection*/ 00136 #define RFSHBLOCK1 1 /* Block of the second dimension of the first hyperslab selection*/ 00137 #define RFSHSTART0 2 /* start of the first dimension of the first hyperslab selection*/ 00138 #define RFSHSTART1 4 /* start of the second dimension of the first hyperslab selection*/ 00139 00140 00141 #define RMFHCOUNT0 3 /* Count of the first dimension of the first hyperslab selection*/ 00142 #define RMFHCOUNT1 768 /* Count of the second dimension of the first hyperslab selection*/ 00143 #define RMFHSTRIDE0 1 /* Stride of the first dimension of the first hyperslab selection*/ 00144 #define RMFHSTRIDE1 1 /* Stride of the second dimension of the first hyperslab selection*/ 00145 #define RMFHBLOCK0 1 /* Block of the first dimension of the first hyperslab selection*/ 00146 #define RMFHBLOCK1 1 /* Block of the second dimension of the first hyperslab selection*/ 00147 #define RMFHSTART0 0 /* start of the first dimension of the first hyperslab selection*/ 00148 #define RMFHSTART1 0 /* start of the second dimension of the first hyperslab selection*/ 00149 00150 #define RMSHCOUNT0 3 /* Count of the first dimension of the first hyperslab selection*/ 00151 #define RMSHCOUNT1 1536 /* Count of the second dimension of the first hyperslab selection*/ 00152 #define RMSHSTRIDE0 1 /* Stride of the first dimension of the first hyperslab selection*/ 00153 #define RMSHSTRIDE1 1 /* Stride of the second dimension of the first hyperslab selection*/ 00154 #define RMSHBLOCK0 1 /* Block of the first dimension of the first hyperslab selection*/ 00155 #define RMSHBLOCK1 1 /* Block of the second dimension of the first hyperslab selection*/ 00156 #define RMSHSTART0 1 /* start of the first dimension of the first hyperslab selection*/ 00157 #define RMSHSTART1 2 /* start of the second dimension of the first hyperslab selection*/ 00158 00159 00160 #define NPOINTS 4 /* Number of points that will be selected 00161 and overwritten */ 00162 00163 /* Don't erase these lines, they are put here for debugging purposes */ 00164 /* 00165 #define MSPACE1_RANK 1 00166 #define MSPACE1_DIM 50 00167 #define MSPACE2_RANK 1 00168 #define MSPACE2_DIM 4 00169 #define FSPACE_RANK 2 00170 #define FSPACE_DIM1 8 00171 #define FSPACE_DIM2 12 00172 #define MSPACE_RANK 2 00173 #define MSPACE_DIM1 8 00174 #define MSPACE_DIM2 9 00175 #define NPOINTS 4 00176 00177 00178 */ /* end of debugging macro */ 00179 /* type definitions */ 00180 typedef struct H5Ptest_param_t /* holds extra test parameters */ 00181 { 00182 char *name; 00183 int count; 00184 } H5Ptest_param_t; 00185 00186 /* Dataset data type. Int's can be easily octo dumped. */ 00187 typedef int DATATYPE; 00188 00189 /* Shared global variables */ 00190 extern int dim0, dim1; /*Dataset dimensions */ 00191 extern int chunkdim0, chunkdim1; /*Chunk dimensions */ 00192 extern int nerrors; /*errors count */ 00193 extern H5E_auto2_t old_func; /* previous error handler */ 00194 extern void *old_client_data; /*previous error handler arg.*/ 00195 extern int facc_type; /*Test file access type */ 00196 extern int dxfer_coll_type; 00197 00198 /* Test program prototypes */ 00199 void multiple_dset_write(void); 00200 void multiple_group_write(void); 00201 void multiple_group_read(void); 00202 void collective_group_write(void); 00203 void independent_group_read(void); 00204 void test_fapl_mpio_dup(void); 00205 void test_fapl_mpiposix_dup(void); 00206 void test_split_comm_access(void); 00207 void dataset_writeInd(void); 00208 void dataset_writeAll(void); 00209 void extend_writeInd(void); 00210 void extend_writeInd2(void); 00211 void extend_writeAll(void); 00212 void dataset_readInd(void); 00213 void dataset_readAll(void); 00214 void extend_readInd(void); 00215 void extend_readAll(void); 00216 void none_selection_chunk(void); 00217 void test_chunk_alloc(void); 00218 void test_filter_read(void); 00219 void compact_dataset(void); 00220 void null_dataset(void); 00221 void big_dataset(void); 00222 void dataset_fillvalue(void); 00223 void coll_chunk1(void); 00224 void coll_chunk2(void); 00225 void coll_chunk3(void); 00226 void coll_chunk4(void); 00227 void coll_chunk5(void); 00228 void coll_chunk6(void); 00229 void coll_chunk7(void); 00230 void coll_chunk8(void); 00231 void coll_chunk9(void); 00232 void coll_chunk10(void); 00233 void coll_irregular_cont_read(void); 00234 void coll_irregular_cont_write(void); 00235 void coll_irregular_simple_chunk_read(void); 00236 void coll_irregular_simple_chunk_write(void); 00237 void coll_irregular_complex_chunk_read(void); 00238 void coll_irregular_complex_chunk_write(void); 00239 void io_mode_confusion(void); 00240 #ifdef H5_HAVE_FILTER_DEFLATE 00241 void compress_readAll(void); 00242 #endif /* H5_HAVE_FILTER_DEFLATE */ 00243 00244 /* commonly used prototypes */ 00245 hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type, hbool_t use_gpfs); 00246 MPI_Offset h5_mpi_get_file_size(const char *filename, MPI_Comm comm, MPI_Info info); 00247 int dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], 00248 hsize_t block[], DATATYPE *dataset, DATATYPE *original); 00249 00250 #endif /* PHDF5TEST_H */