diff options
author | John Mainzer <mainzer@hdfgroup.org> | 2015-10-12 18:58:32 (GMT) |
---|---|---|
committer | John Mainzer <mainzer@hdfgroup.org> | 2015-10-12 18:58:32 (GMT) |
commit | bb656dfc91f23b29d772a356cf18dbf1ffe33eb7 (patch) | |
tree | 3e4a418863e380d3e197b2c5afaceb8d661b1f3f | |
parent | c5a9bb780f5ce444f888b3cfe775bbe07b5d7b95 (diff) | |
download | hdf5-bb656dfc91f23b29d772a356cf18dbf1ffe33eb7.zip hdf5-bb656dfc91f23b29d772a356cf18dbf1ffe33eb7.tar.gz hdf5-bb656dfc91f23b29d772a356cf18dbf1ffe33eb7.tar.bz2 |
[svn-r28042] Bug fix for failure in testpar/t_cache
Problem appears to have been caused by new code which
dirties a cache entry unexpectedly at file close. This
in turn throws off the write counts maintained by the
test, causing it to fail.
Solution was to manually flush the cache prior to file
close, verify the expected writes, and then de-register
the callback used to obtain write counts from the cache.
After cache shut down, I added additional code to verify
that no test entries were written during the shutdown
process.
The net effect is to insulate the t_cache test code from
the shutdown process -- albeit at the cost of writing
all test entries prior to the shutdown via a manual flush.
As the code involved should be the same either way, this
seems an acceptable solution. However, we may want to
re-visit it once file close proceedure has been tamed.
Tested parallel on mercury.
Note that a failure showed up the h5format_convert tests
on all builds after my first. As all my changes were in
testpar, this almost certainly is un-related. At a guess,
there is an issue with make distclean. At Quincey's
direction, I am proceeding with the checkin.
Note also that the following files
tools/h5format_convert/testfiles/h5fc_edge.h5
tools/h5format_convert/testfiles/h5fc_all.h5
tools/h5format_convert/testfiles/h5fc_new.h5
were modified by my build, and are included in the
subversion archive. I reverted changes to them prior
to this checkin.
-rw-r--r-- | testpar/t_cache.c | 90 |
1 files changed, 61 insertions, 29 deletions
diff --git a/testpar/t_cache.c b/testpar/t_cache.c index 4a894b9..9e1a14b 100644 --- a/testpar/t_cache.c +++ b/testpar/t_cache.c @@ -485,7 +485,7 @@ static hbool_t setup_cache_for_test(hid_t * fid_ptr, H5C_t ** cache_ptr_ptr, int metadata_write_strategy); static void setup_rand(void); -static hbool_t take_down_cache(hid_t fid); +static hbool_t take_down_cache(hid_t fid, H5C_t * cache_ptr); static hbool_t verify_entry_reads(haddr_t addr, int expected_entry_reads); static hbool_t verify_entry_writes(haddr_t addr, int expected_entry_writes); static hbool_t verify_total_reads(int expected_total_reads); @@ -4492,35 +4492,77 @@ setup_rand(void) * *****************************************************************************/ static hbool_t -take_down_cache(hid_t fid) +take_down_cache(hid_t fid, H5C_t * cache_ptr) { - hbool_t success = FALSE; /* will set to TRUE if appropriate. */ + hbool_t success = TRUE; /* will set to FALSE if appropriate. */ - /* close the file and delete it */ - if ( H5Fclose(fid) < 0 ) { + /* flush the file -- this should write out any remaining test + * entries in the cache. + */ + if ( ( success ) && ( H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0 ) ) { + success = FALSE; nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: H5Fclose() failed.\n", + HDfprintf(stdout, "%d:%s: H5Fflush() failed.\n", world_mpi_rank, FUNC); } + } - } else if ( world_mpi_rank == world_server_mpi_rank ) { + /* Now reset the sync point done callback. Must do this as with + * the SWMR mods, the cache will do additional I/O on file close + * un-related to the test entries, and thereby corrupt our counts + * of entry writes. + */ + if ( success ) { - if ( HDremove(filenames[0]) < 0 ) { + if ( H5AC__set_sync_point_done_callback(cache_ptr, NULL) != SUCCEED ) { + success = FALSE; nerrors++; if ( verbose ) { - HDfprintf(stdout, "%d:%s: HDremove() failed.\n", + HDfprintf(stdout, + "%d:%s: H5AC__set_sync_point_done_callback failed.\n", world_mpi_rank, FUNC); } - } else { + } + + + } + + /* close the file */ + if ( ( success ) && ( H5Fclose(fid) < 0 ) ) { - success = TRUE; + success = FALSE; + nerrors++; + if ( verbose ) { + HDfprintf(stdout, "%d:%s: H5Fclose() failed.\n", + world_mpi_rank, FUNC); } - } else { - success = TRUE; + } + + if ( success ) { + + if ( world_mpi_rank == world_server_mpi_rank ) { + + if ( HDremove(filenames[0]) < 0 ) { + + success = FALSE; + nerrors++; + if ( verbose ) { + HDfprintf(stdout, "%d:%s: HDremove() failed.\n", + world_mpi_rank, FUNC); + } + } + } else { + + /* verify that there have been no further writes of test + * entries during the close + */ + success = verify_total_writes(0); + + } } return(success); @@ -5577,7 +5619,7 @@ smoke_check_1(int metadata_write_strategy) if ( fid >= 0 ) { - if ( ! take_down_cache(fid) ) { + if ( ! take_down_cache(fid, cache_ptr) ) { nerrors++; if ( verbose ) { @@ -5799,7 +5841,7 @@ smoke_check_2(int metadata_write_strategy) if ( fid >= 0 ) { - if ( ! take_down_cache(fid) ) { + if ( ! take_down_cache(fid, cache_ptr) ) { nerrors++; if ( verbose ) { @@ -6122,7 +6164,7 @@ smoke_check_3(int metadata_write_strategy) if ( fid >= 0 ) { - if ( ! take_down_cache(fid) ) { + if ( ! take_down_cache(fid, cache_ptr) ) { nerrors++; if ( verbose ) { @@ -6439,7 +6481,7 @@ smoke_check_4(int metadata_write_strategy) if ( fid >= 0 ) { - if ( ! take_down_cache(fid) ) { + if ( ! take_down_cache(fid, cache_ptr) ) { nerrors++; if ( verbose ) { @@ -6649,7 +6691,7 @@ smoke_check_5(int metadata_write_strategy) if ( fid >= 0 ) { - if ( ! take_down_cache(fid) ) { + if ( ! take_down_cache(fid, cache_ptr) ) { nerrors++; if ( verbose ) { @@ -6998,7 +7040,7 @@ trace_file_check(int metadata_write_strategy) if ( fid >= 0 ) { - if ( ! take_down_cache(fid) ) { + if ( ! take_down_cache(fid, cache_ptr) ) { nerrors++; if ( verbose ) { @@ -7168,16 +7210,6 @@ main(int argc, char **argv) int mpi_rank; int max_nerrors; - /* This will print multiple times since all processes will execute - * the printf statements. This makes it stick out in the output, though, - * and means we don't need to waste time initializing and then - * immediately tearing down MPI. - */ - printf("===================================\n"); - printf("TEMPORARILY SKIPPED\n"); - printf("===================================\n"); - return EXIT_SUCCESS; - MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); |