diff options
Diffstat (limited to 'testpar')
-rw-r--r-- | testpar/t_dset.c | 36 | ||||
-rw-r--r-- | testpar/testphdf5.h | 40 |
2 files changed, 76 insertions, 0 deletions
diff --git a/testpar/t_dset.c b/testpar/t_dset.c index 829e7c6..66bdb01 100644 --- a/testpar/t_dset.c +++ b/testpar/t_dset.c @@ -1236,8 +1236,13 @@ 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); @@ -1251,7 +1256,11 @@ 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. */ @@ -1356,8 +1365,13 @@ 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"); @@ -1368,7 +1382,11 @@ 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); @@ -1651,8 +1669,13 @@ 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); @@ -1666,7 +1689,11 @@ 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. */ @@ -1774,8 +1801,13 @@ 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"); @@ -1786,7 +1818,11 @@ 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); diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h index 3836ba6..711d189 100644 --- a/testpar/testphdf5.h +++ b/testpar/testphdf5.h @@ -33,6 +33,28 @@ #define MESG(x) \ if (verbose) printf("%s\n", x); \ +#ifdef H5_WANT_H5_V1_6_COMPAT +#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(); \ +} while(0) +#else /* H5_WANT_H5_V1_6_COMPAT */ #define VRFY(val, mesg) do { \ if (val) { \ if (*mesg != '\0') { \ @@ -53,12 +75,29 @@ } \ H5Eclear(H5E_DEFAULT); \ } while(0) +#endif /* H5_WANT_H5_V1_6_COMPAT */ /* * Checking for information purpose. * If val is false, print mesg; else nothing. * Either case, no error setting. */ +#ifdef H5_WANT_H5_V1_6_COMPAT +#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(); \ +} while(0) +#else /* H5_WANT_H5_V1_6_COMPAT */ #define INFO(val, mesg) do { \ if (val) { \ if (*mesg != '\0') { \ @@ -73,6 +112,7 @@ } \ H5Eclear(H5E_DEFAULT); \ } while(0) +#endif /* H5_WANT_H5_V1_6_COMPAT */ #define MPI_BANNER(mesg) do { \ printf("--------------------------------\n"); \ |