diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.am | 4 | ||||
-rw-r--r-- | test/cache.c | 499 | ||||
-rw-r--r-- | test/cache_api.c | 48 | ||||
-rw-r--r-- | test/cache_common.c | 24 | ||||
-rw-r--r-- | test/cache_image.c | 36 | ||||
-rw-r--r-- | test/h5test.h | 8 | ||||
-rw-r--r-- | test/hdfs.c | 2 | ||||
-rw-r--r-- | test/ros3.c | 2 | ||||
-rw-r--r-- | test/s3comms.c | 2 | ||||
-rw-r--r-- | test/testframe.c | 22 | ||||
-rw-r--r-- | test/testvfdswmr.sh.in | 75 | ||||
-rw-r--r-- | test/vfd_swmr_dsetchks_writer.c | 2274 |
12 files changed, 2685 insertions, 311 deletions
diff --git a/test/Makefile.am b/test/Makefile.am index 2d76946..ee35664 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -112,6 +112,7 @@ check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version \ vfd_swmr_zoo_reader vfd_swmr_zoo_writer \ vfd_swmr_attrdset_reader vfd_swmr_attrdset_writer \ vfd_swmr_check_compat \ + vfd_swmr_dsetchks_reader vfd_swmr_dsetchks_writer \ swmr_check_compat_vfd vds_env vds_swmr_gen vds_swmr_reader vds_swmr_writer \ mirror_vfd if HAVE_SHARED_CONDITIONAL @@ -182,6 +183,9 @@ vfd_swmr_dsetops_reader_SOURCES=vfd_swmr_dsetops_writer.c vfd_swmr_attrdset_writer_SOURCES=vfd_swmr_attrdset_writer.c vfd_swmr_attrdset_reader_SOURCES=vfd_swmr_attrdset_writer.c +vfd_swmr_dsetchks_writer_SOURCES=vfd_swmr_dsetchks_writer.c +vfd_swmr_dsetchks_reader_SOURCES=vfd_swmr_dsetchks_writer.c + # Additional target for running timing test timings _timings: testmeta @for timing in $(TIMINGS) dummy; do \ diff --git a/test/cache.c b/test/cache.c index 78e902c..6ded559 100644 --- a/test/cache.c +++ b/test/cache.c @@ -280,17 +280,17 @@ smoke_check_1(int express_test, unsigned paged) pass = TRUE; if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); reset_entries(); if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(4 * 1024 * 1024), (size_t)(2 * 1024 * 1024), paged); if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -308,7 +308,7 @@ smoke_check_1(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -326,7 +326,7 @@ smoke_check_1(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -344,7 +344,7 @@ smoke_check_1(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -354,7 +354,7 @@ smoke_check_1(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -367,7 +367,7 @@ smoke_check_1(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -377,7 +377,7 @@ smoke_check_1(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -390,12 +390,12 @@ smoke_check_1(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if (show_progress) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -409,7 +409,7 @@ smoke_check_1(int express_test, unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -478,17 +478,17 @@ smoke_check_2(int express_test, unsigned paged) pass = TRUE; if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); reset_entries(); if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(4 * 1024 * 1024), (size_t)(2 * 1024 * 1024), paged); if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -506,7 +506,7 @@ smoke_check_2(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -524,7 +524,7 @@ smoke_check_2(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -542,7 +542,7 @@ smoke_check_2(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -552,7 +552,7 @@ smoke_check_2(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -565,7 +565,7 @@ smoke_check_2(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -575,7 +575,7 @@ smoke_check_2(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -588,12 +588,12 @@ smoke_check_2(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if (show_progress) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -607,7 +607,7 @@ smoke_check_2(int express_test, unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -675,17 +675,17 @@ smoke_check_3(int express_test, unsigned paged) pass = TRUE; if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); reset_entries(); if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024), paged); if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -703,7 +703,7 @@ smoke_check_3(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -721,7 +721,7 @@ smoke_check_3(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -739,7 +739,7 @@ smoke_check_3(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -749,7 +749,7 @@ smoke_check_3(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -762,7 +762,7 @@ smoke_check_3(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -772,7 +772,7 @@ smoke_check_3(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -785,12 +785,12 @@ smoke_check_3(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if (show_progress) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -804,7 +804,7 @@ smoke_check_3(int express_test, unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -873,17 +873,17 @@ smoke_check_4(int express_test, unsigned paged) pass = TRUE; if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); reset_entries(); if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024), paged); if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -901,7 +901,7 @@ smoke_check_4(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -919,7 +919,7 @@ smoke_check_4(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -937,7 +937,7 @@ smoke_check_4(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -947,7 +947,7 @@ smoke_check_4(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -960,7 +960,7 @@ smoke_check_4(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -970,7 +970,7 @@ smoke_check_4(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -983,12 +983,12 @@ smoke_check_4(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if (show_progress) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -1002,7 +1002,7 @@ smoke_check_4(int express_test, unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -1116,12 +1116,12 @@ smoke_check_5(int express_test, unsigned paged) pass = TRUE; if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); reset_entries(); if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024), paged); cache_ptr = file_ptr->shared->cache; @@ -1138,7 +1138,7 @@ smoke_check_5(int express_test, unsigned paged) } if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1149,7 +1149,7 @@ smoke_check_5(int express_test, unsigned paged) /* do_inserts */ FALSE); if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_row_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1160,7 +1160,7 @@ smoke_check_5(int express_test, unsigned paged) /* do_inserts */ FALSE); if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1171,7 +1171,7 @@ smoke_check_5(int express_test, unsigned paged) /* do_inserts */ TRUE); if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -1181,7 +1181,7 @@ smoke_check_5(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1193,7 +1193,7 @@ smoke_check_5(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -1203,7 +1203,7 @@ smoke_check_5(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_col_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1215,12 +1215,12 @@ smoke_check_5(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if (show_progress) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -1234,7 +1234,7 @@ smoke_check_5(int express_test, unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -1348,12 +1348,12 @@ smoke_check_6(int express_test, unsigned paged) } if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); reset_entries(); if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024), paged); cache_ptr = file_ptr->shared->cache; @@ -1370,7 +1370,7 @@ smoke_check_6(int express_test, unsigned paged) } if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1381,7 +1381,7 @@ smoke_check_6(int express_test, unsigned paged) /* do_inserts */ FALSE); if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_row_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1392,7 +1392,7 @@ smoke_check_6(int express_test, unsigned paged) /* do_inserts */ FALSE); if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1403,7 +1403,7 @@ smoke_check_6(int express_test, unsigned paged) /* do_inserts */ TRUE); if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -1413,7 +1413,7 @@ smoke_check_6(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1425,7 +1425,7 @@ smoke_check_6(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -1435,7 +1435,7 @@ smoke_check_6(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_col_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1447,12 +1447,12 @@ smoke_check_6(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if (show_progress) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -1466,7 +1466,7 @@ smoke_check_6(int express_test, unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -1581,12 +1581,12 @@ smoke_check_7(int express_test, unsigned paged) pass = TRUE; if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); reset_entries(); if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024), paged); cache_ptr = file_ptr->shared->cache; @@ -1603,7 +1603,7 @@ smoke_check_7(int express_test, unsigned paged) } if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1614,7 +1614,7 @@ smoke_check_7(int express_test, unsigned paged) /* do_inserts */ FALSE); if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_row_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1625,7 +1625,7 @@ smoke_check_7(int express_test, unsigned paged) /* do_inserts */ FALSE); if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1636,7 +1636,7 @@ smoke_check_7(int express_test, unsigned paged) /* do_inserts */ TRUE); if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -1646,7 +1646,7 @@ smoke_check_7(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1658,7 +1658,7 @@ smoke_check_7(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -1668,7 +1668,7 @@ smoke_check_7(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_col_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1680,12 +1680,12 @@ smoke_check_7(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if (show_progress) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -1699,7 +1699,7 @@ smoke_check_7(int express_test, unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -1814,12 +1814,12 @@ smoke_check_8(int express_test, unsigned paged) pass = TRUE; if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); reset_entries(); if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024), paged); cache_ptr = file_ptr->shared->cache; @@ -1836,7 +1836,7 @@ smoke_check_8(int express_test, unsigned paged) } if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1847,7 +1847,7 @@ smoke_check_8(int express_test, unsigned paged) /* do_inserts */ FALSE); if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_row_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1858,7 +1858,7 @@ smoke_check_8(int express_test, unsigned paged) /* do_inserts */ FALSE); if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1869,7 +1869,7 @@ smoke_check_8(int express_test, unsigned paged) /* do_inserts */ TRUE); if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -1879,7 +1879,7 @@ smoke_check_8(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1891,7 +1891,7 @@ smoke_check_8(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -1901,7 +1901,7 @@ smoke_check_8(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); hl_col_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -1913,12 +1913,12 @@ smoke_check_8(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if (show_progress) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -1932,7 +1932,7 @@ smoke_check_8(int express_test, unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -2011,12 +2011,12 @@ smoke_check_9(int express_test, unsigned paged) pass = TRUE; if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); reset_entries(); if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(4 * 1024 * 1024), (size_t)(2 * 1024 * 1024), paged); cache_ptr = file_ptr->shared->cache; @@ -2024,7 +2024,7 @@ smoke_check_9(int express_test, unsigned paged) /* disable evictions */ if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2038,7 +2038,8 @@ smoke_check_9(int express_test, unsigned paged) } if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", __func__, mile_stone++, + (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -2058,7 +2059,7 @@ smoke_check_9(int express_test, unsigned paged) /* enable evictions */ if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2072,7 +2073,8 @@ smoke_check_9(int express_test, unsigned paged) } if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled \n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled \n", __func__, mile_stone++, + (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -2090,7 +2092,7 @@ smoke_check_9(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2104,7 +2106,8 @@ smoke_check_9(int express_test, unsigned paged) } if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled \n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled \n", __func__, mile_stone++, + (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -2122,7 +2125,7 @@ smoke_check_9(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2136,7 +2139,8 @@ smoke_check_9(int express_test, unsigned paged) } if (show_progress) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled \n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled \n", __func__, mile_stone++, + (int)pass); /* flush and destroy all entries in the cache: */ @@ -2146,7 +2150,7 @@ smoke_check_9(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2160,7 +2164,8 @@ smoke_check_9(int express_test, unsigned paged) } if (show_progress) /* 12 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", __func__, mile_stone++, + (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -2173,7 +2178,7 @@ smoke_check_9(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 13 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush all entries in the cache: */ @@ -2183,7 +2188,7 @@ smoke_check_9(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 14 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2197,7 +2202,8 @@ smoke_check_9(int express_test, unsigned paged) } if (show_progress) /* 15 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", __func__, mile_stone++, + (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -2210,7 +2216,7 @@ smoke_check_9(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 16 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2224,12 +2230,13 @@ smoke_check_9(int express_test, unsigned paged) } if (show_progress) /* 17 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", __func__, mile_stone++, + (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if (show_progress) /* 18 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -2243,7 +2250,7 @@ smoke_check_9(int express_test, unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -2322,18 +2329,19 @@ smoke_check_10(int express_test, unsigned paged) pass = TRUE; if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); reset_entries(); if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(4 * 1024 * 1024), (size_t)(2 * 1024 * 1024), paged); cache_ptr = file_ptr->shared->cache; if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", __func__, mile_stone++, + (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -2351,7 +2359,7 @@ smoke_check_10(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2365,7 +2373,8 @@ smoke_check_10(int express_test, unsigned paged) } if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", __func__, mile_stone++, + (int)pass); row_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -2383,7 +2392,7 @@ smoke_check_10(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2397,7 +2406,8 @@ smoke_check_10(int express_test, unsigned paged) } if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", __func__, mile_stone++, + (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -2415,7 +2425,7 @@ smoke_check_10(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2429,7 +2439,8 @@ smoke_check_10(int express_test, unsigned paged) } if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", __func__, mile_stone++, + (int)pass); /* flush and destroy all entries in the cache: */ @@ -2439,7 +2450,7 @@ smoke_check_10(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2453,7 +2464,8 @@ smoke_check_10(int express_test, unsigned paged) } if (show_progress) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", __func__, mile_stone++, + (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -2466,7 +2478,7 @@ smoke_check_10(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 12 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2480,7 +2492,8 @@ smoke_check_10(int express_test, unsigned paged) } if (show_progress) /* 13 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", __func__, mile_stone++, + (int)pass); /* flush all entries in the cache: */ @@ -2490,7 +2503,7 @@ smoke_check_10(int express_test, unsigned paged) /* dump_detailed_stats */ FALSE); if (show_progress) /* 14 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2504,7 +2517,8 @@ smoke_check_10(int express_test, unsigned paged) } if (show_progress) /* 15 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions enabled\n", __func__, mile_stone++, + (int)pass); col_major_scan_backward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -2517,7 +2531,7 @@ smoke_check_10(int express_test, unsigned paged) /* dirty_unprotects */ dirty_unprotects); if (show_progress) /* 16 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -2531,12 +2545,13 @@ smoke_check_10(int express_test, unsigned paged) } if (show_progress) /* 17 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d -- evictions disabled\n", __func__, mile_stone++, + (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if (show_progress) /* 18 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -2550,7 +2565,7 @@ smoke_check_10(int express_test, unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -2625,17 +2640,17 @@ write_permitted_check(int pass = TRUE; if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); reset_entries(); if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); file_ptr = setup_cache((size_t)(1 * 1024 * 1024), (size_t)0, paged); if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); row_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -2653,7 +2668,7 @@ write_permitted_check(int /* dirty_unprotects */ TRUE); if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); write_permitted = FALSE; @@ -2673,7 +2688,7 @@ write_permitted_check(int /* dirty_unprotects */ NO_CHANGE); if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); write_permitted = TRUE; @@ -2693,7 +2708,7 @@ write_permitted_check(int /* dirty_unprotects */ TRUE); if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ @@ -2703,7 +2718,7 @@ write_permitted_check(int /* dump_detailed_stats */ FALSE); if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); col_major_scan_forward(/* file_ptr */ file_ptr, /* max_index */ max_index, @@ -2716,7 +2731,7 @@ write_permitted_check(int /* dirty_unprotects */ TRUE); if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); write_permitted = FALSE; @@ -2733,12 +2748,12 @@ write_permitted_check(int write_permitted = TRUE; if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); takedown_cache(file_ptr, display_stats, TRUE); if (show_progress) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); verify_clean(); verify_unprotected(); @@ -2752,7 +2767,7 @@ write_permitted_check(int if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } #else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ @@ -3046,7 +3061,7 @@ check_insert_entry(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -3135,7 +3150,7 @@ check_flush_cache(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -12673,7 +12688,7 @@ check_get_entry_status(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -12954,7 +12969,7 @@ check_expunge_entry(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -13345,7 +13360,7 @@ check_multiple_read_protect(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -13445,7 +13460,7 @@ check_move_entry(unsigned paged) H5_FAILED() if (!pass) - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); return (unsigned)!pass; } /* check_move_entry() */ @@ -13703,7 +13718,7 @@ check_pin_protected_entry(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -14571,7 +14586,7 @@ check_resize_entry(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -14656,7 +14671,7 @@ check_evictions_enabled(unsigned paged) pass = TRUE; if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* create the cache */ if (pass) { @@ -14678,7 +14693,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* verify that it is empty */ if (pass) { @@ -14694,7 +14709,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* verify that H5C_get_evictions_enabled() returns the expected value */ if (pass) { @@ -14710,7 +14725,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -14722,7 +14737,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* verify that the cache is full */ if (pass) { @@ -14738,7 +14753,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -14748,7 +14763,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* verify that an entry has been evicted */ if (pass) { @@ -14764,7 +14779,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -14794,7 +14809,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -14803,7 +14818,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* verify that another entry has been evicted */ if (pass) { @@ -14820,7 +14835,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -14850,7 +14865,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 12 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* disable evictions */ if (pass) { @@ -14866,7 +14881,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 13 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* verify that evictions are disabled */ if (pass) { @@ -14883,7 +14898,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 14 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -14893,7 +14908,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 15 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* verify that no entry has been evicted */ if (pass) { @@ -14910,7 +14925,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 16 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -14919,7 +14934,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 17 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* verify that no entry has been evicted */ if (pass) { @@ -14936,7 +14951,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 18 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* re-enable evictions */ if (pass) { @@ -14952,7 +14967,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 19 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -14962,7 +14977,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 20 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* verify that no entries have been evicted */ if (pass) { @@ -14979,7 +14994,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 21 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -14989,7 +15004,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 22 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* verify that the entries have been evicted to bring the * cache back down to its normal size. @@ -15009,7 +15024,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 23 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -15039,7 +15054,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 24 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -15069,7 +15084,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 25 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* disable evictions again */ if (pass) { @@ -15085,7 +15100,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 26 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -15097,7 +15112,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 27 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* verify that the cache has grown */ if (pass) { @@ -15114,7 +15129,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 28 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* re-enable evictions again */ if (pass) { @@ -15130,7 +15145,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 29 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -15139,7 +15154,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 30 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* verify that the cache has returned to its maximum size */ if (pass) { @@ -15156,7 +15171,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 31 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -15186,7 +15201,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 32 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* disable evictions one last time before we shut down */ if (pass) { @@ -15202,7 +15217,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 33 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -15210,7 +15225,7 @@ check_evictions_enabled(unsigned paged) } if (show_progress) /* 34 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { PASSED(); @@ -15221,7 +15236,7 @@ check_evictions_enabled(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -15319,7 +15334,7 @@ check_flush_protected_err(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -15408,7 +15423,7 @@ check_destroy_pinned_err(unsigned paged) } if (!pass) - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); return (unsigned)!pass; @@ -15504,7 +15519,7 @@ check_destroy_protected_err(unsigned paged) } if (!pass) - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); return (unsigned)!pass; @@ -15585,7 +15600,7 @@ check_duplicate_insert_err(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -15674,7 +15689,7 @@ check_double_pin_err(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -15772,7 +15787,7 @@ check_double_unpin_err(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -15884,7 +15899,7 @@ check_pin_entry_errs(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -15966,7 +15981,7 @@ check_double_protect_err(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -16044,7 +16059,7 @@ check_double_unprotect_err(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -16126,7 +16141,7 @@ check_mark_entry_dirty_errs(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -16243,7 +16258,7 @@ check_expunge_entry_errs(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -16360,7 +16375,7 @@ check_move_entry_errs(unsigned paged) else { H5_FAILED() - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } /* end else */ return (unsigned)!pass; @@ -16460,7 +16475,7 @@ check_resize_entry_errs(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -16581,7 +16596,7 @@ check_unprotect_ro_dirty_err(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -16668,7 +16683,7 @@ check_protect_ro_rw_err(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -16797,7 +16812,7 @@ check_protect_retries(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_msg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_msg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -16937,7 +16952,7 @@ check_check_evictions_enabled_err(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -20803,7 +20818,7 @@ check_auto_cache_resize(hbool_t cork_ageout, unsigned paged) } /* end else */ if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return (unsigned)!pass; } /* check_auto_cache_resize() */ @@ -23403,7 +23418,7 @@ check_auto_cache_resize_disable(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -24090,7 +24105,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -26322,7 +26337,7 @@ check_auto_cache_resize_input_errs(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -26818,7 +26833,7 @@ check_auto_cache_resize_aux_fcns(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -27048,7 +27063,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } /* end else */ if (show_progress) /* 0 */ - HDfprintf(stdout, "\n%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "\n%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); if (pass) { @@ -27069,7 +27084,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } if (show_progress) /* 1 */ - HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); /* ======================================================================== * ======================================================================== @@ -27132,7 +27147,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } if (show_progress) /* 2 */ - HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); /* ======================================================================== * ======================================================================== @@ -27202,7 +27217,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } if (show_progress) /* 3 */ - HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); if (pass) { @@ -27256,7 +27271,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } if (show_progress) /* 4 */ - HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); if (pass) { @@ -27309,7 +27324,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } if (show_progress) /* 5 */ - HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); /* ======================================================================== * ======================================================================== @@ -27384,7 +27399,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } if (show_progress) /* 6 */ - HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); if (pass) { @@ -27455,7 +27470,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } if (show_progress) /* 7 */ - HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); /* ======================================================================== * ======================================================================== @@ -27514,7 +27529,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } if (show_progress) /* 8 */ - HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); if (pass) { @@ -27562,7 +27577,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } if (show_progress) /* 9 */ - HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); if (pass) { @@ -27613,7 +27628,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } if (show_progress) /* 10 */ - HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); if (pass) { @@ -27659,7 +27674,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } if (show_progress) /* 11 */ - HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); if (cache_ptr) { @@ -27669,7 +27684,7 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) } if (show_progress) /* 12 */ - HDfprintf(stdout, "%s: check point %d -- pass %d\n", FUNC, checkpoint++, pass); + HDfprintf(stdout, "%s: check point %d -- pass %d\n", __func__, checkpoint++, pass); if (pass) { PASSED(); @@ -33629,7 +33644,7 @@ check_entry_deletions_during_scans(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } return (unsigned)!pass; @@ -35040,7 +35055,7 @@ check_stats(unsigned paged) if (!pass) { - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", __func__, failure_mssg); } #else /* H5C_COLLECT_CACHE_STATS */ @@ -35520,7 +35535,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) hid_t fcpl_id = H5P_DEFAULT; if (show_progress) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); saved_fid = -1; @@ -35563,7 +35578,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) } if (show_progress) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass && try_core_file_driver) { if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) == FAIL) { @@ -35580,7 +35595,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) core_file_driver_failed = TRUE; if (verbose) - HDfprintf(stdout, "%s: H5Fcreate() with CFD failed.\n", FUNC); + HDfprintf(stdout, "%s: H5Fcreate() with CFD failed.\n", __func__); } else { saved_fapl_id = fapl_id; @@ -35588,7 +35603,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) } if (show_progress) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); /* if we either aren't using the core file driver, or a create * with the core file driver failed, try again with a regular file. @@ -35603,7 +35618,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) failure_mssg = "H5Fcreate() failed."; if (verbose) - HDfprintf(stdout, "%s: H5Fcreate() failed.\n", FUNC); + HDfprintf(stdout, "%s: H5Fcreate() failed.\n", __func__); } /* end if */ } /* end if */ @@ -35611,7 +35626,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) H5CX_push(); if (show_progress) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { HDassert(fid >= 0); @@ -35621,7 +35636,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) failure_mssg = "H5Fflush() failed."; if (verbose) - HDfprintf(stdout, "%s: H5Fflush() failed.\n", FUNC); + HDfprintf(stdout, "%s: H5Fflush() failed.\n", __func__); } else { file_ptr = (H5F_t *)H5VL_object_verify(fid, H5I_FILE); @@ -35630,13 +35645,13 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) failure_mssg = "Can't get file_ptr."; if (verbose) - HDfprintf(stdout, "%s: H5Fflush() failed.\n", FUNC); + HDfprintf(stdout, "%s: H5Fflush() failed.\n", __func__); } } } if (show_progress) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { @@ -35679,7 +35694,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) } if (show_progress) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { if (cache_ptr == NULL) { @@ -35687,19 +35702,19 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) failure_mssg = "H5C_create() failed."; if (verbose) - HDfprintf(stdout, "%s: H5C_create() failed.\n", FUNC); + HDfprintf(stdout, "%s: H5C_create() failed.\n", __func__); } else if (cache_ptr->magic != H5C__H5C_T_MAGIC) { pass = FALSE; failure_mssg = "Bad cache_ptr magic."; if (verbose) - HDfprintf(stdout, "%s: Bad cache_ptr magic.\n", FUNC); + HDfprintf(stdout, "%s: Bad cache_ptr magic.\n", __func__); } } if (show_progress) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { /* allocate space for test entries */ actual_base_addr = H5MF_alloc(file_ptr, H5FD_MEM_DEFAULT, (hsize_t)(ADDR_SPACE_SIZE + BASE_ADDR)); @@ -35709,7 +35724,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) failure_mssg = "H5MF_alloc() failed."; if (verbose) - HDfprintf(stdout, "%s: H5MF_alloc() failed.\n", FUNC); + HDfprintf(stdout, "%s: H5MF_alloc() failed.\n", __func__); } else if (actual_base_addr > BASE_ADDR) { /* If this happens, must increase BASE_ADDR so that the @@ -35720,14 +35735,14 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) failure_mssg = "actual_base_addr > BASE_ADDR"; if (verbose) - HDfprintf(stdout, "%s: actual_base_addr > BASE_ADDR.\n", FUNC); + HDfprintf(stdout, "%s: actual_base_addr > BASE_ADDR.\n", __func__); } saved_actual_base_addr = actual_base_addr; } if (show_progress) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); if (pass) { /* Need to set this else all cache tests will fail */ @@ -35738,7 +35753,7 @@ setup_cache(size_t max_cache_size, size_t min_clean_size, unsigned paged) } if (show_progress) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", FUNC, mile_stone++, (int)pass); + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", __func__, mile_stone++, (int)pass); return (ret_val); } /* setup_cache() */ diff --git a/test/cache_api.c b/test/cache_api.c index 5d0f395..7858c65 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -478,7 +478,7 @@ check_fapl_mdc_api_calls(unsigned paged, hid_t fcpl_id) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return pass; @@ -821,7 +821,7 @@ check_file_mdc_api_calls(unsigned paged, hid_t fcpl_id) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return pass; @@ -1463,7 +1463,7 @@ mdc_api_call_smoke_check(int express_test, unsigned paged, hid_t fcpl_id) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return pass; @@ -1841,7 +1841,7 @@ check_fapl_mdc_api_errs(void) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return pass; @@ -1894,7 +1894,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: calling h5_fixname().\n", FUNC); + HDfprintf(stdout, "%s: calling h5_fixname().\n", __func__); } if (h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename)) == NULL) { @@ -1908,7 +1908,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: calling H5Fcreate().\n", FUNC); + HDfprintf(stdout, "%s: calling H5Fcreate().\n", __func__); } file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl_id, H5P_DEFAULT); @@ -1929,7 +1929,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 1.\n", FUNC); + HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 1.\n", __func__); } H5E_BEGIN_TRY @@ -1949,7 +1949,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 2.\n", FUNC); + HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 2.\n", __func__); } H5E_BEGIN_TRY @@ -1970,7 +1970,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 3.\n", FUNC); + HDfprintf(stdout, "%s: testing H5Fget_mdc_config() 3.\n", __func__); } H5E_BEGIN_TRY @@ -1993,7 +1993,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 1.\n", FUNC); + HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 1.\n", __func__); } H5E_BEGIN_TRY @@ -2013,7 +2013,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 2.\n", FUNC); + HDfprintf(stdout, "%s: testing H5Fset_mdc_config() 2.\n", __func__); } H5E_BEGIN_TRY @@ -2033,7 +2033,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) while ((pass) && (i < NUM_INVALID_CONFIGS)) { if (show_progress) { - HDfprintf(stdout, "%s: testing H5Fset_mdc_config() with invalid config %d.\n", FUNC, i); + HDfprintf(stdout, "%s: testing H5Fset_mdc_config() with invalid config %d.\n", __func__, i); } H5E_BEGIN_TRY @@ -2061,7 +2061,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: testing H5Fget_mdc_hit_rate() 1.\n", FUNC); + HDfprintf(stdout, "%s: testing H5Fget_mdc_hit_rate() 1.\n", __func__); } H5E_BEGIN_TRY @@ -2081,7 +2081,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: testing H5Fget_mdc_hit_rate() 2.\n", FUNC); + HDfprintf(stdout, "%s: testing H5Fget_mdc_hit_rate() 2.\n", __func__); } H5E_BEGIN_TRY @@ -2102,7 +2102,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: testing H5Freset_mdc_hit_rate_stats().\n", FUNC); + HDfprintf(stdout, "%s: testing H5Freset_mdc_hit_rate_stats().\n", __func__); } H5E_BEGIN_TRY @@ -2123,7 +2123,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 1.\n", FUNC); + HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 1.\n", __func__); } H5E_BEGIN_TRY @@ -2143,7 +2143,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 2.\n", FUNC); + HDfprintf(stdout, "%s: testing H5Fget_mdc_size() 2.\n", __func__); } if ((H5Fget_mdc_size(file_id, &max_size, NULL, NULL, NULL) < 0) || @@ -2162,7 +2162,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (show_progress) { - HDfprintf(stdout, "%s: cleaning up from tests.\n", FUNC); + HDfprintf(stdout, "%s: cleaning up from tests.\n", __func__); } if (H5Fclose(file_id) < 0) { @@ -2188,7 +2188,7 @@ check_file_mdc_api_errs(unsigned paged, hid_t fcpl_id) if (!pass) { - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); } return pass; @@ -2230,26 +2230,26 @@ main(void) invalid_configs = init_invalid_configs(); if (NULL == invalid_configs) { failure_mssg = "Unable to allocate memory for invalid configs."; - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return EXIT_FAILURE; } /* end if */ if ((fcpl_id = H5Pcreate(H5P_FILE_CREATE)) < 0) { failure_mssg = "H5Pcreate(H5P_FILE_CREATE) failed.\n"; - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return EXIT_FAILURE; } /* end if */ /* Set file space strategy to default or paged aggregation strategy */ if ((fcpl2_id = H5Pcopy(fcpl_id)) < 0) { failure_mssg = "H5Pcreate(H5P_FILE_CREATE) failed.\n"; - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return EXIT_FAILURE; } /* end if */ if (H5Pset_file_space_strategy(fcpl2_id, H5F_FSPACE_STRATEGY_PAGE, 1, (hsize_t)1) < 0) { failure_mssg = "H5Pset_file_space_strategy() failed.\n"; - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return EXIT_FAILURE; } /* end if */ @@ -2282,7 +2282,7 @@ main(void) if (H5Pclose(fcpl_id) < 0) { failure_mssg = "H5Pclose() failed.\n"; - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return EXIT_FAILURE; } /* end if */ diff --git a/test/cache_common.c b/test/cache_common.c index 34424be..5fcbed5 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -2782,7 +2782,7 @@ flush_cache(H5F_t *file_ptr, hbool_t destroy_entries, hbool_t dump_stats, hbool_ if (verbose) { - HDfprintf(stdout, "%s: unexpected il/is/cis/dis = %lld/%lld/%lld/%lld.\n", FUNC, + HDfprintf(stdout, "%s: unexpected il/is/cis/dis = %lld/%lld/%lld/%lld.\n", __func__, (long long)(cache_ptr->index_len), (long long)(cache_ptr->index_size), (long long)(cache_ptr->clean_index_size), (long long)(cache_ptr->dirty_index_size)); } @@ -3536,7 +3536,7 @@ row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t int32_t local_max_index; if (verbose) - HDfprintf(stdout, "%s(): entering.\n", FUNC); + HDfprintf(stdout, "%s(): entering.\n", __func__); if (pass) { cache_ptr = file_ptr->shared->cache; @@ -3868,7 +3868,7 @@ hl_row_major_scan_forward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, h int32_t local_max_index; if (verbose) - HDfprintf(stdout, "%s(): entering.\n", FUNC); + HDfprintf(stdout, "%s(): entering.\n", __func__); if (pass) { @@ -3960,7 +3960,7 @@ row_major_scan_backward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t int32_t local_max_index; if (verbose) - HDfprintf(stdout, "%s(): Entering.\n", FUNC); + HDfprintf(stdout, "%s(): Entering.\n", __func__); if (pass) { @@ -4220,7 +4220,7 @@ hl_row_major_scan_backward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, int32_t local_max_index; if (verbose) - HDfprintf(stdout, "%s(): entering.\n", FUNC); + HDfprintf(stdout, "%s(): entering.\n", __func__); if (pass) { @@ -4311,7 +4311,7 @@ col_major_scan_forward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t int32_t local_max_index[NUMBER_OF_ENTRY_TYPES]; if (verbose) - HDfprintf(stdout, "%s: entering.\n", FUNC); + HDfprintf(stdout, "%s: entering.\n", __func__); if (pass) { int i; @@ -4405,7 +4405,7 @@ hl_col_major_scan_forward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, h int32_t local_max_index; if (verbose) - HDfprintf(stdout, "%s: entering.\n", FUNC); + HDfprintf(stdout, "%s: entering.\n", __func__); if (pass) { @@ -4507,7 +4507,7 @@ col_major_scan_backward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t int32_t local_max_index[NUMBER_OF_ENTRY_TYPES]; if (verbose) - HDfprintf(stdout, "%s: entering.\n", FUNC); + HDfprintf(stdout, "%s: entering.\n", __func__); if (pass) { int i; @@ -4530,7 +4530,7 @@ col_major_scan_backward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t idx = local_max_index[NUMBER_OF_ENTRY_TYPES - 1] + lag; if (verbose) /* 1 */ - HDfprintf(stdout, "%s: point %d.\n", FUNC, mile_stone++); + HDfprintf(stdout, "%s: point %d.\n", __func__, mile_stone++); while ((pass) && ((idx + lag) >= 0)) { type = NUMBER_OF_ENTRY_TYPES - 1; @@ -4572,7 +4572,7 @@ col_major_scan_backward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t } if (verbose) /* 2 */ - HDfprintf(stdout, "%s: point %d.\n", FUNC, mile_stone++); + HDfprintf(stdout, "%s: point %d.\n", __func__, mile_stone++); if ((pass) && (display_stats)) { @@ -4580,7 +4580,7 @@ col_major_scan_backward(H5F_t *file_ptr, int32_t max_index, int32_t lag, hbool_t } if (verbose) - HDfprintf(stdout, "%s: exiting.\n", FUNC); + HDfprintf(stdout, "%s: exiting.\n", __func__); } /* col_major_scan_backward() */ @@ -4612,7 +4612,7 @@ hl_col_major_scan_backward(H5F_t *file_ptr, int32_t max_index, hbool_t verbose, int32_t local_max_index = -1; if (verbose) - HDfprintf(stdout, "%s: entering.\n", FUNC); + HDfprintf(stdout, "%s: entering.\n", __func__); if (pass) { diff --git a/test/cache_image.c b/test/cache_image.c index f5f36bf..f63f04a 100644 --- a/test/cache_image.c +++ b/test/cache_image.c @@ -1475,7 +1475,7 @@ check_cache_image_ctl_flow_1(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -1721,7 +1721,7 @@ check_cache_image_ctl_flow_2(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -2095,7 +2095,7 @@ check_cache_image_ctl_flow_3(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -2431,7 +2431,7 @@ check_cache_image_ctl_flow_4(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -2720,7 +2720,7 @@ check_cache_image_ctl_flow_5(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -2971,7 +2971,7 @@ check_cache_image_ctl_flow_6(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -3420,7 +3420,7 @@ cache_image_smoke_check_1(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -3696,7 +3696,7 @@ cache_image_smoke_check_2(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -4084,7 +4084,7 @@ cache_image_smoke_check_3(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -4463,7 +4463,7 @@ cache_image_smoke_check_4(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; } /* cache_image_smoke_check_4() */ @@ -4984,7 +4984,7 @@ cache_image_smoke_check_5(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -5401,7 +5401,7 @@ cache_image_smoke_check_6(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -5757,7 +5757,7 @@ cache_image_api_error_check_1(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -6185,7 +6185,7 @@ cache_image_api_error_check_2(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -6440,7 +6440,7 @@ cache_image_api_error_check_3(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -6997,7 +6997,7 @@ cache_image_api_error_check_4(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -7455,7 +7455,7 @@ get_free_sections_test(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; @@ -7828,7 +7828,7 @@ evict_on_close_test(hbool_t single_file_vfd) } if (!pass) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg); + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", __func__, failure_mssg); return !pass; #endif /* H5_HAVE_PARALLEL */ diff --git a/test/h5test.h b/test/h5test.h index 81925b9..3736537 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -89,7 +89,7 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ /* * Print the current location on the standard output stream. */ -#define AT() HDprintf(" at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC); +#define AT() HDprintf(" at %s:%d in %s()...\n", __FILE__, __LINE__, __func__); /* * The name of the test is printed by saying TESTING("something") which will @@ -165,12 +165,8 @@ H5TEST_DLLVAR MPI_Info h5_io_info_g; /* MPI INFO object for IO */ goto error; \ } -/* - * Alarm definitions to wait up (terminate) a test that runs too long. - */ +/* Number of seconds to wait before killing a test (requires alarm(2)) */ #define H5_ALARM_SEC 1200 /* default is 20 minutes */ -#define ALARM_ON TestAlarmOn() -#define ALARM_OFF HDalarm(0) /* Flags for h5_fileaccess_flags() */ #define H5_FILEACCESS_VFD 0x01 diff --git a/test/hdfs.c b/test/hdfs.c index dfaa585..74fc2bd 100644 --- a/test/hdfs.c +++ b/test/hdfs.c @@ -102,7 +102,7 @@ */ #define JSFAILED_AT() \ { \ - HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC); \ + HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, __func__); \ } /*---------------------------------------------------------------------------- diff --git a/test/ros3.c b/test/ros3.c index 54518f4..b7b27ed 100644 --- a/test/ros3.c +++ b/test/ros3.c @@ -106,7 +106,7 @@ */ #define JSFAILED_AT() \ { \ - HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC); \ + HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, __func__); \ } /*---------------------------------------------------------------------------- diff --git a/test/s3comms.c b/test/s3comms.c index 6202af3..cec7a27 100644 --- a/test/s3comms.c +++ b/test/s3comms.c @@ -96,7 +96,7 @@ */ #define JSFAILED_AT() \ { \ - HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, FUNC); \ + HDprintf("*FAILED* at %s:%d in %s()...\n", __FILE__, __LINE__, __func__); \ } /*---------------------------------------------------------------------------- diff --git a/test/testframe.c b/test/testframe.c index f805997..d3f0211 100644 --- a/test/testframe.c +++ b/test/testframe.c @@ -320,9 +320,9 @@ PerformTests(void) MESSAGE(5, ("===============================================\n")); Test[Loop].NumErrors = num_errs; Test_parameters = Test[Loop].Parameters; - ALARM_ON; + TestAlarmOn(); Test[Loop].Call(); - ALARM_OFF; + TestAlarmOff(); Test[Loop].NumErrors = num_errs - Test[Loop].NumErrors; MESSAGE(5, ("===============================================\n")); MESSAGE(5, ("There were %d errors detected.\n\n", (int)Test[Loop].NumErrors)); @@ -620,12 +620,15 @@ SetTest(const char *testname, int action) } } -/* - * Enable alarm on test execution, configurable by environment variable +/* Enable a test timer that will kill long-running tests, the time is configurable + * via an environment variable. + * + * Only useful on POSIX systems where alarm(2) is present. */ void TestAlarmOn(void) { +#ifdef H5_HAVE_ALARM char * env_val = HDgetenv("HDF5_ALARM_SECONDS"); /* Alarm environment */ unsigned long alarm_sec = H5_ALARM_SEC; /* Number of seconds before alarm goes off */ @@ -635,4 +638,15 @@ TestAlarmOn(void) /* Set the number of seconds before alarm goes off */ HDalarm((unsigned)alarm_sec); +#endif +} + +/* Disable the test timer */ +void +TestAlarmOff(void) +{ +#ifdef H5_HAVE_ALARM + /* Set the number of seconds to zero */ + HDalarm(0); +#endif } diff --git a/test/testvfdswmr.sh.in b/test/testvfdswmr.sh.in index 69f4235..b0ab785 100644 --- a/test/testvfdswmr.sh.in +++ b/test/testvfdswmr.sh.in @@ -68,6 +68,13 @@ DSETOPS_FIFO_WRITER_TO_READER=fifo_dsetops_writer_to_reader DSETOPS_FIFO_READER_TO_WRITER=fifo_dsetops_reader_to_writer ############################################################################### +## For dsetchks test: definitions for fifo files to coordinate test runs +############################################################################### +# +DSETCHKS_FIFO_WRITER_TO_READER=fifo_dsetchks_writer_to_reader +DSETCHKS_FIFO_READER_TO_WRITER=fifo_dsetchks_reader_to_writer + +############################################################################### ## short hands and function definitions ############################################################################### # @@ -138,9 +145,9 @@ all_tests="generator expand shrink expand_shrink sparse vlstr_null vlstr_oob zoo all_tests="${all_tests} groups groups_attrs groups_ops few_big many_small attrdset" tests=${all_tests} -# For exhaustive run, add: os_groups_attrs, os_groups_ops, dsetops +# For exhaustive run, add: os_groups_attrs, os_groups_ops, dsetops, dsetchks if [[ "$HDF5TestExpress" -eq 0 ]] ; then # exhaustive run - all_tests="${all_tests} os_groups_attrs os_groups_ops dsetops" + all_tests="${all_tests} os_groups_attrs os_groups_ops dsetops dsetchks" fi if [ $# -gt 0 ]; then @@ -1252,6 +1259,70 @@ for options in "-p -e 20 -t -q" "-g -m 5 -n 2 -s 10 -w 7 -q" "-k -m 10 -n 5 -r 5 done ############################################################################### +# +# "dsetchks" test +# +# Only for exhaustive run +# +############################################################################### +# +# +dsetchks_list=( + "-s -m 8 -n 3 -g 1 -q" + "-i -o -g 3 -q" + "-f -p 4 -q" + "-e -m 3 -n 5 -t 1 -q" + "-r -m 11 -n 5 -l 7 -q" + "-f -x 5 -y 2 -q" + ) +for options in "${dsetchks_list[@]}"; do + # + # + if [ ${do_dsetchks:-no} = no ]; then + continue + fi + # Clean up any existing fifo files from previous runs + if [ -e ./$DSETCHKS_FIFO_WRITER_TO_READER ]; then # If writer fifo file is found + rm -f ./$DSETCHKS_FIFO_WRITER_TO_READER + fi + if [ -e ./$DSETCHKS_FIFO_READER_TO_WRITER ]; then # If reader fifo file is found + rm -f ./$DSETCHKS_FIFO_READER_TO_WRITER + fi + # + echo launch vfd_swmr_dsetchks_writer dsetchks, options $options ......may take some time...... + catch_out_err_and_rc vfd_swmr_dsetchks_writer \ + ../vfd_swmr_dsetchks_writer $options & + pid_writer=$! + + catch_out_err_and_rc vfd_swmr_dsetchks_reader \ + ../vfd_swmr_dsetchks_reader $options & + pid_reader=$! + + # Wait for the reader to finish before signaling the + # writer to quit: the writer holds the file open so that the + # reader will find the shadow file when it opens + # the .h5 file. + wait $pid_reader + wait $pid_writer + + # Collect exit code of the reader + if [ $(cat vfd_swmr_dsetchks_reader.rc) -ne 0 ]; then + echo reader had error + nerrors=$((nerrors + 1)) + fi + + # Collect exit code of the writer + if [ $(cat vfd_swmr_dsetchks_writer.rc) -ne 0 ]; then + echo writer had error + nerrors=$((nerrors + 1)) + fi + + # Clean up output files + rm -f vfd_swmr_dsetchks_writer.{out,rc} + rm -f vfd_swmr_dsetchks_reader.*.{out,rc} +done + +############################################################################### ## Report and exit ############################################################################### cd .. diff --git a/test/vfd_swmr_dsetchks_writer.c b/test/vfd_swmr_dsetchks_writer.c new file mode 100644 index 0000000..25066d8 --- /dev/null +++ b/test/vfd_swmr_dsetchks_writer.c @@ -0,0 +1,2274 @@ +/* + * Copyright by The HDF Group. + * 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 COPYING file, which can be found at the root of the source code + * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. + * If you do not have access to either file, you may request a copy from + * help@hdfgroup.org. + */ + +/* + * Purpose: To test chunk operations for chunked dataset specifically: + * --chunked datasets with the 5 indexing types: + * 1. single (dims=max_dims=chunk_dims, default incremental allocation) + * 2. implicit (dims=max_dims, early allocation, no filter) + * 3. fixed array (fixed max_dims, default incremental allocation) + * 4. extensible array (1 unlimited max_dims, default incremental allocation) + * 5. btree2 (2 unlimited max_dims, default incremental allocation) + * + * --with compression--H5Pset_deflate(dcpl) + * --with fill values--H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval); + * + * Types of chunk operations: + * -- writes that cover a single chunk + * -- writes that cover a partial chunk + * -- writes that cover multiple chunks + * -- writes that cover multiple partial chunks + * + * For fa, ea, bt2 indexes: + * --increase size of dataset dimensions + * --decrease size of dataset dimensions + */ +#include "hdf5.h" +#include "testhdf5.h" +#include "vfd_swmr_common.h" + +#ifndef H5_HAVE_WIN32_API + +#define READER_WAIT_TICKS 4 + +/* Names for datasets */ +#define DSET_SINGLE_NAME "chunked_single" +#define DSET_IMPLICIT_NAME "chunked_implicit" +#define DSET_FA_NAME "chunked_fa" +#define DSET_EA_NAME "chunked_ea" +#define DSET_BT2_NAME "chunked_bt2" + +/* Operations for testing */ +#define GWRITES 1 /* Writes that cover a single chunk per write */ +#define PWRITES 2 /* Writes that cover a partial chunk per write */ +#define TWRITES 3 /* Writes that cover multiple chunks per write */ +#define LWRITES 4 /* Writes that cover multiple partial chunks per write */ +#define INCR_EXT 5 /* Increase dataset dimenion sizes */ +#define DECR_EXT 6 /* Decrease dataset dimension sizes */ + +/* Fill values */ +#define FILL_INIT 1 /* Fill value used when creating the datasets */ +#define FILL_FULL 7 /* Fill value used when writing a full chunk */ +#define FILL_PARTIAL 9 /* Fill value used when writing partial chunk(s) */ + +#define MULTI_CHUNKS 2 + +/* Structure to hold info for options specified */ +typedef struct { + char filename[PATH_MAX]; /* File name */ + char progname[PATH_MAX]; /* Program name */ + hid_t file; /* File ID */ + hid_t filetype; /* Datatype ID */ + unsigned int update_interval; /* For -u option */ + unsigned int csteps; /* For -c <csteps> option */ + bool use_np; /* For -N option */ + bool use_vfd_swmr; /* For -S option */ + bool use_filter; /* For -o option */ + + bool single_index; /* -s option: create a chunked dataset with single chunk index */ + bool implicit_index; /* -i option: create a chunked datasets with implicit chunk index */ + bool fa_index; /* -f option: create a chunked dataset with fixed array index */ + bool ea_index; /* -e option: create a chunked dataset with extensible array index */ + bool bt2_index; /* -r option: create a chunked dataset with version 2 btree index */ + + unsigned int rows; /* -m <rows> option for the chunked datasets */ + unsigned int cols; /* -n <cols option for the chunked datasets */ + + unsigned int gwrites; /* -s <gwrites> option: writes that cover a single chunk per write */ + unsigned int pwrites; /* -p <pwrites> option: writes that cover a partial chunk per write */ + unsigned int twrites; /* -t <twrites> option: writes that cover multiple chunks per write */ + unsigned int lwrites; /* -l <lwrites> option: writes that cover multiple partial chunks per write */ + + unsigned int xincrs; /* -x <xincrs> option */ + unsigned int ydecrs; /* -y <ydecrs> option */ +} state_t; + +/* Initializations for state_t */ +#define ALL_HID_INITIALIZER \ + (state_t) \ + { \ + .filename = "", .file = H5I_INVALID_HID, .filetype = H5T_NATIVE_UINT32, \ + .update_interval = READER_WAIT_TICKS, .csteps = 1, .use_np = true, .use_vfd_swmr = true, \ + .use_filter = false, .single_index = false, .implicit_index = false, .fa_index = false, \ + .ea_index = false, .bt2_index = false, .rows = 10, .cols = 5, .gwrites = 0, .pwrites = 0, \ + .twrites = 0, .lwrites = 0, .xincrs = 0, .ydecrs = 0 \ + } + +/* Structure to hold info for different dataset types */ +typedef struct { + hsize_t chunk_dims[2]; /* Chunk dimensions for all datasets except single_did */ + hsize_t scaled_dims[2]; + hsize_t multi_scaled[2]; + hid_t single_did; /* ID for chunked dataset: single index */ + hid_t implicit_did; /* ID for chunked dataset: implicit index */ + hid_t fa_did; /* ID for chunked dataset: fixed array index */ + hid_t ea_did; /* ID for chunked dataset: extensible array index */ + hid_t bt2_did; /* ID for chunked dataset: version 2 btree index */ +} dsets_state_t; + +/* Initializations for dsets_state_t */ +#define DSETS_INITIALIZER \ + (dsets_state_t) \ + { \ + .single_did = H5I_INVALID_HID, .implicit_did = H5I_INVALID_HID, .fa_did = H5I_INVALID_HID, \ + .ea_did = H5I_INVALID_HID, .bt2_did = H5I_INVALID_HID \ + } + +/* Structure to hold info for named pipes */ +typedef struct { + const char *fifo_writer_to_reader; /* Name of fifo for writer to reader */ + const char *fifo_reader_to_writer; /* Name of fifo for reader to writer */ + int fd_writer_to_reader; /* File ID for fifo from writer to reader */ + int fd_reader_to_writer; /* File ID for fifo from reader to writer */ + int notify; /* Value to notify between writer and reader */ + int verify; /* Value to verify between writer and reader */ +} np_state_t; + +/* Initializations for np_state_t */ +#define NP_INITIALIZER \ + (np_state_t) \ + { \ + .fifo_writer_to_reader = "./fifo_dsetchks_writer_to_reader", \ + .fifo_reader_to_writer = "./fifo_dsetchks_reader_to_writer", .fd_writer_to_reader = -1, \ + .fd_reader_to_writer = -1, .notify = 0, .verify = 0 \ + } + +static bool state_init(state_t *, int, char **); + +static bool np_init(np_state_t *np, bool writer); +static bool np_close(np_state_t *np, bool writer); +static bool np_writer(bool result, unsigned step, const state_t *s, np_state_t *np, + H5F_vfd_swmr_config_t *config); +static bool np_reader(bool result, unsigned step, const state_t *s, np_state_t *np); +static bool np_confirm_verify_notify(int fd, unsigned step, const state_t *s, np_state_t *np); + +static bool create_dsets(const state_t *s, dsets_state_t *ds); +static bool open_dsets(const state_t *s, dsets_state_t *ds); +static bool close_dsets(const dsets_state_t *ds); +static void set_chunk_scaled_dims(const state_t *s, dsets_state_t *ds); + +static bool perform_dsets_operations(state_t *s, dsets_state_t *ds, H5F_vfd_swmr_config_t *config, + np_state_t *np); + +static bool write_dsets_chunks(unsigned action, const state_t *s, const dsets_state_t *ds, unsigned step); +static void setup_selection(unsigned action, unsigned which, const state_t *s, const dsets_state_t *ds, + hsize_t *start, hsize_t *stride, hsize_t *count, hsize_t *block); +static void check_set_edge_block(const state_t *s, const dsets_state_t *ds, unsigned i, unsigned j, + hsize_t *block); +static void check_set_partial_block(unsigned action, const hsize_t *dims, hsize_t *block, hsize_t *start); +static bool write_dset(unsigned action, hid_t did, hid_t tid, hsize_t *start, hsize_t *stride, hsize_t *count, + hsize_t *block); +static bool write_dset_single(unsigned action, const state_t *s, const dsets_state_t *ds); + +static bool dsets_extent(unsigned action, const state_t *s, const dsets_state_t *ds); +static bool dset_extent_real(unsigned action, hid_t did, const hsize_t *chunk_dims); + +static bool verify_dsets_operations(state_t *s, dsets_state_t *ds, H5F_vfd_swmr_config_t *config, + np_state_t *np); + +static bool verify_dsets_chunks(unsigned action, const state_t *s, const dsets_state_t *ds, unsigned which); +static bool verify_read_dset(unsigned action, hid_t did, hid_t tid, hsize_t *start, hsize_t *stride, + hsize_t *count, hsize_t *block); +static bool verify_read_dset_single(unsigned action, const state_t *s, const dsets_state_t *ds); + +static bool verify_dsets_extent(unsigned action, const state_t *s, const dsets_state_t *ds, unsigned which); +static bool verify_dset_extent_real(unsigned action, hid_t did, unsigned rows, unsigned cols, unsigned which); + +static const hid_t badhid = H5I_INVALID_HID; + +static void +usage(const char *progname) +{ + fprintf(stderr, + "usage: %s \n" + " [-s] [-i] [-f] [-e] [-r]\n" + " [-m rows] [-n cols]\n" + " [-g gwrites] [-p pwrites] [-t twrites] [-l lwrites]\n" + " [-x xincrs] [-y decrs]\n" + " [-u nticks] [-c csteps] [-S] [-N] [-q] [-b] [-o]\n", + progname); + + fprintf( + stderr, + "\n" + "-s: create a 2-d chunked dataset with single index\n" + "-i: create a 2-d chunked dataset with implicit index\n" + "-f: create a 2-d chunked dataset with fixed array index\n" + "-e: create a 2-d chunked dataset with extensible array index\n" + "-r: create a 2-d chunked dataset with v2 btree index\n" + "-m rows: # of <rows> rows for the datasets\n" + "-n cols: # of <cols> columns for the chunked datasets\n" + "-g gwrites: perform <gwrites> writes that cover a single chunk per write to datasets\n" + "-p pwrites: perform <pwrites> writes that cover a single partial chunk per write to datasets\n" + "-t twrites: perform <twrites> writes that cover multiple chunks per write to datasets\n" + "-l lwrites: perform <lwrites> writes that cover multiple partial chunks per write to datasets\n" + "-x xincrs: increase dataset dimension size by 1 for <xincrs> times to datasets\n" + "-y ydecrs: decrease dataset dimension size by 1 for <ydecrs> times to datasets\n" + "-u nticks: `nticks` ticks for the reader to wait before verification\n" + " (default is 4)\n" + "-c csteps: `csteps` steps communication interval between reader and writer\n" + " (default is 1)\n" + "-S: do not use VFD SWMR\n" + "-N: do not use named pipes for test synchronization\n" + "-q: silence printouts, few messages\n" + "-b: write data in big-endian byte order\n" + " (default is H5T_NATIVE_UINT32)\n\n" + "-o: enable compression (deflate filter) for the datasets\n"); + + fprintf( + stderr, + "\n" + "Note:\n" + "1. Require to specify at least -s, -i, -f, -e or -r option\n" + "2. -m and -n options: <rows> and <cols> have to be > 0.\n" + "3. The chunk size for datasets is <rows>/2 by <cols/2>\n" + "4. The maximum dimension for dataset with fixed array index is: <rows>*2 by <cols>*2\n" + "5. Writes to dataset with single index:\n" + " -g and -t options will be the same: write one single chunk\n" + " -p and -l options will be the same: write one single partial chunk\n" + "6. Writes to dataset with implicit/fixed array/extensible array/v2 btree index:\n" + " i) Partial chunk writes to datasets via -p or -l option:\n" + " Apply only to a single or a multiple chunk with size > 2 in both dimensions\n" + " Otherwise, the whole chunk (single or multiple) is written\n" + " ii) Multiple chunk writes to datasets via -t or -l option:\n" + " Will expand the chunk size by 2 for both dimensions\n" + "7. Increase/decrease dataset dimension sizes to datasets:\n" + " Apply only for datasets with fixed array/extensible array/v2 btree index\n" + " -x option: for dataset with fixed array index, the increase cannot exceed maximum dimension\n" + " -y option: the decrease cannot go below the dataset's chunk size\n" + "8. -c <csteps> option cannot exceed the input for the following options:\n" + " -g <gwrites> or -p <pwrites> or\n" + " -t <twrites> or -l <lwrites> or\n" + " -x <xincrs> or -y <ydecrs>\n" + "\n"); + + exit(EXIT_FAILURE); +} /* usage() */ + +/* + * Initialize option info in state_t + */ +static bool +state_init(state_t *s, int argc, char **argv) +{ + unsigned long tmp; + int ch; + char tfile[PATH_MAX]; + char * end; + + *s = ALL_HID_INITIALIZER; + esnprintf(tfile, sizeof(tfile), "%s", argv[0]); + esnprintf(s->progname, sizeof(s->progname), "%s", basename(tfile)); + + while ((ch = getopt(argc, argv, "siferom:n:x:y:g:p:t:l:bqSNu:c:")) != -1) { + switch (ch) { + + case 's': /* A chunked dataset with single index */ + s->single_index = true; + break; + + case 'i': /* A chunked dataset with implicit index */ + s->implicit_index = true; + break; + + case 'f': /* A chunked dataset with fixed array index */ + s->fa_index = true; + break; + + case 'e': /* A chunked dataset with extensible array index */ + s->ea_index = true; + break; + + case 'r': /* A chunked dataset with version 2 btree index */ + s->bt2_index = true; + break; + + case 'o': /* A chunked dataset with version 2 btree index */ + s->use_filter = true; + break; + + case 'q': /* Be quiet: few/no progress messages */ + verbosity = 0; + break; + + case 'b': /* Write data in big-endian byte order */ + s->filetype = H5T_STD_U32BE; + break; + + case 'S': /* Disable VFD SWMR */ + s->use_vfd_swmr = false; + break; + + case 'N': /* Disable named pipes synchronization */ + s->use_np = false; + break; + + case 'm': /* # of rows for datasets */ + case 'n': /* # of cols for datasets */ + case 'x': /* Increase by 1 for <xincrs> times */ + case 'y': /* Decrease by 1 for <ydecdrs> times */ + case 'g': /* # of writes that cover a single chunk per write */ + case 'p': /* # of writes that cover a single partial chunk per write */ + case 't': /* # of writes that cover multiple chunks per write */ + case 'l': /* # of writes that cover multiple partial chunks per write */ + case 'u': /* Ticks for reader to wait before verification */ + case 'c': /* Communication interval */ + errno = 0; + tmp = strtoul(optarg, &end, 0); + if (end == optarg || *end != '\0') { + printf("couldn't parse `-%c` argument `%s`\n", ch, optarg); + TEST_ERROR; + } + else if (errno != 0) { + printf("couldn't parse `-%c` argument `%s`\n", ch, optarg); + TEST_ERROR; + } + else if (tmp > UINT_MAX) { + printf("`-%c` argument `%lu` too large\n", ch, tmp); + TEST_ERROR; + } + + if (ch == 'm') + s->rows = (unsigned)tmp; + else if (ch == 'n') + s->cols = (unsigned)tmp; + else if (ch == 'x') + s->xincrs = (unsigned)tmp; + else if (ch == 'y') + s->ydecrs = (unsigned)tmp; + else if (ch == 'g') + s->gwrites = (unsigned)tmp; + else if (ch == 'p') + s->pwrites = (unsigned)tmp; + else if (ch == 't') + s->twrites = (unsigned)tmp; + else if (ch == 'l') + s->lwrites = (unsigned)tmp; + else if (ch == 'u') + s->update_interval = (unsigned)tmp; + else if (ch == 'c') + s->csteps = (unsigned)tmp; + + break; + + case '?': + default: + usage(s->progname); + break; + } + } + argc -= optind; + argv += optind; + + /* Require to specify at least -s or -i or -f or -e or -r option */ + if (!s->single_index && !s->implicit_index && !s->fa_index && !s->ea_index && !s->bt2_index) { + printf("Require to specify at least -s or -i or -f or -e or -r option\n"); + usage(s->progname); + goto error; + } + + /* -x or -y option only apply to dataset with fixed/extensible array/v2 btree index */ + if ((s->single_index || s->implicit_index) && (s->xincrs || s->ydecrs)) { + printf("-x or -y option not applicable to dataset with single or implicit index\n"); + usage(s->progname); + goto error; + } + + /* rows and cols cannot be zero */ + if (s->rows == 0 || s->cols == 0) { + printf("-m <rows> or -n <cols> cannot be zero\n"); + TEST_ERROR; + } + + /* -c <csteps> cannot be zero */ + if (!s->csteps) { + printf("communication interval cannot be zero\n"); + TEST_ERROR; + } + + /* -c <csteps> and -g <gwrites> options */ + if (s->gwrites && s->csteps > s->gwrites) { + printf("communication interval with -g <gwrites> is out of bounds\n"); + TEST_ERROR; + } + + /* -c <csteps> and -p <pwrites> options */ + if (s->pwrites && s->csteps > s->pwrites) { + printf("communication interval with -p <pwrites> is out of bounds\n"); + TEST_ERROR; + } + + /* -c <csteps> and -t <twrites> options */ + if (s->twrites && s->csteps > s->twrites) { + printf("communication interval with -t <twrites> is out of bounds\n"); + TEST_ERROR; + } + + /* -c <csteps> and -l <lwrites> options */ + if (s->lwrites && s->csteps > s->lwrites) { + printf("communication interval with -l <lwrites> is out of bounds\n"); + TEST_ERROR; + } + + /* -c <csteps> and -x <xincrs> options */ + if (s->xincrs && s->csteps > s->xincrs) { + printf("communication interval with -x <xincrs> is out of bounds\n"); + TEST_ERROR; + } + + /* -c <csteps> and -y <ydecrs> options */ + if (s->ydecrs && s->csteps > s->ydecrs) { + printf("communication interval with -y <ydecrs> is out of bounds\n"); + TEST_ERROR; + } + + /* The test file name */ + esnprintf(s->filename, sizeof(s->filename), "vfd_swmr_dsetchks.h5"); + + return true; + +error: + return false; + +} /* state_init() */ + +/* + * Create the specified datasets: + * --2-dimensional chunked datasets + * --chunk dimension is rows/2 by cols/2 + * --fill value is FILL_INIT + * --deflate filter if specified + * --dataset with single index if specified + * --dataset with implicit index if specified + * --dataset with fixeda array index if specified + * --dataset with extensible array index if specified + * --dataset with bt2 index if specified + */ +static bool +create_dsets(const state_t *s, dsets_state_t *ds) +{ + hid_t dcpl = badhid; + hid_t dcpl2 = badhid; + hid_t sid = badhid; + hsize_t dims[2]; + unsigned fillval = FILL_INIT; + + *ds = DSETS_INITIALIZER; + set_chunk_scaled_dims(s, ds); + + dims[0] = s->rows; + dims[1] = s->cols; + + /* Create dataset creation property list */ + /* Set properties in dcpl that are common for all the datasets */ + if ((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) { + printf("H5Pcreate failed\n"); + TEST_ERROR; + } + + /* Set to chunked layout */ + if (H5Pset_layout(dcpl, H5D_CHUNKED) < 0) { + printf("H5Pset_layout failed\n"); + TEST_ERROR; + } + + /* Set fill value to FILL_INIT */ + if (H5Pset_fill_value(dcpl, s->filetype, &fillval) < 0) { + printf("H5Pset_fill_value failed\n"); + goto error; + } + + /* Set to use filter as specified */ + if (s->use_filter) { + if (H5Pset_deflate(dcpl, 5) < 0) { + printf("H5Pset_deflate failed\n"); + goto error; + } + } + + /* Create 2-D chunked dataset with single index */ + /* Chunked, dims=max_dims=chunk_dims */ + if (s->single_index) { + + if ((dcpl2 = H5Pcopy(dcpl)) < 0) { + printf("H5Tcopy failed\n"); + TEST_ERROR; + } + + if (H5Pset_chunk(dcpl2, 2, dims) < 0) { + printf("H5Pset_chunk failed\n"); + TEST_ERROR; + } + + if ((sid = H5Screate_simple(2, dims, dims)) < 0) { + printf("H5Screate_simple failed\n"); + TEST_ERROR; + } + + /* Create the chunked dataset: single index */ + if ((ds->single_did = H5Dcreate2(s->file, DSET_SINGLE_NAME, s->filetype, sid, H5P_DEFAULT, dcpl2, + H5P_DEFAULT)) < 0) { + printf("H5Dcreate2 chunked dataset:single index failed\n"); + TEST_ERROR; + } + + if (H5Pclose(dcpl2) < 0) { + printf("H5Pclose failed\n"); + TEST_ERROR; + } + + if (H5Sclose(sid) < 0) { + printf("H5Sclose failed\n"); + TEST_ERROR; + } + } + + /* Chunk size is common for datasets with implicit/fa/ea/bt2 index */ + if (H5Pset_chunk(dcpl, 2, ds->chunk_dims) < 0) { + printf("H5Pset_chunk failed\n"); + TEST_ERROR; + } + + /* Create 2-D chunked dataset with implicit index */ + /* Chunked, dims=max_dims, early allocation */ + if (s->implicit_index) { + + if ((dcpl2 = H5Pcopy(dcpl)) < 0) { + printf("H5Pcopy failed\n"); + TEST_ERROR; + } + + if (H5Pset_alloc_time(dcpl2, H5D_ALLOC_TIME_EARLY) < 0) { + printf("H5Pset_alloc_time\n"); + TEST_ERROR; + } + + if ((sid = H5Screate_simple(2, dims, dims)) < 0) { + printf("H5Screate_simple failed\n"); + TEST_ERROR; + } + + /* Create the chunked dataset: implicit index */ + if ((ds->implicit_did = H5Dcreate2(s->file, DSET_IMPLICIT_NAME, s->filetype, sid, H5P_DEFAULT, dcpl2, + H5P_DEFAULT)) < 0) { + printf("H5Dcreate2 chunked dataset:implicit index failed\n"); + TEST_ERROR; + } + + if (H5Pclose(dcpl2) < 0) { + printf("H5Pclose failed\n"); + TEST_ERROR; + } + + if (H5Sclose(sid) < 0) { + printf("H5Sclose failed\n"); + TEST_ERROR; + } + } + + /* Create 2-D chunked dataset with fixed array index */ + /* Chunked, fixed max_dims */ + if (s->fa_index) { + hsize_t max_dims[2]; + + max_dims[0] = dims[0] * 2; + max_dims[1] = dims[1] * 2; + + if ((sid = H5Screate_simple(2, dims, max_dims)) < 0) { + printf("H5Screate_simple failed\n"); + TEST_ERROR; + } + + /* Create the chunked dataset (fixed array index) with the named datatype */ + if ((ds->fa_did = + H5Dcreate2(s->file, DSET_FA_NAME, s->filetype, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) { + printf("H5Dcreate2 chunked dataset: fa index failed\n"); + TEST_ERROR; + } + + if (H5Sclose(sid) < 0) { + printf("H5Sclose failed\n"); + TEST_ERROR; + } + } + + /* Create 2-D chunked dataset with extensible array index */ + /* Chunked, 1 unlimited max_dims */ + if (s->ea_index) { + hsize_t max_dims[2]; + + max_dims[0] = dims[0] * 2; + max_dims[1] = H5S_UNLIMITED; + + if ((sid = H5Screate_simple(2, dims, max_dims)) < 0) { + printf("H5Screate_simple failed\n"); + TEST_ERROR; + } + + /* Create the chunked dataset (extensible array index) with the named datatype */ + if ((ds->ea_did = + H5Dcreate2(s->file, DSET_EA_NAME, s->filetype, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) { + printf("H5Dcreate2 chunked dataset: ea index failed\n"); + TEST_ERROR; + } + + if (H5Sclose(sid) < 0) { + printf("H5Sclose failed\n"); + TEST_ERROR; + } + } + + /* Create 2-D chunked dataset with bt2 index */ + /* Chunked, 2 unlimited max_dims */ + if (s->bt2_index) { + hsize_t max_dims[2]; + + max_dims[0] = max_dims[1] = H5S_UNLIMITED; + + if ((sid = H5Screate_simple(2, dims, max_dims)) < 0) { + printf("H5Screate_simple failed\n"); + TEST_ERROR; + } + + /* Create the chunked dataset (btree2 index) with the named datatype */ + if ((ds->bt2_did = + H5Dcreate2(s->file, DSET_BT2_NAME, s->filetype, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) { + printf("H5Dcreate2 chunked dataset: bt2 index failed\n"); + TEST_ERROR; + } + + if (H5Sclose(sid) < 0) { + printf("H5Sclose failed\n"); + TEST_ERROR; + } + } + + if (H5Pclose(dcpl) < 0) { + printf("H5Pclose failed\n"); + TEST_ERROR; + } + + return true; + +error: + H5E_BEGIN_TRY + { + H5Pclose(dcpl); + H5Pclose(dcpl2); + H5Sclose(sid); + H5Dclose(ds->single_did); + H5Dclose(ds->implicit_did); + H5Dclose(ds->fa_did); + H5Dclose(ds->ea_did); + H5Dclose(ds->bt2_did); + } + H5E_END_TRY; + + return false; + +} /* create_dsets() */ + +/* + * Open the specified datasets. + */ +static bool +open_dsets(const state_t *s, dsets_state_t *ds) +{ + *ds = DSETS_INITIALIZER; + set_chunk_scaled_dims(s, ds); + + /* Dataset with single index */ + if (s->single_index) { + if ((ds->single_did = H5Dopen2(s->file, DSET_SINGLE_NAME, H5P_DEFAULT)) < 0) { + printf("H5Dopen dataset with single index failed\n"); + TEST_ERROR; + } + } + + /* Dataset with implicit index */ + if (s->implicit_index) { + if ((ds->implicit_did = H5Dopen2(s->file, DSET_IMPLICIT_NAME, H5P_DEFAULT)) < 0) { + printf("H5Dopen dataset with implicit index failed\n"); + TEST_ERROR; + } + } + + /* Dataset with fixed array index */ + if (s->fa_index) { + if ((ds->fa_did = H5Dopen2(s->file, DSET_FA_NAME, H5P_DEFAULT)) < 0) { + printf("H5Dopen dataset with fa index failed\n"); + TEST_ERROR; + } + } + + /* Dataset with extensible array index */ + if (s->ea_index) { + if ((ds->ea_did = H5Dopen2(s->file, DSET_EA_NAME, H5P_DEFAULT)) < 0) { + printf("H5Dopen dataset with ea index failed\n"); + TEST_ERROR; + } + } + + /* Dataset with v2 btree index */ + if (s->bt2_index) { + if ((ds->bt2_did = H5Dopen2(s->file, DSET_BT2_NAME, H5P_DEFAULT)) < 0) { + printf("H5Dopen dataset with ea index failed\n"); + TEST_ERROR; + } + } + + return true; + +error: + return false; + +} /* open_dsets() */ + +/* + * Initialize the following 3 fields in ds: + * --chunk_dims[]: chunk sizes for datasets with implicit/fa/ea/bt2 index + * --scaled_dims[]: # of chunks in x and y dimensions + * --multi_scaled[]: # of multiple chunks (2 chunks) in x and y dimensions + */ +static void +set_chunk_scaled_dims(const state_t *s, dsets_state_t *ds) +{ + /* Default chunk size is s->rows/2 or s->cols/2 but not less than 1 */ + ds->chunk_dims[0] = MAX(1, s->rows / 2); + ds->chunk_dims[1] = MAX(1, s->cols / 2); + + /* # of chunks in x and y dimensions */ + ds->scaled_dims[0] = (s->rows + ds->chunk_dims[0] - 1) / ds->chunk_dims[0]; + ds->scaled_dims[1] = (s->cols + ds->chunk_dims[1] - 1) / ds->chunk_dims[1]; + + /* # of "multiple chunks" (2-chunks) in x and y dimensions */ + ds->multi_scaled[0] = (ds->scaled_dims[0] + MULTI_CHUNKS - 1) / MULTI_CHUNKS; + ds->multi_scaled[1] = (ds->scaled_dims[1] + MULTI_CHUNKS - 1) / MULTI_CHUNKS; + +} /* set_chunk_scaled_dims() */ + +/* + * Close the specified datasets + */ +static bool +close_dsets(const dsets_state_t *ds) +{ + /* Close dataset with single index */ + if (ds->single_did != badhid && H5Dclose(ds->single_did) < 0) { + printf("close_dset_real() dataset: single index failed\n"); + TEST_ERROR; + } + + /* Close dataset with implicit index */ + if (ds->implicit_did != badhid && H5Dclose(ds->implicit_did) < 0) { + printf("close_dset_real() dataset: implicit index failed\n"); + TEST_ERROR; + } + + /* Close dataset with fixed array index */ + if (ds->fa_did != badhid && H5Dclose(ds->fa_did) < 0) { + printf("close_dset_real() dataset: fa index failed\n"); + TEST_ERROR; + } + + /* Close dataset with extensible array index */ + if (ds->ea_did != badhid && H5Dclose(ds->ea_did) < 0) { + printf("close_dset_real() : ea index failed\n"); + TEST_ERROR; + } + + /* Close dataset with v2 btree index */ + if (ds->bt2_did != badhid && H5Dclose(ds->bt2_did) < 0) { + printf("close_dset_real() dataset: bt2 index failed\n"); + TEST_ERROR; + } + + return true; + +error: + H5E_BEGIN_TRY + { + H5Dclose(ds->single_did); + H5Dclose(ds->implicit_did); + H5Dclose(ds->fa_did); + H5Dclose(ds->ea_did); + H5Dclose(ds->bt2_did); + } + H5E_END_TRY; + + return false; + +} /* close_dsets() */ + +/* + * Writer + */ + +/* + * Perform the operations for the specified datasets: + * + * Dataset with single index: + * --only 1 write is performed because this dataset only has a single chunk + * + * Dataset with implicit/fixed array/extensible array/version 2 btree index: + * --GWRITES: writes that cover a single chunk per write + * --PWRITES: writes that cover a partial chunk per write + * --TWRITES: writes that cover multiple chunks per write + * --LWRITES: writes that cover multiple partial chunks per write + * + * Dataset with fixed array/extensible array/version 2 btree index: + * --INCR_EXT: increase dataset dimension sizes + * --DECR_EXT: decrease dataset dimenions sizes + */ +static bool +perform_dsets_operations(state_t *s, dsets_state_t *ds, H5F_vfd_swmr_config_t *config, np_state_t *np) +{ + unsigned step; + unsigned allowed_writes; + bool result; + + /* Dataset with single index */ + if (s->single_index) { + /* Perform single full chunk write */ + /* gwrites and twrites are the same */ + /* Doesn't matter how many writes, only perform once */ + if (s->gwrites || s->twrites) { + dbgf(2, "Perform single full chunk write to dataset with single index; only perform 1 write\n"); + + result = write_dset_single(GWRITES, s, ds); + + if (s->use_np && !np_writer(result, 0, s, np, config)) { + printf("np_writer() for addition failed\n"); + TEST_ERROR; + } + } + + /* Perform a single partial chunk write */ + /* pwrites and lwrites are the same */ + /* Doesn't matter how many writes, only perform once */ + if (s->pwrites || s->lwrites) { + dbgf(2, + "Perform single partial chunk write to dataset with single index; only perform 1 write\n"); + + result = write_dset_single(PWRITES, s, ds); + + if (s->use_np && !np_writer(result, 0, s, np, config)) { + printf("np_writer() for addition failed\n"); + TEST_ERROR; + } + } + } + + /* Datasets with implicit/fa/ea/bt2 index */ + if (s->implicit_index || s->fa_index || s->ea_index || s->bt2_index) { + + /* Perform single full chunk writes */ + if (s->gwrites) { + allowed_writes = (unsigned)(ds->scaled_dims[0] * ds->scaled_dims[1]); + dbgf(2, "The allowed -g writes is %u; you specify %u writes\n", allowed_writes, s->gwrites); + + for (step = 0; (step < s->gwrites && step < allowed_writes); step++) { + dbgf(2, "Perform single full chunk writes #%u to datasets with implicit/fa/ea/bt2 index\n", + step); + + result = write_dsets_chunks(GWRITES, s, ds, step); + + if (s->use_np && !np_writer(result, step, s, np, config)) { + printf("np_writer() for single full chunk writes failed\n"); + TEST_ERROR; + } + } + } + + /* Perform single partial chunk writes */ + if (s->pwrites) { + allowed_writes = (unsigned)(ds->scaled_dims[0] * ds->scaled_dims[1]); + dbgf(2, "The allowed -p writes is %u; you specify %u writes\n", allowed_writes, s->pwrites); + + for (step = 0; (step < s->pwrites && step < allowed_writes); step++) { + dbgf(2, "Perform single partial chunk writes #%u to datasets with implicit/fa/ea/bt2 index\n", + step); + + result = write_dsets_chunks(PWRITES, s, ds, step); + + if (s->use_np && !np_writer(result, step, s, np, config)) { + printf("np_writer() for partial single chunk writes failed\n"); + TEST_ERROR; + } + } + } + + /* Perform multiple full chunk writes */ + if (s->twrites) { + allowed_writes = (unsigned)(ds->multi_scaled[0] * ds->multi_scaled[1]); + dbgf(2, "The allowed -t writes is %u; you specify %u writes\n", allowed_writes, s->twrites); + + for (step = 0; (step < s->twrites && step < allowed_writes); step++) { + dbgf(2, "Perform multiple full chunk writes #%u to datasets with implicit/fa/ea/bt2 index\n", + step); + + result = write_dsets_chunks(TWRITES, s, ds, step); + + if (s->use_np && !np_writer(result, step, s, np, config)) { + printf("np_writer() for multiple full chunk writes failed\n"); + TEST_ERROR; + } + } + } + + /* Perform multiple partial chunk writes */ + if (s->lwrites) { + allowed_writes = (unsigned)(ds->multi_scaled[0] * ds->multi_scaled[1]); + dbgf(2, "The allowed -l writes is %u; you specify %u writes\n", allowed_writes, s->lwrites); + + for (step = 0; (step < s->lwrites && step < allowed_writes); step++) { + dbgf(2, + "Perform multiple partial chunk writes #%u to datasets with implicit/fa/ea/bt2 index\n", + step); + + result = write_dsets_chunks(LWRITES, s, ds, step); + + if (s->use_np && !np_writer(result, step, s, np, config)) { + printf("np_writer() for multiple partial chunk writes failed\n"); + TEST_ERROR; + } + } + } + + /* Increase dataset dimensions: apply only to fa/ea/bt2 index */ + if (!s->implicit_index && s->xincrs) { + for (step = 0; step < s->xincrs; step++) { + dbgf(2, "Increase dataset dimension sizes by %u for datasets with fa/ea/bt2 index\n", + step + 1); + + result = dsets_extent(INCR_EXT, s, ds); + + if (s->use_np && !np_writer(result, step, s, np, config)) { + printf("np_writer() for increasing dimension sizes failed\n"); + TEST_ERROR; + } + } + } + + /* Decrease dataset dimensions: apply only to fa/ea/bt2 index */ + if (!s->implicit_index && s->ydecrs) { + for (step = 0; step < s->ydecrs; step++) { + dbgf(2, "Decrease dataset dimension sizes by %u for datasets with fa/ea/bt2 index\n", + step + 1); + + result = dsets_extent(DECR_EXT, s, ds); + + if (s->use_np && !np_writer(result, step, s, np, config)) { + printf("np_writer() for decreasing dimension sizes failed\n"); + TEST_ERROR; + } + } + } + } + + return true; + +error: + return false; + +} /* perform_dsets_operations() */ + +/* + * Perform the "action" for each of the specified datasets: + * GWRITES: perform `which` write that covers a single chunk + * PWRITES: perform `which` write that covers a partial chunk + * TWRITES: perform `which` write that covers multiple chunks + * LWRITEs: perform `which` write that covers multiple partial chunks + */ +static bool +write_dsets_chunks(unsigned action, const state_t *s, const dsets_state_t *ds, unsigned which) +{ + hsize_t start[2] = {0, 0}; + hsize_t stride[2] = {0, 0}; + hsize_t count[2] = {0, 0}; + hsize_t block[2] = {0, 0}; + + HDassert(s->implicit_index || s->fa_index || s->ea_index || s->bt2_index); + + /* Set up selection info according to the specified action */ + setup_selection(action, which, s, ds, start, stride, count, block); + + if (s->implicit_index) { + if (!write_dset(action, ds->implicit_did, s->filetype, start, stride, count, block)) { + printf("H5Dwrite to chunked dataset: implicit index dataset failed\n"); + TEST_ERROR; + } + } + + if (s->fa_index) { + if (!write_dset(action, ds->fa_did, s->filetype, start, stride, count, block)) { + printf("H5Dwrite to chunked dataset: fa index dataset failed\n"); + TEST_ERROR; + } + } + + if (s->ea_index) { + if (!write_dset(action, ds->ea_did, s->filetype, start, stride, count, block)) { + printf("H5Dwrite to chunked dataset: ea index dataset failed\n"); + TEST_ERROR; + } + } + + if (s->bt2_index) { + if (!write_dset(action, ds->bt2_did, s->filetype, start, stride, count, block)) { + printf("H5Dwrite to chunked dataset: bt2 index dataset failed\n"); + TEST_ERROR; + } + } + + return true; + +error: + return false; + +} /* write_dsets_chunks() */ + +/* + * Set up selection info: start, stride, count, block + */ +static void +setup_selection(unsigned action, unsigned which, const state_t *s, const dsets_state_t *ds, hsize_t *start, + hsize_t *stride, hsize_t *count, hsize_t *block) +{ + unsigned i, j, m, n; + bool end = false; + hsize_t chunk_dims[2]; + + HDassert(action == GWRITES || action == PWRITES || action == TWRITES || action == LWRITES); + + count[0] = 1; + count[1] = 1; + stride[0] = 1; + stride[1] = 1; + + /* Single or multiple chunk writes */ + if (action == GWRITES || action == PWRITES) { + block[0] = chunk_dims[0] = ds->chunk_dims[0]; + block[1] = chunk_dims[1] = ds->chunk_dims[1]; + + for (i = 0; i < ds->scaled_dims[0] && !end; i++) { + for (j = 0; j < ds->scaled_dims[1]; j++) { + + /* Determine which chunk to write */ + if (which == (i * ds->scaled_dims[1] + j)) { + start[0] = i * ds->chunk_dims[0]; + start[1] = j * ds->chunk_dims[1]; + + /* If an edge chunk, determine the block size */ + check_set_edge_block(s, ds, i, j, block); + + end = true; + break; + } /* end if */ + } /* end for */ + } /* end for */ + + /* Check and set partial chunk write */ + if (action == PWRITES) + check_set_partial_block(action, chunk_dims, block, start); + + /* Partial or multiple partial chunk writes */ + } + else if (action == TWRITES || action == LWRITES) { + /* Multiple chunk writes: the block covers 2 chunks in each dimension */ + block[0] = chunk_dims[0] = ds->chunk_dims[0] * 2; + block[1] = chunk_dims[1] = ds->chunk_dims[1] * 2; + + for (i = 0, m = 0; i < ds->scaled_dims[0] && !end; i += 2, m++) { + for (j = 0, n = 0; j < ds->scaled_dims[1]; j += 2, n++) { + if (which == (m * ds->multi_scaled[1] + n)) { + start[0] = i * ds->chunk_dims[0]; + start[1] = j * ds->chunk_dims[1]; + + /* If an edge chunk, determine the block size */ + check_set_edge_block(s, ds, i, j, block); + + end = true; + break; + + } /* end if */ + } /* end for */ + } /* end for */ + + /* Check and set multiple partial chunk write */ + if (action == LWRITES) + check_set_partial_block(action, chunk_dims, block, start); + } + +} /* setup_selection() */ + +/* + * Check if "i" or "j" is an edge block. + * If so, determine the block size. + */ +static void +check_set_edge_block(const state_t *s, const dsets_state_t *ds, unsigned i, unsigned j, hsize_t *block) +{ + + if (i == (ds->scaled_dims[0] - 1)) { + if ((ds->scaled_dims[0] * ds->chunk_dims[0]) >= s->rows) + block[0] = s->rows - i * ds->chunk_dims[0]; + } + + if (j == (ds->scaled_dims[1] - 1)) { + if ((ds->scaled_dims[1] * ds->chunk_dims[1]) >= s->cols) + block[1] = s->cols - (j * ds->chunk_dims[1]); + } + +} /* check_set_edge_block() */ + +/* + * Determine the starting offset and the partial block size if the block is: + * --a full chunk or a multiple full chunks + * --the block size is at least 2 + * Otherwise, nothing is done i.e. the whole block is applied + */ +static void +check_set_partial_block(unsigned action, const hsize_t *chunk_dims, hsize_t *block, hsize_t *start) +{ + HDassert(action == PWRITES || action == LWRITES); + + /* Apply only to full chunk or multi full chunks with block size > 2 */ + if (block[0] == chunk_dims[0] && block[1] == chunk_dims[1]) { + + if (block[0] > 2) { + start[0] += 1; + block[0] -= 2; + }; + + if (block[1] > 2) { + start[1] += 1; + block[1] -= 2; + }; + } + +} /* check_set_partial_block() */ + +/* + * Make the selection and then write to the dataset. + */ +static bool +write_dset(unsigned action, hid_t did, hid_t tid, hsize_t *start, hsize_t *stride, hsize_t *count, + hsize_t *block) +{ + hid_t sid = badhid; + hid_t mem_sid = badhid; + hsize_t mem_dims[2]; + unsigned int *buf = NULL; + unsigned i; + + if ((sid = H5Dget_space(did)) < 0) { + printf("H5Sget_space failed\n"); + TEST_ERROR; + } + + if (H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, block) < 0) { + printf("H5Sselect_hyperslab failed\n"); + TEST_ERROR; + } + + mem_dims[0] = block[0]; + mem_dims[1] = block[1]; + + if ((mem_sid = H5Screate_simple(2, mem_dims, NULL)) < 0) { + printf("H5Screate_simple failed\n"); + TEST_ERROR; + } + + /* Allocate the buffer for writing */ + if ((buf = HDmalloc(block[0] * block[1] * sizeof(unsigned int))) == NULL) { + printf("HDmalloc failed\n"); + TEST_ERROR; + } + + /* Fill the value to be written depending on full or partial writes */ + for (i = 0; i < (block[0] * block[1]); i++) { + if (action == GWRITES || action == TWRITES) + buf[i] = FILL_FULL; + else + buf[i] = FILL_PARTIAL; + } + + if (H5Dwrite(did, tid, mem_sid, sid, H5P_DEFAULT, buf) < 0) { + printf("H5Dwrite failed\n"); + TEST_ERROR; + } + + if (H5Sclose(sid) < 0) { + printf("H5Sclose failed\n"); + TEST_ERROR; + } + + if (buf) + HDfree(buf); + + return true; + +error: + H5E_BEGIN_TRY + { + H5Sclose(sid); + H5Sclose(mem_sid); + } + H5E_END_TRY; + + if (buf) + HDfree(buf); + + return false; + +} /* write_dset() */ + +/* + * Increase or decrease the dimenion sizes for the specified datasets. + */ +static bool +dsets_extent(unsigned action, const state_t *s, const dsets_state_t *ds) +{ + unsigned nerrors = 0; + bool ret = true; + + HDassert(s->fa_index || s->ea_index || s->bt2_index); + HDassert(action == INCR_EXT || action == DECR_EXT); + + if (s->fa_index) { + dbgf(2, "Setting dataset extent for FA dataset\n"); + if (!dset_extent_real(action, ds->fa_did, ds->chunk_dims)) { + ++nerrors; + } + } + + if (s->ea_index) { + dbgf(2, "Setting dataset extent for EA dataset\n"); + if (!dset_extent_real(action, ds->ea_did, ds->chunk_dims)) + ++nerrors; + } + + if (s->bt2_index) { + dbgf(2, "Setting dataset extent for BT2 dataset\n"); + if (!dset_extent_real(action, ds->bt2_did, ds->chunk_dims)) + ++nerrors; + } + + if (nerrors) + ret = false; + + return (ret); + +} /* dsets_extent() */ + +/* + * Perform the real work of increasing/decreasing the dataset dimension sizes + */ +static bool +dset_extent_real(unsigned action, hid_t did, const hsize_t *chunk_dims) +{ + hsize_t dims[2]; + hsize_t max_dims[2]; + hsize_t new[2]; + hid_t sid = badhid; + + if ((sid = H5Dget_space(did)) < 0) { + printf("H5Sget_space failed\n"); + TEST_ERROR; + } + + if (H5Sget_simple_extent_dims(sid, dims, max_dims) < 0) { + printf("H5Sget_simple_extent_dims failed\n"); + TEST_ERROR; + } + + switch (action) { + + case INCR_EXT: + new[0] = dims[0] + 1; + new[1] = dims[1] + 1; + + /* Cannot increase to more than maximum dimension (both dims) for FA dataset */ + /* Cannot increase to more than maximum dimension (dim 0) for EA dataset */ + if ((max_dims[0] != H5S_UNLIMITED && new[0] > max_dims[0]) || + (max_dims[1] != H5S_UNLIMITED && new[1] > max_dims[1])) { + printf("Cannot exceed maximum dimension for dataset\n"); + TEST_ERROR; + } + + break; + + case DECR_EXT: + new[0] = dims[0] - 1; + new[1] = dims[1] - 1; + + if (new[0] < chunk_dims[0] || new[1] < chunk_dims[1]) { + printf("Cannot decrease to less than chunk dimension\n"); + TEST_ERROR; + } + break; + + default: + HDassert(0 && "Unknown action?!?"); + + } /* end switch */ + + if (H5Dset_extent(did, new) < 0) { + printf("H5Dset_extent for dataset failed\n"); + TEST_ERROR; + } + + if (H5Sclose(sid) < 0) { + printf("H5Sclose failed\n"); + TEST_ERROR; + } + + return true; + +error: + H5E_BEGIN_TRY + { + H5Sclose(sid); + } + H5E_END_TRY; + + return false; +} /* dset_extent_real() */ + +/* + * Write to dataset with single index: only 1 chunk is written + */ +static bool +write_dset_single(unsigned action, const state_t *s, const dsets_state_t *ds) +{ + hsize_t count[2] = {1, 1}; + hsize_t stride[2] = {1, 1}; + hsize_t start[2] = {0, 0}; + hsize_t block[2] = {s->rows, s->cols}; + + HDassert(action == GWRITES || action == PWRITES || action == TWRITES || action == LWRITES); + HDassert(s->single_index); + + /* Check and set partial chunk write */ + if (action == PWRITES || action == LWRITES) + check_set_partial_block(action, block, block, start); + + if (!write_dset(action, ds->single_did, s->filetype, start, stride, count, block)) { + printf("H5Dwrite to dataset with single index dataset failed\n"); + TEST_ERROR; + } + + return true; + +error: + return false; + +} /* write_dset_single() */ + +/* + * Reader + */ + +/* + * Verify the operations for the specified datasets: + * + * Dataset with single index: + * --verify only 1 write because this dataset only has a single chunk + * + * Dataset with implicit/fixed array/extensible array/version 2 btree index: + * --GWRITES: verify writes that cover a single chunk per write + * --PWRITES: verify writes that cover a partial chunk per write + * --TWRITES: verify writes that cover multiple chunks per write + * --LWRITES: verify writes that cover multiple partial chunks per write + * + * Dataset with fixed array/extensible array/version 2 btree index: + * --INCR_EXT: verify the increase to dataset dimension sizes + * --DECR_EXT: verify the decrease to dataset dimensions sizes + */ +static bool +verify_dsets_operations(state_t *s, dsets_state_t *ds, H5F_vfd_swmr_config_t *config, np_state_t *np) +{ + unsigned step; + unsigned allowed_writes; + bool result; + + /* Verify dataset with single index */ + if (s->single_index) { + /* Verify a single full chunk write to dataset with single index */ + /* gwrites and twrites are the same */ + /* Doesn't matter how many writes, only perform once */ + if (s->gwrites || s->twrites) { + dbgf(2, "Verify single full chunk write to dataset with single index; only verify 1 write\n"); + + if (s->use_np && !np_confirm_verify_notify(np->fd_writer_to_reader, 0, s, np)) { + printf("np_confirm_verify_notify() verify/notify not in sync failed\n"); + TEST_ERROR; + } + + /* Wait for a few ticks for the update to happen */ + decisleep(config->tick_len * s->update_interval); + + result = verify_read_dset_single(GWRITES, s, ds); + + if (s->use_np && !np_reader(result, 0, s, np)) { + printf("np_reader() for verifying addition failed\n"); + TEST_ERROR; + } + } + + /* Verify a single partial chunk write to dataset with single index */ + /* pwrites and lwrites are the same */ + /* Doesn't matter how many writes, only perform once */ + if (s->pwrites || s->lwrites) { + dbgf(2, "Verify single partial chunk write to dataset with single index; only verify 1 write\n"); + + if (s->use_np && !np_confirm_verify_notify(np->fd_writer_to_reader, 0, s, np)) { + printf("np_confirm_verify_notify() verify/notify not in sync failed\n"); + TEST_ERROR; + } + /* Wait for a few ticks for the update to happen */ + decisleep(config->tick_len * s->update_interval); + + result = verify_read_dset_single(PWRITES, s, ds); + + if (s->use_np && !np_reader(result, 0, s, np)) { + printf("np_reader() for verifying addition failed\n"); + TEST_ERROR; + } + } + } + + /* Verify datasets with implicit/fa/ea/bt2 index */ + if (s->implicit_index || s->fa_index || s->ea_index || s->bt2_index) { + + /* Verify single full chunk writes */ + if (s->gwrites) { + allowed_writes = (unsigned)(ds->scaled_dims[0] * ds->scaled_dims[1]); + dbgf(2, "The allowed -g writes is %u; you specify %u writes\n", allowed_writes, s->gwrites); + + for (step = 0; (step < s->gwrites && step < allowed_writes); step++) { + dbgf(2, "Verify single full chunk writes #%u to datasets with implicit/fa/ea/bt2 index\n", + step); + + if (s->use_np && !np_confirm_verify_notify(np->fd_writer_to_reader, step, s, np)) { + printf("np_confirm_verify_notify() verify/notify not in sync failed\n"); + TEST_ERROR; + } + /* Wait for a few ticks for the update to happen */ + decisleep(config->tick_len * s->update_interval); + + result = verify_dsets_chunks(GWRITES, s, ds, step); + + if (s->use_np && !np_reader(result, step, s, np)) { + printf("np_reader() for verification failed\n"); + TEST_ERROR; + } + } + } + + /* Verify single partial chunk writes */ + if (s->pwrites) { + allowed_writes = (unsigned)(ds->scaled_dims[0] * ds->scaled_dims[1]); + dbgf(2, "The allowed -p writes is %u; you specify %u writes\n", allowed_writes, s->pwrites); + + for (step = 0; (step < s->pwrites && step < allowed_writes); step++) { + dbgf(2, "Verify single partial chunk writes #%u to datasets with implicit/fa/ea/bt2 index\n", + step); + + if (s->use_np && !np_confirm_verify_notify(np->fd_writer_to_reader, step, s, np)) { + printf("np_confirm_verify_notify() verify/notify not in sync failed\n"); + TEST_ERROR; + } + /* Wait for a few ticks for the update to happen */ + decisleep(config->tick_len * s->update_interval); + + result = verify_dsets_chunks(PWRITES, s, ds, step); + + if (s->use_np && !np_reader(result, step, s, np)) { + printf("np_reader() for verification failed\n"); + TEST_ERROR; + } + } + } + + /* Verify multiple full chunk writes */ + if (s->twrites) { + allowed_writes = (unsigned)(ds->multi_scaled[0] * ds->multi_scaled[1]); + dbgf(2, "The allowed -t writes is %u; you specify %u writes\n", allowed_writes, s->twrites); + + for (step = 0; (step < s->twrites && step < allowed_writes); step++) { + dbgf(2, "Verify multiple full chunk writes #%u to datasets with implicit/fa/ea/bt2 index\n", + step); + + if (s->use_np && !np_confirm_verify_notify(np->fd_writer_to_reader, step, s, np)) { + printf("np_confirm_verify_notify() verify/notify not in sync failed\n"); + TEST_ERROR; + } + /* Wait for a few ticks for the update to happen */ + decisleep(config->tick_len * s->update_interval); + + result = verify_dsets_chunks(TWRITES, s, ds, step); + + if (s->use_np && !np_reader(result, step, s, np)) { + printf("np_reader() for verification failed\n"); + TEST_ERROR; + } + } + } + + /* Verify multiple partial chunk writes */ + if (s->lwrites) { + allowed_writes = (unsigned)(ds->multi_scaled[0] * ds->multi_scaled[1]); + dbgf(2, "The allowed -l writes is %u; you specify %u writes\n", allowed_writes, s->lwrites); + + for (step = 0; (step < s->lwrites && step < allowed_writes); step++) { + dbgf(2, + "Verify multiple partial chunk writes #%u to datasets with implicit/fa/ea/bt2 index\n", + step); + + if (s->use_np && !np_confirm_verify_notify(np->fd_writer_to_reader, step, s, np)) { + printf("np_confirm_verify_notify() verify/notify not in sync failed\n"); + TEST_ERROR; + } + /* Wait for a few ticks for the update to happen */ + decisleep(config->tick_len * s->update_interval); + + result = verify_dsets_chunks(LWRITES, s, ds, step); + + if (s->use_np && !np_reader(result, step, s, np)) { + printf("np_reader() for verification failed\n"); + TEST_ERROR; + } + } + } + + /* Verify increase to dataset dimensions: apply only for fa, ea and bt2 index */ + if (!s->implicit_index && s->xincrs) { + for (step = 0; step < s->xincrs; step++) { + dbgf(2, "Verify increase to dimension sizes by %u for datasets with fa/ea/bt2 index\n", + step + 1); + + if (s->use_np && !np_confirm_verify_notify(np->fd_writer_to_reader, step, s, np)) { + printf("np_confirm_verify_notify() verify/notify not in sync failed\n"); + TEST_ERROR; + } + /* Wait for a few ticks for the update to happen */ + decisleep(config->tick_len * s->update_interval); + + result = verify_dsets_extent(INCR_EXT, s, ds, step + 1); + + if (s->use_np && !np_reader(result, step, s, np)) { + printf("np_reader() for failed\n"); + TEST_ERROR; + } + } + } + + /* Verify decrease to dataset dimensions: apply only for fa, ea and bt2 index */ + if (!s->implicit_index && s->ydecrs) { + for (step = 0; step < s->ydecrs; step++) { + dbgf(2, "Verify decrease to dimension sizes by %u for datasets with fa/ea/bt2 index\n", + step + 1); + + if (s->use_np && !np_confirm_verify_notify(np->fd_writer_to_reader, step, s, np)) { + printf("np_confirm_verify_notify() verify/notify not in sync failed\n"); + TEST_ERROR; + } + /* Wait for a few ticks for the update to happen */ + decisleep(config->tick_len * s->update_interval); + + result = verify_dsets_extent(DECR_EXT, s, ds, step + 1); + + if (s->use_np && !np_reader(result, step, s, np)) { + printf("np_reader() for verification failed\n"); + TEST_ERROR; + } + } + } + } + + return true; + +error: + + return false; + +} /* verify_dsets_operations() */ + +/* + * Verify the data read from each of the specified datasets: + * GWRITES: verify `which` write that covers a single chunk + * PWRITES: verify `which` write that covers a partial chunk + * TWRITES: verify `which` write that covers multiple chunks + * LWRITEs: verify `which` write that covers multiple partial chunks + */ +static bool +verify_dsets_chunks(unsigned action, const state_t *s, const dsets_state_t *ds, unsigned which) +{ + hsize_t start[2] = {0, 0}; + hsize_t stride[2] = {0, 0}; + hsize_t count[2] = {0, 0}; + hsize_t block[2] = {0, 0}; + unsigned int *vbuf = NULL; + + HDassert(s->implicit_index || s->fa_index || s->ea_index || s->bt2_index); + + /* Set up selection according to the specified action */ + setup_selection(action, which, s, ds, start, stride, count, block); + + if (s->implicit_index) { + if (!verify_read_dset(action, ds->implicit_did, s->filetype, start, stride, count, block)) { + printf("verify_read_dset() to dataset with implicit index failed\n"); + TEST_ERROR; + } + } + + if (s->fa_index) { + if (!verify_read_dset(action, ds->fa_did, s->filetype, start, stride, count, block)) { + printf("verify_read_dset() to dataset with fixed array index failed\n"); + TEST_ERROR; + } + } + + if (s->ea_index) { + if (!verify_read_dset(action, ds->ea_did, s->filetype, start, stride, count, block)) { + printf("verify_read_dset() to dataset with extensible array index failed\n"); + TEST_ERROR; + } + } + + if (s->bt2_index) { + if (!verify_read_dset(action, ds->bt2_did, s->filetype, start, stride, count, block)) { + printf("verify_read_dset() to dataset with bt2 index failed\n"); + TEST_ERROR; + } + } + + return true; + +error: + + return false; + +} /* verify_dsets_chunks() */ + +/* + * Verify the data read from the dataset is as expected. + */ +static bool +verify_read_dset(unsigned action, hid_t did, hid_t tid, hsize_t *start, hsize_t *stride, hsize_t *count, + hsize_t *block) +{ + hid_t mem_sid = badhid; + hid_t sid = badhid; + hsize_t mem_dims[2]; + unsigned int *rbuf = NULL; + unsigned i; + + /* Refresh the dataset */ + if (H5Drefresh(did) < 0) { + printf("H5Drefresh dataset failed\n"); + TEST_ERROR; + } + + if ((sid = H5Dget_space(did)) < 0) { + printf("H5Dget_space dataset failed\n"); + TEST_ERROR; + } + + /* Make the selection the file dataspace */ + if (H5Sselect_hyperslab(sid, H5S_SELECT_SET, start, stride, count, block) < 0) { + printf("H5Sselect to dataset failed\n"); + TEST_ERROR; + } + + mem_dims[0] = block[0]; + mem_dims[1] = block[1]; + if ((mem_sid = H5Screate_simple(2, mem_dims, NULL)) < 0) { + printf("H5Screate_simple failed\n"); + TEST_ERROR; + } + + /* Allocate the buffer for reading */ + if ((rbuf = HDmalloc(block[0] * block[1] * sizeof(unsigned int))) == NULL) { + printf("HDmalloc failed\n"); + TEST_ERROR; + } + + /* Read the data from the dataset into `rbuf` */ + if (H5Dread(did, tid, mem_sid, sid, H5P_DEFAULT, rbuf) < 0) { + printf("H5Dread from dataset failed\n"); + TEST_ERROR; + } + + /* Verify the data read in `rbuf` is as the fill value expected */ + for (i = 0; i < block[0] * block[1]; i++) { + if (action == GWRITES || action == TWRITES) { + if (rbuf[i] != FILL_FULL) { + printf("Invalid value for dataset for GWRITES/TWRITES\n"); + TEST_ERROR; + } + } + else { + HDassert(action == PWRITES || action == LWRITES); + if (rbuf[i] != FILL_PARTIAL) { + printf("Invalid value for dataset for GWRITES/TWRITES\n"); + TEST_ERROR; + } + } + } + + if (H5Sclose(sid) < 0) { + printf("H5Sclose failed\n"); + TEST_ERROR; + } + + if (H5Sclose(mem_sid) < 0) { + printf("H5Sclose failed\n"); + TEST_ERROR; + } + + if (rbuf) + HDfree(rbuf); + + return true; + +error: + H5E_BEGIN_TRY + { + H5Sclose(sid); + H5Sclose(mem_sid); + } + H5E_END_TRY; + + if (rbuf) + HDfree(rbuf); + + return false; + +} /* verify_read_dset() */ + +/* + * Verify the increase or decrease of dimenion sizes for the specified datasets. + */ +static bool +verify_dsets_extent(unsigned action, const state_t *s, const dsets_state_t *ds, unsigned which) +{ + unsigned rows = s->rows; + unsigned cols = s->cols; + + HDassert(action == INCR_EXT || action == DECR_EXT); + HDassert(s->fa_index || s->ea_index || s->bt2_index); + + /* s->xincrs can be 0 or the increased extent of the dataset */ + if (action == DECR_EXT) { + rows = s->rows + s->xincrs; + cols = s->cols + s->xincrs; + } + + if (s->fa_index) { + dbgf(2, "Verify dataset extent for FA dataset\n"); + if (!verify_dset_extent_real(action, ds->fa_did, rows, cols, which)) { + printf("verify_read_dset() to dataset with fixed array index failed\n"); + TEST_ERROR; + } + } + + if (s->ea_index) { + dbgf(2, "Verify dataset extent for EA dataset\n"); + if (!verify_dset_extent_real(action, ds->fa_did, rows, cols, which)) { + printf("verify_read_dset() to dataset with fixed array index failed\n"); + TEST_ERROR; + } + } + + if (s->bt2_index) { + dbgf(2, "Verify dataset extent for BT2 dataset\n"); + if (!verify_dset_extent_real(action, ds->bt2_did, rows, cols, which)) { + printf("verify_read_dset() to dataset with fixed array index failed\n"); + TEST_ERROR; + } + } + + return true; + +error: + return false; + +} /* verify_dsets_extent() */ + +/* + * Do the real work of verifying the increase/decrease for the dataset dimension sizes + */ +static bool +verify_dset_extent_real(unsigned action, hid_t did, unsigned rows, unsigned cols, unsigned which) +{ + hsize_t dims[2]; + hid_t sid = badhid; + + /* Refresh the dataset */ + if (H5Drefresh(did) < 0) { + printf("H5Drefresh dataset failed\n"); + TEST_ERROR; + } + + if ((sid = H5Dget_space(did)) < 0) { + printf("H5Dget_space dataset failed\n"); + TEST_ERROR; + } + + if (H5Sget_simple_extent_dims(sid, dims, NULL) < 0) { + printf("H5Sget_simple_extent_dims() failed\n"); + TEST_ERROR; + } + + switch (action) { + + case INCR_EXT: + if (dims[0] != (rows + which) || dims[1] != (cols + which)) + TEST_ERROR + + break; + + case DECR_EXT: + if (dims[0] != (rows - which) || dims[1] != (cols - which)) + TEST_ERROR + break; + + default: + HDassert(0 && "Unknown action?!?"); + + } /* end switch */ + + if (H5Sclose(sid) < 0) { + printf("H5Sclose failed\n"); + TEST_ERROR; + } + + return true; + +error: + H5E_BEGIN_TRY + { + H5Sclose(sid); + } + H5E_END_TRY; + + return false; +} /* verify_dset_extent_real() */ + +/* + * Verify that the data read from the dataset with single index is as unexpected. + */ +static bool +verify_read_dset_single(unsigned action, const state_t *s, const dsets_state_t *ds) +{ + hsize_t block[2] = {s->rows, s->cols}; + hsize_t count[2] = {1, 1}; + hsize_t stride[2] = {1, 1}; + hsize_t start[2] = {0, 0}; + + HDassert(action == GWRITES || action == PWRITES); + HDassert(s->single_index); + + if (action == PWRITES) + check_set_partial_block(action, block, block, start); + + if (!verify_read_dset(action, ds->single_did, s->filetype, start, stride, count, block)) { + printf("verify_read_dset() to dataset with single index failed\n"); + TEST_ERROR; + } + + return true; + +error: + return false; + +} /* verify_read_dset_single() */ + +/* + * Named pipes handling + */ + +/* + * Initialize the named pipes for test synchronization. + */ +static bool +np_init(np_state_t *np, bool writer) +{ + *np = NP_INITIALIZER; + + /* + * Use two named pipes(FIFO) to coordinate the writer and reader for + * two-way communication so that the two sides can move forward together. + * One is for the writer to write to the reader. + * The other one is for the reader to signal the writer. + */ + if (writer) { + /* If the named pipes are present at the start of the test, remove them */ + if (HDaccess(np->fifo_writer_to_reader, F_OK) == 0) + if (HDremove(np->fifo_writer_to_reader) != 0) { + printf("HDremove fifo_writer_to_reader failed\n"); + TEST_ERROR; + } + + if (HDaccess(np->fifo_reader_to_writer, F_OK) == 0) + if (HDremove(np->fifo_reader_to_writer) != 0) { + printf("HDremove fifo_reader_to_writer failed\n"); + TEST_ERROR; + } + + /* Writer creates two named pipes(FIFO) */ + if (HDmkfifo(np->fifo_writer_to_reader, 0600) < 0) { + printf("HDmkfifo fifo_writer_to_reader failed\n"); + TEST_ERROR; + } + + if (HDmkfifo(np->fifo_reader_to_writer, 0600) < 0) { + printf("HDmkfifo fifo_reader_to_writer failed\n"); + TEST_ERROR; + } + } + + /* Both the writer and reader open the pipes */ + if ((np->fd_writer_to_reader = HDopen(np->fifo_writer_to_reader, O_RDWR)) < 0) { + printf("HDopen fifo_writer_to_reader failed\n"); + TEST_ERROR; + } + + if ((np->fd_reader_to_writer = HDopen(np->fifo_reader_to_writer, O_RDWR)) < 0) { + printf("HDopen fifo_reader_to_writer failed\n"); + TEST_ERROR; + } + + return true; + +error: + return false; + +} /* np_init() */ + +/* + * Close the named pipes. + */ +static bool +np_close(np_state_t *np, bool writer) +{ + /* Both the writer and reader close the named pipes */ + if (HDclose(np->fd_writer_to_reader) < 0) { + printf("HDclose fd_writer_to_reader failed\n"); + TEST_ERROR; + } + + if (HDclose(np->fd_reader_to_writer) < 0) { + printf("HDclose fd_reader_to_writer failed\n"); + TEST_ERROR; + } + + /* Reader finishes last and deletes the named pipes */ + if (!writer) { + if (HDremove(np->fifo_writer_to_reader) != 0) { + printf("HDremove fifo_writer_to_reader failed\n"); + TEST_ERROR; + } + + if (HDremove(np->fifo_reader_to_writer) != 0) { + printf("HDremove fifo_reader_to_writer failed\n"); + TEST_ERROR; + } + } + return true; + +error: + return false; +} /* np_close() */ + +/* + * Writer synchronization depending on the result from the action performed. + */ +static bool +np_writer(bool result, unsigned step, const state_t *s, np_state_t *np, H5F_vfd_swmr_config_t *config) +{ + unsigned int i; + + /* The action fails */ + if (!result) { + printf("action failed\n"); + H5_FAILED(); + AT(); + + /* At communication interval, notify the reader about the failure and quit */ + if (step % s->csteps == 0) { + np->notify = -1; + HDwrite(np->fd_writer_to_reader, &np->notify, sizeof(int)); + goto error; + } + /* The action succeeds */ + } + else { + /* At communication interval, notify the reader and wait for its response */ + if (step % s->csteps == 0) { + /* Bump up the value of notify to tell the reader to start reading */ + np->notify++; + if (HDwrite(np->fd_writer_to_reader, &np->notify, sizeof(int)) < 0) { + printf("HDwrite failed\n"); + TEST_ERROR; + } + + /* During the wait, writer makes repeated HDF5 API calls + * to trigger EOT at approximately the correct time */ + for (i = 0; i < config->max_lag + 1; i++) { + decisleep(config->tick_len); + H5E_BEGIN_TRY + { + H5Aexists(s->file, "nonexistent"); + } + H5E_END_TRY; + } + + /* Handshake between writer and reader */ + if (!np_confirm_verify_notify(np->fd_reader_to_writer, step, s, np)) { + printf("np_confirm_verify_notify() verify/notify not in sync failed\n"); + TEST_ERROR; + } + } + } + return true; + +error: + return false; + +} /* np_writer() */ + +/* + * + * Reader synchronization depending on the result from the verification. + */ +static bool +np_reader(bool result, unsigned step, const state_t *s, np_state_t *np) +{ + /* The verification fails */ + if (!result) { + printf("verify action failed\n"); + H5_FAILED(); + AT(); + + /* At communication interval, tell the writer about the failure and exit */ + if (step % s->csteps == 0) { + np->notify = -1; + HDwrite(np->fd_reader_to_writer, &np->notify, sizeof(int)); + goto error; + } + /* The verification succeeds */ + } + else { + if (step % s->csteps == 0) { + /* Send back the same notify value for acknowledgement: + * --inform the writer to move to the next step */ + if (HDwrite(np->fd_reader_to_writer, &np->notify, sizeof(int)) < 0) { + printf("HDwrite failed\n"); + TEST_ERROR; + } + } + } + return true; + +error: + return false; + +} /* np_reader() */ + +/* + * Handshake between writer and reader: + * Confirm `verify` is same as `notify`. + */ +static bool +np_confirm_verify_notify(int fd, unsigned step, const state_t *s, np_state_t *np) +{ + if (step % s->csteps == 0) { + np->verify++; + if (HDread(fd, &np->notify, sizeof(int)) < 0) { + printf("HDread failed\n"); + TEST_ERROR; + } + + if (np->notify == -1) { + printf("reader/writer failed to verify\n"); + TEST_ERROR; + } + + if (np->notify != np->verify) { + printf("received message %d, expecting %d\n", np->notify, np->verify); + TEST_ERROR; + } + } + + return true; + +error: + return false; +} /* np_confirm_verify_notify() */ + +/* + * Main + */ +int +main(int argc, char **argv) +{ + hid_t fapl, fcpl; + bool writer; + state_t s; + const char * personality; + H5F_vfd_swmr_config_t config; + np_state_t np; + dsets_state_t ds; + + if (!state_init(&s, argc, argv)) { + printf("state_init() failed\n"); + TEST_ERROR; + } + + personality = HDstrstr(s.progname, "vfd_swmr_dsetchks_"); + + if (personality != NULL && HDstrcmp(personality, "vfd_swmr_dsetchks_writer") == 0) + writer = true; + else if (personality != NULL && HDstrcmp(personality, "vfd_swmr_dsetchks_reader") == 0) + writer = false; + else { + printf("unknown personality, expected vfd_swmr_dsetchks_{reader,writer}\n"); + TEST_ERROR; + } + + /* config, tick_len, max_lag, writer, flush_raw_data, md_pages_reserved, md_file_path */ + init_vfd_swmr_config(&config, 4, 7, writer, FALSE, 128, "./dsetchks-shadow"); + + /* use_latest_format, use_vfd_swmr, only_meta_page, config */ + if ((fapl = vfd_swmr_create_fapl(true, s.use_vfd_swmr, true, &config)) < 0) { + printf("vfd_swmr_create_fapl() failed\n"); + TEST_ERROR; + } + + if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) { + printf("H5Pcreate failed\n"); + TEST_ERROR; + } + + if (H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, false, 1) < 0) { + printf("H5Pset_file_space_strategy failed\n"); + TEST_ERROR; + } + + if (writer) { + if ((s.file = H5Fcreate(s.filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) { + printf("H5Fcreate failed\n"); + TEST_ERROR; + } + + if (!create_dsets(&s, &ds)) { + printf("create_dsets() failed\n"); + TEST_ERROR; + } + } + else { + if ((s.file = H5Fopen(s.filename, H5F_ACC_RDONLY, fapl)) < 0) { + printf("H5Fopen failed\n"); + TEST_ERROR; + } + if (!open_dsets(&s, &ds)) { + printf("open_dsets() failed\n"); + TEST_ERROR; + } + } + + /* Initiailze named pipes */ + if (s.use_np && !np_init(&np, writer)) { + printf("np_init() failed\n"); + TEST_ERROR; + } + + if (writer) { + + if (!perform_dsets_operations(&s, &ds, &config, &np)) { + printf("perform_dsets_operations() failed\n"); + TEST_ERROR; + } + } + else { + + if (!verify_dsets_operations(&s, &ds, &config, &np)) { + printf("perform_dsets_operations() failed\n"); + TEST_ERROR; + } + } + + if (!close_dsets(&ds)) { + printf("close_dsets() failed\n"); + TEST_ERROR; + } + + if (H5Pclose(fapl) < 0) { + printf("H5Pclose failed\n"); + TEST_ERROR; + } + + if (H5Pclose(fcpl) < 0) { + printf("H5Pclose failed\n"); + TEST_ERROR; + } + + if (H5Fclose(s.file) < 0) { + printf("H5Fclose failed\n"); + TEST_ERROR; + } + + if (s.use_np && !np_close(&np, writer)) { + printf("np_close() failed\n"); + TEST_ERROR; + } + + return EXIT_SUCCESS; + +error: + H5E_BEGIN_TRY + { + H5Pclose(fapl); + H5Pclose(fcpl); + H5Fclose(s.file); + } + H5E_END_TRY; + + if (s.use_np && np.fd_writer_to_reader >= 0) + HDclose(np.fd_writer_to_reader); + + if (s.use_np && np.fd_reader_to_writer >= 0) + HDclose(np.fd_reader_to_writer); + + if (s.use_np && !writer) { + HDremove(np.fifo_writer_to_reader); + HDremove(np.fifo_reader_to_writer); + } + + return EXIT_FAILURE; +} /* main */ + +#else /* H5_HAVE_WIN32_API */ + +int +main(void) +{ + HDfprintf(stderr, "Non-POSIX platform. Skipping.\n"); + return EXIT_SUCCESS; +} /* end main() */ + +#endif /* H5_HAVE_WIN32_API */ |