summaryrefslogtreecommitdiffstats
path: root/testpar/t_dset.c
diff options
context:
space:
mode:
Diffstat (limited to 'testpar/t_dset.c')
-rw-r--r--testpar/t_dset.c116
1 files changed, 40 insertions, 76 deletions
diff --git a/testpar/t_dset.c b/testpar/t_dset.c
index 66bdb01..881ce0a 100644
--- a/testpar/t_dset.c
+++ b/testpar/t_dset.c
@@ -59,7 +59,7 @@ slab_set(int mpi_rank, int mpi_size, hssize_t start[], hsize_t count[],
count[1] = 1;
start[0] = mpi_rank*block[0];
start[1] = 0;
-if (verbose) printf("slab_set BYROW\n");
+if (VERBOSE_MED) printf("slab_set BYROW\n");
break;
case BYCOL:
/* Each process takes a block of columns. */
@@ -71,7 +71,7 @@ if (verbose) printf("slab_set BYROW\n");
count[1] = 1;
start[0] = 0;
start[1] = mpi_rank*block[1];
-if (verbose) printf("slab_set BYCOL\n");
+if (VERBOSE_MED) printf("slab_set BYCOL\n");
break;
case ZROW:
/* Similar to BYROW except process 0 gets 0 row */
@@ -83,7 +83,7 @@ if (verbose) printf("slab_set BYCOL\n");
count[1] = 1;
start[0] = (mpi_rank? mpi_rank*block[0] : 0);
start[1] = 0;
-if (verbose) printf("slab_set ZROW\n");
+if (VERBOSE_MED) printf("slab_set ZROW\n");
break;
case ZCOL:
/* Similar to BYCOL except process 0 gets 0 column */
@@ -95,7 +95,7 @@ if (verbose) printf("slab_set ZROW\n");
count[1] = 1;
start[0] = 0;
start[1] = (mpi_rank? mpi_rank*block[1] : 0);
-if (verbose) printf("slab_set ZCOL\n");
+if (VERBOSE_MED) printf("slab_set ZCOL\n");
break;
default:
/* Unknown mode. Set it to cover the whole dataset. */
@@ -108,10 +108,10 @@ if (verbose) printf("slab_set ZCOL\n");
count[1] = 1;
start[0] = 0;
start[1] = 0;
-if (verbose) printf("slab_set wholeset\n");
+if (VERBOSE_MED) printf("slab_set wholeset\n");
break;
}
-if (verbose){
+if (VERBOSE_MED){
printf("start[]=(%ld,%ld), count[]=(%lu,%lu), stride[]=(%lu,%lu), block[]=(%lu,%lu), total datapoints=%lu\n",
(long)start[0], (long)start[1], (unsigned long)count[0], (unsigned long)count[1],
(unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1],
@@ -175,8 +175,8 @@ int dataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t bl
hsize_t i, j;
int vrfyerrs;
- /* print it if verbose */
- if (verbose) {
+ /* print it if VERBOSE_MED */
+ if (VERBOSE_MED) {
printf("dataset_vrfy dumping:::\n");
printf("start(%ld, %ld), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n",
(long)start[0], (long)start[1], (unsigned long)count[0], (unsigned long)count[1],
@@ -191,7 +191,7 @@ int dataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t bl
for (i=0; i < block[0]; i++){
for (j=0; j < block[1]; j++){
if (*dataset != *original){
- if (vrfyerrs++ < MAX_ERR_REPORT || verbose){
+ if (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){
printf("Dataset Verify failed at [%ld][%ld](row %ld, col %ld): expect %d, got %d\n",
(long)i, (long)j,
(long)(i+start[0]), (long)(j+start[1]),
@@ -202,7 +202,7 @@ int dataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t bl
}
}
}
- if (vrfyerrs > MAX_ERR_REPORT && !verbose)
+ if (vrfyerrs > MAX_ERR_REPORT && !VERBOSE_MED)
printf("[more errors ...]\n");
if (vrfyerrs)
printf("%d errors found in dataset_vrfy\n", vrfyerrs);
@@ -245,7 +245,7 @@ dataset_writeInd(char *filename)
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Info info = MPI_INFO_NULL;
- if (verbose)
+ if (VERBOSE_MED)
printf("Independent write test on file %s\n", filename);
/* set up MPI parameters */
@@ -327,7 +327,7 @@ dataset_writeInd(char *filename)
VRFY((ret >= 0), "H5Dwrite dataset2 succeeded");
/* setup dimensions again to write with zero rows for process 0 */
- if (verbose)
+ if (VERBOSE_MED)
printf("writeInd by some with zero row\n");
slab_set(mpi_rank, mpi_size, start, count, stride, block, ZROW);
ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
@@ -389,7 +389,7 @@ dataset_readInd(char *filename)
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Info info = MPI_INFO_NULL;
- if (verbose)
+ if (VERBOSE_MED)
printf("Independent read test on file %s\n", filename);
/* set up MPI parameters */
@@ -513,7 +513,7 @@ dataset_writeAll(char *filename)
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Info info = MPI_INFO_NULL;
- if (verbose)
+ if (VERBOSE_MED)
printf("Collective write test on file %s\n", filename);
/* set up MPI parameters */
@@ -601,7 +601,7 @@ dataset_writeAll(char *filename)
/* fill the local slab with some trivial data */
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
- if (verbose){
+ if (VERBOSE_MED){
MESG("data_array created");
dataset_print(start, block, data_array1);
}
@@ -619,7 +619,7 @@ dataset_writeAll(char *filename)
VRFY((ret >= 0), "H5Dwrite dataset1 succeeded");
/* setup dimensions again to writeAll with zero rows for process 0 */
- if (verbose)
+ if (VERBOSE_MED)
printf("writeAll by some with zero row\n");
slab_set(mpi_rank, mpi_size, start, count, stride, block, ZROW);
ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
@@ -647,7 +647,7 @@ dataset_writeAll(char *filename)
/* put some trivial data in the data_array */
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
- if (verbose){
+ if (VERBOSE_MED){
MESG("data_array created");
dataset_print(start, block, data_array1);
}
@@ -665,7 +665,7 @@ dataset_writeAll(char *filename)
/* fill the local slab with some trivial data */
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
- if (verbose){
+ if (VERBOSE_MED){
MESG("data_array created");
dataset_print(start, block, data_array1);
}
@@ -682,7 +682,7 @@ dataset_writeAll(char *filename)
VRFY((ret >= 0), "H5Dwrite dataset2 succeeded");
/* setup dimensions again to writeAll with zero columns for process 0 */
- if (verbose)
+ if (VERBOSE_MED)
printf("writeAll by some with zero col\n");
slab_set(mpi_rank, mpi_size, start, count, stride, block, ZCOL);
ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
@@ -731,7 +731,7 @@ dataset_writeAll(char *filename)
/* fill the local slab with some trivial data */
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
- if (verbose) {
+ if (VERBOSE_MED) {
MESG("data_array created");
dataset_print(start, block, data_array1);
} /* end if */
@@ -791,7 +791,7 @@ dataset_writeAll(char *filename)
/* fill the local slab with some trivial data */
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
- if (verbose) {
+ if (VERBOSE_MED) {
MESG("data_array created");
dataset_print(start, block, data_array1);
} /* end if */
@@ -870,7 +870,7 @@ dataset_readAll(char *filename)
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Info info = MPI_INFO_NULL;
- if (verbose)
+ if (VERBOSE_MED)
printf("Collective read test on file %s\n", filename);
/* set up MPI parameters */
@@ -930,7 +930,7 @@ dataset_readAll(char *filename)
/* fill dataset with test data */
dataset_fill(start, block, data_origin1);
MESG("data_array initialized");
- if (verbose){
+ if (VERBOSE_MED){
MESG("data_array created");
dataset_print(start, block, data_origin1);
}
@@ -951,7 +951,7 @@ dataset_readAll(char *filename)
if (ret) nerrors++;
/* setup dimensions again to readAll with zero columns for process 0 */
- if (verbose)
+ if (VERBOSE_MED)
printf("readAll by some with zero col\n");
slab_set(mpi_rank, mpi_size, start, count, stride, block, ZCOL);
ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
@@ -993,7 +993,7 @@ dataset_readAll(char *filename)
/* fill dataset with test data */
dataset_fill(start, block, data_origin1);
MESG("data_array initialized");
- if (verbose){
+ if (VERBOSE_MED){
MESG("data_array created");
dataset_print(start, block, data_origin1);
}
@@ -1014,7 +1014,7 @@ dataset_readAll(char *filename)
if (ret) nerrors++;
/* setup dimensions again to readAll with zero rows for process 0 */
- if (verbose)
+ if (VERBOSE_MED)
printf("readAll by some with zero row\n");
slab_set(mpi_rank, mpi_size, start, count, stride, block, ZROW);
ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
@@ -1096,7 +1096,7 @@ extend_writeInd(char *filename)
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Info info = MPI_INFO_NULL;
- if (verbose)
+ if (VERBOSE_MED)
printf("Extend independent write test on file %s\n", filename);
/* set up MPI parameters */
@@ -1149,7 +1149,7 @@ extend_writeInd(char *filename)
* ------------------------------------------------------------- */
/* set up dataset storage chunk sizes and creation property list */
- if (verbose)
+ if (VERBOSE_MED)
printf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]);
dataset_pl = H5Pcreate(H5P_DATASET_CREATE);
VRFY((dataset_pl >= 0), "H5Pcreate succeeded");
@@ -1185,7 +1185,7 @@ extend_writeInd(char *filename)
/* put some trivial data in the data_array */
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
- if (verbose){
+ if (VERBOSE_MED){
MESG("data_array created");
dataset_print(start, block, data_array1);
}
@@ -1225,7 +1225,7 @@ extend_writeInd(char *filename)
/* put some trivial data in the data_array */
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
- if (verbose){
+ if (VERBOSE_MED){
MESG("data_array created");
dataset_print(start, block, data_array1);
}
@@ -1236,13 +1236,8 @@ extend_writeInd(char *filename)
/* Try write to dataset2 beyond its current dim sizes. Should fail. */
/* Temporary turn off auto error reporting */
-#ifdef H5_WANT_H5_V1_6_COMPAT
H5Eget_auto(&old_func, &old_client_data);
H5Eset_auto(NULL, NULL);
-#else /* H5_WANT_H5_V1_6_COMPAT */
- H5Eget_auto(H5E_DEFAULT, &old_func, &old_client_data);
- H5Eset_auto(H5E_DEFAULT, NULL, NULL);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset2);
@@ -1256,11 +1251,7 @@ extend_writeInd(char *filename)
VRFY((ret < 0), "H5Dwrite failed as expected");
/* restore auto error reporting */
-#ifdef H5_WANT_H5_V1_6_COMPAT
H5Eset_auto(old_func, old_client_data);
-#else /* H5_WANT_H5_V1_6_COMPAT */
- H5Eset_auto(H5E_DEFAULT, old_func, old_client_data);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
H5Sclose(file_dataspace);
/* Extend dataset2 and try again. Should succeed. */
@@ -1325,7 +1316,7 @@ extend_readInd(char *filename)
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Info info = MPI_INFO_NULL;
- if (verbose)
+ if (VERBOSE_MED)
printf("Extend independent read test on file %s\n", filename);
/* set up MPI parameters */
@@ -1365,13 +1356,8 @@ extend_readInd(char *filename)
/* Try extend dataset1 which is open RDONLY. Should fail. */
/* first turn off auto error reporting */
-#ifdef H5_WANT_H5_V1_6_COMPAT
H5Eget_auto(&old_func, &old_client_data);
H5Eset_auto(NULL, NULL);
-#else /* H5_WANT_H5_V1_6_COMPAT */
- H5Eget_auto(H5E_DEFAULT, &old_func, &old_client_data);
- H5Eset_auto(H5E_DEFAULT, NULL, NULL);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
file_dataspace = H5Dget_space (dataset1);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
@@ -1382,11 +1368,7 @@ extend_readInd(char *filename)
VRFY((ret < 0), "H5Dextend failed as expected");
/* restore auto error reporting */
-#ifdef H5_WANT_H5_V1_6_COMPAT
H5Eset_auto(old_func, old_client_data);
-#else /* H5_WANT_H5_V1_6_COMPAT */
- H5Eset_auto(H5E_DEFAULT, old_func, old_client_data);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
H5Sclose(file_dataspace);
@@ -1406,7 +1388,7 @@ extend_readInd(char *filename)
/* fill dataset with test data */
dataset_fill(start, block, data_origin1);
- if (verbose){
+ if (VERBOSE_MED){
MESG("data_array created");
dataset_print(start, block, data_array1);
}
@@ -1441,7 +1423,7 @@ extend_readInd(char *filename)
/* fill dataset with test data */
dataset_fill(start, block, data_origin1);
- if (verbose){
+ if (VERBOSE_MED){
MESG("data_array created");
dataset_print(start, block, data_array1);
}
@@ -1516,7 +1498,7 @@ extend_writeAll(char *filename)
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Info info = MPI_INFO_NULL;
- if (verbose)
+ if (VERBOSE_MED)
printf("Extend independent write test on file %s\n", filename);
/* set up MPI parameters */
@@ -1569,7 +1551,7 @@ extend_writeAll(char *filename)
* ------------------------------------------------------------- */
/* set up dataset storage chunk sizes and creation property list */
- if (verbose)
+ if (VERBOSE_MED)
printf("chunks[]=%lu,%lu\n", (unsigned long)chunk_dims[0], (unsigned long)chunk_dims[1]);
dataset_pl = H5Pcreate(H5P_DATASET_CREATE);
VRFY((dataset_pl >= 0), "H5Pcreate succeeded");
@@ -1605,7 +1587,7 @@ extend_writeAll(char *filename)
/* put some trivial data in the data_array */
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
- if (verbose){
+ if (VERBOSE_MED){
MESG("data_array created");
dataset_print(start, block, data_array1);
}
@@ -1652,7 +1634,7 @@ extend_writeAll(char *filename)
/* put some trivial data in the data_array */
dataset_fill(start, block, data_array1);
MESG("data_array initialized");
- if (verbose){
+ if (VERBOSE_MED){
MESG("data_array created");
dataset_print(start, block, data_array1);
}
@@ -1669,13 +1651,8 @@ extend_writeAll(char *filename)
/* Try write to dataset2 beyond its current dim sizes. Should fail. */
/* Temporary turn off auto error reporting */
-#ifdef H5_WANT_H5_V1_6_COMPAT
H5Eget_auto(&old_func, &old_client_data);
H5Eset_auto(NULL, NULL);
-#else /* H5_WANT_H5_V1_6_COMPAT */
- H5Eget_auto(H5E_DEFAULT, &old_func, &old_client_data);
- H5Eset_auto(H5E_DEFAULT, NULL, NULL);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset2);
@@ -1689,11 +1666,7 @@ extend_writeAll(char *filename)
VRFY((ret < 0), "H5Dwrite failed as expected");
/* restore auto error reporting */
-#ifdef H5_WANT_H5_V1_6_COMPAT
H5Eset_auto(old_func, old_client_data);
-#else /* H5_WANT_H5_V1_6_COMPAT */
- H5Eset_auto(H5E_DEFAULT, old_func, old_client_data);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
H5Sclose(file_dataspace);
/* Extend dataset2 and try again. Should succeed. */
@@ -1761,7 +1734,7 @@ extend_readAll(char *filename)
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Info info = MPI_INFO_NULL;
- if (verbose)
+ if (VERBOSE_MED)
printf("Extend independent read test on file %s\n", filename);
/* set up MPI parameters */
@@ -1801,13 +1774,8 @@ extend_readAll(char *filename)
/* Try extend dataset1 which is open RDONLY. Should fail. */
/* first turn off auto error reporting */
-#ifdef H5_WANT_H5_V1_6_COMPAT
H5Eget_auto(&old_func, &old_client_data);
H5Eset_auto(NULL, NULL);
-#else /* H5_WANT_H5_V1_6_COMPAT */
- H5Eget_auto(H5E_DEFAULT, &old_func, &old_client_data);
- H5Eset_auto(H5E_DEFAULT, NULL, NULL);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
file_dataspace = H5Dget_space (dataset1);
VRFY((file_dataspace >= 0), "H5Dget_space succeeded");
@@ -1818,11 +1786,7 @@ extend_readAll(char *filename)
VRFY((ret < 0), "H5Dextend failed as expected");
/* restore auto error reporting */
-#ifdef H5_WANT_H5_V1_6_COMPAT
H5Eset_auto(old_func, old_client_data);
-#else /* H5_WANT_H5_V1_6_COMPAT */
- H5Eset_auto(H5E_DEFAULT, old_func, old_client_data);
-#endif /* H5_WANT_H5_V1_6_COMPAT */
H5Sclose(file_dataspace);
@@ -1842,7 +1806,7 @@ extend_readAll(char *filename)
/* fill dataset with test data */
dataset_fill(start, block, data_origin1);
- if (verbose){
+ if (VERBOSE_MED){
MESG("data_array created");
dataset_print(start, block, data_array1);
}
@@ -1884,7 +1848,7 @@ extend_readAll(char *filename)
/* fill dataset with test data */
dataset_fill(start, block, data_origin1);
- if (verbose){
+ if (VERBOSE_MED){
MESG("data_array created");
dataset_print(start, block, data_array1);
}