diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2014-02-28 00:51:55 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2014-02-28 00:51:55 (GMT) |
commit | fd088b06b994876d40e31e77eabb291ce7429094 (patch) | |
tree | a32fceca7a5fdf72c2012fd1114a1df93c987c5a | |
parent | 973a7775c6b86bf8965f53b6281a87766807a64b (diff) | |
download | hdf5-fd088b06b994876d40e31e77eabb291ce7429094.zip hdf5-fd088b06b994876d40e31e77eabb291ce7429094.tar.gz hdf5-fd088b06b994876d40e31e77eabb291ce7429094.tar.bz2 |
[svn-r24747] 1) Change names of public routines:
H5Ocork --> H5Odisable_mdc_flushes
H5Ouncork --> H5Oenable_mdc_flushes
H5Ois_corked --> H5Oare_mdc_flushes_disabled
2) test/cork.c: modified to use the new names
3) change name of use case example file: test/use_cork.c --> use_disable_mdc_flushes.c
4) test/cache.c test/cache_common.c: add comments
Tested on jam, koala, ostrich, platypus.
PENDING:
a) code review
b) hl/test/test_ld.c suddenly fails when using mpicc (via h5committest): need further investigation.
-rw-r--r-- | MANIFEST | 2 | ||||
-rw-r--r-- | src/H5O.c | 33 | ||||
-rw-r--r-- | src/H5Opublic.h | 6 | ||||
-rw-r--r-- | test/Makefile.am | 14 | ||||
-rw-r--r-- | test/Makefile.in | 43 | ||||
-rw-r--r-- | test/cache.c | 43 | ||||
-rw-r--r-- | test/cache_common.c | 2 | ||||
-rw-r--r-- | test/cork.c | 195 | ||||
-rw-r--r-- | test/test_usecases.sh.in | 4 | ||||
-rw-r--r-- | test/use_disable_mdc_flushes.c (renamed from test/use_cork.c) | 58 |
10 files changed, 204 insertions, 196 deletions
@@ -1151,7 +1151,7 @@ ./test/use_append_chunk.c ./test/use_append_mchunks.c ./test/use_common.c -./test/use_cork.c +./test/use_disable_mdc_flushes.c ./test/use.h ./test/vfd.c ./test/test_filters_le.h5 @@ -1087,7 +1087,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5Ocork + * Function: H5Odisable_mdc_flushes * * Purpose: To "cork" an object: * --keep dirty entries assoicated with the object in the metadata cache @@ -1100,7 +1100,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Ocork(hid_t object_id) +H5Odisable_mdc_flushes(hid_t object_id) { H5O_loc_t *oloc; /* Object location */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1117,11 +1117,11 @@ H5Ocork(hid_t object_id) done: FUNC_LEAVE_API(ret_value) -} /* H5Ocork() */ +} /* H5Odisable_mdc_flushes() */ /*------------------------------------------------------------------------- - * Function: H5Ouncork + * Function: H5Oenable_mdc_flushes * * Purpose: To "uncork" an object * --release keeping dirty entries associated with the object @@ -1135,7 +1135,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Ouncork(hid_t object_id) +H5Oenable_mdc_flushes(hid_t object_id) { H5O_loc_t *oloc; /* Object location */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1153,15 +1153,15 @@ H5Ouncork(hid_t object_id) done: FUNC_LEAVE_API(ret_value) -} /* H5Ouncork() */ +} /* H5Oenable_mdc_flushes() */ /*------------------------------------------------------------------------- - * Function: H5Ois_corked + * Function: H5Oare_mdc_flushes_disabled * - * Purpose: Retrieve the object's "cork" status in the parameter "corked": - * TRUE if the object is "corked" - * FALSE if the object is not "corked" - * Return error if the parameter "corked" is not supplied + * Purpose: Retrieve the object's "cork" status in the parameter "are_disabled": + * TRUE if mdc flushes for the object is disabled + * FALSE if mdc flushes for the object is not disabled + * Return error if the parameter "are_disabled" is not supplied * * Return: Success: Non-negative * Failure: Negative @@ -1171,29 +1171,29 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Ois_corked(hid_t object_id, hbool_t *corked) +H5Oare_mdc_flushes_disabled(hid_t object_id, hbool_t *are_disabled) { H5O_loc_t *oloc; /* Object location */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) - H5TRACE2("e", "i*b", object_id, corked); + H5TRACE2("e", "i*b", object_id, are_disabled); /* Check args */ /* Get the object's oloc */ if((oloc = H5O_get_loc(object_id)) == NULL) HGOTO_ERROR(H5E_ATOM, H5E_BADVALUE, FAIL, "unable to get object location from ID") - if(!corked) + if(!are_disabled) HGOTO_ERROR(H5E_ATOM, H5E_BADVALUE, FAIL, "unable to get object location from ID") /* Get the cork status */ - if(H5AC_cork(oloc->file, oloc->addr, H5AC__GET_CORKED, corked) < 0) + if(H5AC_cork(oloc->file, oloc->addr, H5AC__GET_CORKED, are_disabled) < 0) HGOTO_ERROR(H5E_ATOM, H5E_BADVALUE, FAIL, "unable to retrieve an object's cork status") done: FUNC_LEAVE_API(ret_value) -} /* H5Ois_corked() */ +} /* H5Oare_mdc_flushes_disabled() */ /*------------------------------------------------------------------------- @@ -1549,7 +1549,6 @@ done: herr_t H5O_close(H5O_loc_t *loc) { - hbool_t corked; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) diff --git a/src/H5Opublic.h b/src/H5Opublic.h index 12d0780..af7bed1 100644 --- a/src/H5Opublic.h +++ b/src/H5Opublic.h @@ -184,9 +184,9 @@ H5_DLL herr_t H5Ovisit_by_name(hid_t loc_id, const char *obj_name, H5_DLL herr_t H5Oclose(hid_t object_id); H5_DLL herr_t H5Oflush(hid_t obj_id); H5_DLL herr_t H5Orefresh(hid_t oid); -H5_DLL herr_t H5Ocork(hid_t object_id); -H5_DLL herr_t H5Ouncork(hid_t object_id); -H5_DLL herr_t H5Ois_corked(hid_t object_id, hbool_t *corked); +H5_DLL herr_t H5Odisable_mdc_flushes(hid_t object_id); +H5_DLL herr_t H5Oenable_mdc_flushes(hid_t object_id); +H5_DLL herr_t H5Oare_mdc_flushes_disabled(hid_t object_id, hbool_t *are_disabled); diff --git a/test/Makefile.am b/test/Makefile.am index c30d772..e2368b4 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -29,12 +29,12 @@ INCLUDES=-I$(top_srcdir)/src -I$(top_builddir)/src # testcheck_version.sh: tcheck_version # tetlinks_env.sh: links_env # testflushrefresh.sh: flushrefresh -# test_usecases.sh: use_append_chunk, use_append_mchunks, use_cork +# test_usecases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes # testswmr.sh: swmr* TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh \ testflushrefresh.sh test_usecases.sh $(srcdir)/testswmr.sh SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) \ - flushrefresh$(EXEEXT) use_append_chunk$(EXEEXT) use_append_mchunks$(EXEEXT) use_cork$(EXEEXT) \ + flushrefresh$(EXEEXT) use_append_chunk$(EXEEXT) use_append_mchunks$(EXEEXT) use_disable_mdc_flushes$(EXEEXT) \ swmr_generator$(EXEEXT) swmr_reader$(EXEEXT) swmr_writer$(EXEEXT) \ swmr_remove_reader$(EXEEXT) swmr_remove_writer$(EXEEXT) swmr_addrem_writer$(EXEEXT) \ swmr_sparse_reader$(EXEEXT) swmr_sparse_writer$(EXEEXT) swmr_start_write$(EXEEXT) @@ -62,7 +62,7 @@ TEST_PROG= testhdf5 lheap ohdr stab gheap cache cache_api cache_tagging \ bin_PROGRAMS=swmr_generator swmr_start_write swmr_reader swmr_writer swmr_remove_reader \ swmr_remove_writer swmr_addrem_writer swmr_sparse_reader swmr_sparse_writer \ - use_append_chunk use_append_mchunks use_cork atomic_writer atomic_reader accum_swmr_reader + use_append_chunk use_append_mchunks use_disable_mdc_flushes atomic_writer atomic_reader accum_swmr_reader # List programs to be built when testing here. # error_test and err_compat are built at the same time as the other tests, but executed by testerror.sh. @@ -71,14 +71,14 @@ bin_PROGRAMS=swmr_generator swmr_start_write swmr_reader swmr_writer swmr_remove # atomic_writer and atomic_reader are standalone programs. # links_env is used by testlinks_env.sh # flushrefresh is used by testflushrefresh.sh. -# use_append_chunk, use_append_mchunks and use_cork are used by test_usecases.sh +# use_append_chunk, use_append_mchunks and use_disable_mdc_flushes are used by test_usecases.sh # swmr* files are used by testswmr.sh. # 'make check' doesn't run them directly, so they are not included in TEST_PROG. # Also build testmeta, which is used for timings test. It builds quickly, # and this lets automake keep all its test programs in one place. check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version \ testmeta accum_swmr_reader atomic_writer atomic_reader \ - links_env flushrefresh use_append_chunk use_append_mchunks use_cork \ + links_env flushrefresh use_append_chunk use_append_mchunks use_disable_mdc_flushes \ swmr_generator swmr_start_write swmr_reader swmr_writer swmr_remove_reader \ swmr_remove_writer swmr_addrem_writer swmr_sparse_reader swmr_sparse_writer if HAVE_SHARED_CONDITIONAL @@ -179,7 +179,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 \ new_multi_file_v16-r.h5 new_multi_file_v16-s.h5 \ split_get_file_image_test-m.h5 split_get_file_image_test-r.h5 \ file_image_core_test.h5.copy unregister_filter_1.h5 unregister_filter_2.h5 \ - swmr_data.h5 use_use_append_chunk.h5 use_append_mchunks.h5 use_cork.h5 \ + swmr_data.h5 use_use_append_chunk.h5 use_append_mchunks.h5 use_disable_mdc_flushes.h5 \ flushrefresh.h5 flushrefresh_VERIFICATION_START \ flushrefresh_VERIFICATION_CHECKPOINT1 flushrefresh_VERIFICATION_CHECKPOINT2 \ flushrefresh_VERIFICATION_DONE atomic_data accum_swmr_big.h5 ohdr_swmr.h5 test_swmr.h5 @@ -193,7 +193,7 @@ testhdf5_SOURCES=testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ # Sources for Use Cases use_append_chunk_SOURCES=use_append_chunk.c use_common.c use_append_mchunks_SOURCES=use_append_mchunks.c use_common.c -use_cork_SOURCES=use_cork.c +use_cork_SOURCES=use_disable_mdc_flushes.c # Temporary files. DISTCLEANFILES=testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_plugin.sh \ diff --git a/test/Makefile.in b/test/Makefile.in index c4f0e36..f475611 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -84,7 +84,7 @@ bin_PROGRAMS = swmr_generator$(EXEEXT) swmr_start_write$(EXEEXT) \ swmr_remove_reader$(EXEEXT) swmr_remove_writer$(EXEEXT) \ swmr_addrem_writer$(EXEEXT) swmr_sparse_reader$(EXEEXT) \ swmr_sparse_writer$(EXEEXT) use_append_chunk$(EXEEXT) \ - use_append_mchunks$(EXEEXT) use_cork$(EXEEXT) \ + use_append_mchunks$(EXEEXT) use_disable_mdc_flushes$(EXEEXT) \ atomic_writer$(EXEEXT) atomic_reader$(EXEEXT) \ accum_swmr_reader$(EXEEXT) check_PROGRAMS = $(am__EXEEXT_1) error_test$(EXEEXT) \ @@ -92,7 +92,7 @@ check_PROGRAMS = $(am__EXEEXT_1) error_test$(EXEEXT) \ accum_swmr_reader$(EXEEXT) atomic_writer$(EXEEXT) \ atomic_reader$(EXEEXT) links_env$(EXEEXT) \ flushrefresh$(EXEEXT) use_append_chunk$(EXEEXT) \ - use_append_mchunks$(EXEEXT) use_cork$(EXEEXT) \ + use_append_mchunks$(EXEEXT) use_disable_mdc_flushes$(EXEEXT) \ swmr_generator$(EXEEXT) swmr_start_write$(EXEEXT) \ swmr_reader$(EXEEXT) swmr_writer$(EXEEXT) \ swmr_remove_reader$(EXEEXT) swmr_remove_writer$(EXEEXT) \ @@ -587,10 +587,10 @@ am_use_append_mchunks_OBJECTS = use_append_mchunks.$(OBJEXT) \ use_append_mchunks_OBJECTS = $(am_use_append_mchunks_OBJECTS) use_append_mchunks_LDADD = $(LDADD) use_append_mchunks_DEPENDENCIES = libh5test.la $(LIBHDF5) -am_use_cork_OBJECTS = use_cork.$(OBJEXT) -use_cork_OBJECTS = $(am_use_cork_OBJECTS) -use_cork_LDADD = $(LDADD) -use_cork_DEPENDENCIES = libh5test.la $(LIBHDF5) +use_disable_mdc_flushes_SOURCES = use_disable_mdc_flushes.c +use_disable_mdc_flushes_OBJECTS = use_disable_mdc_flushes.$(OBJEXT) +use_disable_mdc_flushes_LDADD = $(LDADD) +use_disable_mdc_flushes_DEPENDENCIES = libh5test.la $(LIBHDF5) vfd_SOURCES = vfd.c vfd_OBJECTS = vfd.$(OBJEXT) vfd_LDADD = $(LDADD) @@ -652,7 +652,7 @@ SOURCES = $(libdynlib1_la_SOURCES) $(libdynlib2_la_SOURCES) \ swmr_start_write.c swmr_writer.c tcheck_version.c test_swmr.c \ $(testhdf5_SOURCES) testmeta.c $(ttsafe_SOURCES) twriteorder.c \ unlink.c unregister.c $(use_append_chunk_SOURCES) \ - $(use_append_mchunks_SOURCES) $(use_cork_SOURCES) vfd.c + $(use_append_mchunks_SOURCES) use_disable_mdc_flushes.c vfd.c DIST_SOURCES = $(am__libdynlib1_la_SOURCES_DIST) \ $(am__libdynlib2_la_SOURCES_DIST) \ $(am__libdynlib3_la_SOURCES_DIST) $(libh5test_la_SOURCES) \ @@ -677,7 +677,7 @@ DIST_SOURCES = $(am__libdynlib1_la_SOURCES_DIST) \ swmr_start_write.c swmr_writer.c tcheck_version.c test_swmr.c \ $(testhdf5_SOURCES) testmeta.c $(ttsafe_SOURCES) twriteorder.c \ unlink.c unregister.c $(use_append_chunk_SOURCES) \ - $(use_append_mchunks_SOURCES) $(use_cork_SOURCES) vfd.c + $(use_append_mchunks_SOURCES) use_disable_mdc_flushes.c vfd.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -1003,8 +1003,8 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog accum.h5 cmpd_dset.h5 \ split_get_file_image_test-m.h5 split_get_file_image_test-r.h5 \ file_image_core_test.h5.copy unregister_filter_1.h5 \ unregister_filter_2.h5 swmr_data.h5 use_use_append_chunk.h5 \ - use_append_mchunks.h5 use_cork.h5 flushrefresh.h5 \ - flushrefresh_VERIFICATION_START \ + use_append_mchunks.h5 use_disable_mdc_flushes.h5 \ + flushrefresh.h5 flushrefresh_VERIFICATION_START \ flushrefresh_VERIFICATION_CHECKPOINT1 \ flushrefresh_VERIFICATION_CHECKPOINT2 \ flushrefresh_VERIFICATION_DONE atomic_data accum_swmr_big.h5 \ @@ -1017,7 +1017,7 @@ INCLUDES = -I$(top_srcdir)/src -I$(top_builddir)/src # testcheck_version.sh: tcheck_version # tetlinks_env.sh: links_env # testflushrefresh.sh: flushrefresh -# test_usecases.sh: use_append_chunk, use_append_mchunks, use_cork +# test_usecases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes # testswmr.sh: swmr* TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh \ testlinks_env.sh testflushrefresh.sh test_usecases.sh \ @@ -1025,11 +1025,12 @@ TEST_SCRIPT = testerror.sh testlibinfo.sh testcheck_version.sh \ SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) \ links_env$(EXEEXT) flushrefresh$(EXEEXT) \ use_append_chunk$(EXEEXT) use_append_mchunks$(EXEEXT) \ - use_cork$(EXEEXT) swmr_generator$(EXEEXT) swmr_reader$(EXEEXT) \ - swmr_writer$(EXEEXT) swmr_remove_reader$(EXEEXT) \ - swmr_remove_writer$(EXEEXT) swmr_addrem_writer$(EXEEXT) \ - swmr_sparse_reader$(EXEEXT) swmr_sparse_writer$(EXEEXT) \ - swmr_start_write$(EXEEXT) $(am__append_2) + use_disable_mdc_flushes$(EXEEXT) swmr_generator$(EXEEXT) \ + swmr_reader$(EXEEXT) swmr_writer$(EXEEXT) \ + swmr_remove_reader$(EXEEXT) swmr_remove_writer$(EXEEXT) \ + swmr_addrem_writer$(EXEEXT) swmr_sparse_reader$(EXEEXT) \ + swmr_sparse_writer$(EXEEXT) swmr_start_write$(EXEEXT) \ + $(am__append_2) check_SCRIPTS = $(TEST_SCRIPT) # These are our main targets. They should be listed in the order to be @@ -1087,7 +1088,7 @@ testhdf5_SOURCES = testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ # Sources for Use Cases use_append_chunk_SOURCES = use_append_chunk.c use_common.c use_append_mchunks_SOURCES = use_append_mchunks.c use_common.c -use_cork_SOURCES = use_cork.c +use_cork_SOURCES = use_disable_mdc_flushes.c # Temporary files. DISTCLEANFILES = testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_plugin.sh \ @@ -1563,9 +1564,9 @@ use_append_chunk$(EXEEXT): $(use_append_chunk_OBJECTS) $(use_append_chunk_DEPEND use_append_mchunks$(EXEEXT): $(use_append_mchunks_OBJECTS) $(use_append_mchunks_DEPENDENCIES) $(EXTRA_use_append_mchunks_DEPENDENCIES) @rm -f use_append_mchunks$(EXEEXT) $(AM_V_CCLD)$(LINK) $(use_append_mchunks_OBJECTS) $(use_append_mchunks_LDADD) $(LIBS) -use_cork$(EXEEXT): $(use_cork_OBJECTS) $(use_cork_DEPENDENCIES) $(EXTRA_use_cork_DEPENDENCIES) - @rm -f use_cork$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(use_cork_OBJECTS) $(use_cork_LDADD) $(LIBS) +use_disable_mdc_flushes$(EXEEXT): $(use_disable_mdc_flushes_OBJECTS) $(use_disable_mdc_flushes_DEPENDENCIES) $(EXTRA_use_disable_mdc_flushes_DEPENDENCIES) + @rm -f use_disable_mdc_flushes$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(use_disable_mdc_flushes_OBJECTS) $(use_disable_mdc_flushes_LDADD) $(LIBS) vfd$(EXEEXT): $(vfd_OBJECTS) $(vfd_DEPENDENCIES) $(EXTRA_vfd_DEPENDENCIES) @rm -f vfd$(EXEEXT) $(AM_V_CCLD)$(LINK) $(vfd_OBJECTS) $(vfd_LDADD) $(LIBS) @@ -1706,7 +1707,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/use_append_chunk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/use_append_mchunks.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/use_common.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/use_cork.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/use_disable_mdc_flushes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfd.Po@am__quote@ .c.o: diff --git a/test/cache.c b/test/cache.c index e08fcb5..cb83801 100644 --- a/test/cache.c +++ b/test/cache.c @@ -18005,6 +18005,9 @@ check_check_evictions_enabled_err(void) * Added a basic set of tests for the flash cache size * increment code. * + * Vailin Choi; Feb 2014 + * Add the parameter to indicate "corking" the entry or not. + * Suggest to do more thorough testing on this. *------------------------------------------------------------------------- */ @@ -34180,20 +34183,18 @@ done: /*------------------------------------------------------------------------- * Function: check_metadata_cork - * This is a modification of the test: check_metadata_blizzard_absence() - * NEED: more work on testing different scenarios & more comments * - * Purpose: To verify that corked/uncorked entries are/are not in the cache. + * Purpose: To verify that dirty corked entries are not evicted from the cache + * but clean corked entries can be evicted from the cache. + * The min_clean_size does not have effect. + * NOTE: This is a modification of check_metadata_blizzard_absence(). * * Return: void * * Programmer: Vailin Choi * - * Modifications: - * *------------------------------------------------------------------------- */ - static unsigned check_metadata_cork(hbool_t fill_via_insertion) { @@ -34377,11 +34378,11 @@ check_metadata_cork(hbool_t fill_via_insertion) if (fill_via_insertion) { - TESTING("to ensure cork metadata when inserting"); + TESTING("to ensure cork/uncork metadata when inserting"); } else { - TESTING("to ensure cork metadata on protect/unprotect"); + TESTING("to ensure cork/uncork metadata on protect/unprotect"); } if ( show_progress) /* 0 */ @@ -34420,9 +34421,9 @@ check_metadata_cork(hbool_t fill_via_insertion) * Phase 1: * * Inserting dirty corked entries into an empty cache, until the cache - * violates the min_clean_size requirement. The expected result is - * that none of the inserted entries during this phase will get - * flushed or evicted. + * violates the min_clean_size requirement. + * Since entries are all dirty and corked, no entry will get flushed or + * evicted. * * ======================================================================== * ======================================================================== @@ -34474,8 +34475,9 @@ check_metadata_cork(hbool_t fill_via_insertion) * Phase 2: * * Inserting entries into a cache that violates the min_clean_size, - * until the cache is full. The expected result is that none of the - * dirty corked entries are flushed. + * until the cache is full. + * Since entries are all dirty and corked, no entry during this phase + * will get flushed or evicted. * * ======================================================================== * ======================================================================== @@ -34590,14 +34592,14 @@ check_metadata_cork(hbool_t fill_via_insertion) } /* - * Expected status is that all entries are dirty corked entries. + * Expected status: all entries are dirty corked entries. */ expected[entry_idx].in_cache = TRUE; expected[entry_idx].is_dirty = TRUE; expected[entry_idx].loaded = (unsigned char)loaded; expected[entry_idx].is_corked = TRUE; - /* verify the status */ + /* Verify the status */ verify_entry_status(cache_ptr, /* H5C_t * cache_ptr */ entry_idx, /* int tag */ 150, /* int num_entries */ @@ -34619,8 +34621,8 @@ check_metadata_cork(hbool_t fill_via_insertion) /* ======================================================================== * ======================================================================== * Phase 3: - * * Inserting entries into a cache that is completely full. + * No entry is flushed or evicted because all entries are dirty & corked. * * ======================================================================== * ======================================================================== @@ -34651,7 +34653,7 @@ check_metadata_cork(hbool_t fill_via_insertion) H5C__DIRTIED_FLAG); /* unsigned int flags */ } - /* This past inserted entry is now in the cache and dirty */ + /* This past inserted entry is now in the cache: dirty and corked */ expected[entry_idx].in_cache = TRUE; expected[entry_idx].is_dirty = TRUE; expected[entry_idx].loaded = (unsigned char)loaded; @@ -34763,8 +34765,8 @@ check_metadata_cork(hbool_t fill_via_insertion) if ( pass ) { - /* Insert 25 entries (indexes 101 through 125) into the cache. */ - /* Insert 25 more "corked" entries, clean entry will be evicted one a time */ + /* Insert 25 more corked entries (indexes 101 through 125) into the cache. */ + /* Clean entry will be evicted one a time */ for (entry_idx = 101; entry_idx < 126; entry_idx++) { if (fill_via_insertion) { @@ -34873,12 +34875,13 @@ check_metadata_cork(hbool_t fill_via_insertion) H5C__DIRTIED_FLAG); /* unsigned int flags */ } - /* This past inserted entry is now in the cache and dirty */ + /* This past inserted entry is now in the cache, dirty and corked */ expected[entry_idx].in_cache = TRUE; expected[entry_idx].is_dirty = TRUE; expected[entry_idx].loaded = (unsigned char)loaded; expected[entry_idx].is_corked = TRUE; + /* Entry that is 50 entries away will be evicted since it is clean even though corked */ expected[entry_idx - 50].in_cache = FALSE; expected[entry_idx - 50].destroyed = TRUE; expected[entry_idx - 50].is_corked = TRUE; diff --git a/test/cache_common.c b/test/cache_common.c index a801286..65fe8c1 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -3123,6 +3123,7 @@ insert_entry(H5F_t * file_ptr, entry_ptr->is_dirty = TRUE; /* Set the base address of the entry type into the property list as tag */ + /* Use to cork entries for the object */ if(H5AC_tag(xfer, baddrs, NULL) < 0) { pass = FALSE; failure_mssg = "error in H5P_set()."; @@ -3404,6 +3405,7 @@ protect_entry(H5F_t * file_ptr, HDassert( !(entry_ptr->is_protected) ); /* Set the base address of the entry type into the property list as tag */ + /* Use to cork entries for the object */ if(H5AC_tag(xfer, baddrs, NULL) < 0) { pass = FALSE; failure_mssg = "error in H5P_set()."; diff --git a/test/cork.c b/test/cork.c index bb2b7fb..e224ac2 100644 --- a/test/cork.c +++ b/test/cork.c @@ -14,7 +14,10 @@ /* Programmer: Vailin Choi * Feb 20, 2014 * - * This file contains tests for H5Ocork/H5Ouncork/H5Ois_corked. + * This file contains tests for: + * H5Odisable_mdc_flushes() + * H5Oenable_mdc_flushes() + * H5Oare_mdc_flushes_disabled() */ #include "hdf5.h" #include "testhdf5.h" @@ -357,7 +360,7 @@ verify_old_dset_cork(void) if(H5Oget_info(did, &oinfo) < 0 ) TEST_ERROR; /* Cork the dataset: DSET_BT1 */ - if(H5Ocork(did) < 0 ) TEST_ERROR; + if(H5Odisable_mdc_flushes(did) < 0 ) TEST_ERROR; /* Verify cork status */ if(verify_cork_tag(fid, oinfo.addr, TRUE) < 0 ) @@ -394,7 +397,7 @@ verify_old_dset_cork(void) if(H5Oget_info(did2, &oinfo2) < 0 ) TEST_ERROR; /* Cork the dataset: DSET_COMPACT */ - if(H5Ocork(did2) < 0 ) TEST_ERROR; + if(H5Odisable_mdc_flushes(did2) < 0 ) TEST_ERROR; /* Verify cork status */ if(verify_cork_tag(fid, oinfo2.addr, TRUE) < 0 ) @@ -438,7 +441,7 @@ verify_old_dset_cork(void) if(H5Oget_info(did3, &oinfo3) < 0 ) TEST_ERROR; /* Cork the dataset: DSET_CONTIG */ - if(H5Ocork(did3) < 0 ) TEST_ERROR; + if(H5Odisable_mdc_flushes(did3) < 0 ) TEST_ERROR; /* Verify the cork status for DSET_CONTIG */ if(verify_cork_tag(fid, oinfo3.addr, TRUE) < 0 ) @@ -449,7 +452,7 @@ verify_old_dset_cork(void) TEST_ERROR; /* Un-cork the dataset: DSET_CONTIG */ - if(H5Ouncork(did3) < 0 ) TEST_ERROR; + if(H5Oenable_mdc_flushes(did3) < 0 ) TEST_ERROR; /* Verify the cork status for DSET_CONTIG */ if(verify_cork_tag(fid, oinfo3.addr, FALSE) < 0 ) @@ -548,7 +551,7 @@ verify_obj_dset_cork(hbool_t swmr) if(H5Oget_info(did, &oinfo) < 0 ) TEST_ERROR; /* Cork the dataset: DSET */ - if(H5Ocork(did) < 0 ) TEST_ERROR; + if(H5Odisable_mdc_flushes(did) < 0 ) TEST_ERROR; /* Attach and write to an attribute to the dataset: DSET */ if((aid = H5Acreate2(did, ATTR, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -583,7 +586,7 @@ verify_obj_dset_cork(hbool_t swmr) if(H5Oget_info(did2, &oinfo2) < 0 ) TEST_ERROR; /* Cork the dataset: DSET_NONE */ - if(H5Ocork(did2) < 0 ) TEST_ERROR; + if(H5Odisable_mdc_flushes(did2) < 0 ) TEST_ERROR; /* Attach 8 attributes to the dataset */ for(i = 0;i < 8; i++) { @@ -627,7 +630,7 @@ verify_obj_dset_cork(hbool_t swmr) TEST_ERROR; /* Cork the dataset: DSET_NONE */ - if(H5Ocork(oid) < 0) TEST_ERROR + if(H5Odisable_mdc_flushes(oid) < 0) TEST_ERROR /* Verify cork status of the dataset: DSET_NONE */ if(verify_cork_tag(fid, oinfo2.addr, TRUE) < 0 ) @@ -733,7 +736,7 @@ verify_dset_cork(hbool_t swmr) if(H5Oget_info(did, &oinfo) < 0 ) TEST_ERROR; /* Cork the dataset: DSET_EA */ - if(H5Ocork(did) < 0 ) TEST_ERROR; + if(H5Odisable_mdc_flushes(did) < 0 ) TEST_ERROR; /* Verify cork status */ if(verify_cork_tag(fid, oinfo.addr, TRUE) < 0 ) @@ -750,10 +753,10 @@ verify_dset_cork(hbool_t swmr) TEST_ERROR; /* Cork the dataset: DSET_FA */ - if(H5Ocork(did2) < 0 ) TEST_ERROR; + if(H5Odisable_mdc_flushes(did2) < 0 ) TEST_ERROR; /* Uncork the dataset: DSET_EA */ - if(H5Ouncork(did) < 0 ) TEST_ERROR; + if(H5Oenable_mdc_flushes(did) < 0 ) TEST_ERROR; /* Verify the cork status for DSET_FA */ if(verify_cork_tag(fid, oinfo2.addr, TRUE) < 0 ) @@ -775,7 +778,7 @@ verify_dset_cork(hbool_t swmr) TEST_ERROR; /* Cork the dataset: DSET_BT2 */ - if(H5Ocork(did3) < 0 ) TEST_ERROR; + if(H5Odisable_mdc_flushes(did3) < 0 ) TEST_ERROR; /* Verify the cork status for DSET_BT2 */ if(verify_cork_tag(fid, oinfo3.addr, TRUE) < 0 ) @@ -822,7 +825,7 @@ verify_dset_cork(hbool_t swmr) TEST_ERROR; /* Cork the dataset: DSET_FA */ - if(H5Ocork(did2) < 0 ) TEST_ERROR; + if(H5Odisable_mdc_flushes(did2) < 0 ) TEST_ERROR; /* Verify the cork status for DSET_FA */ if(verify_cork_tag(fid, oinfo2.addr, TRUE) < 0 ) @@ -838,7 +841,7 @@ verify_dset_cork(hbool_t swmr) TEST_ERROR; /* Cork the dataset: DSET_BT2 */ - if(H5Ocork(did3) < 0 ) TEST_ERROR; + if(H5Odisable_mdc_flushes(did3) < 0 ) TEST_ERROR; /* Verify the cork status for DSET_BT2 */ if(verify_cork_tag(fid, oinfo3.addr, TRUE) < 0 ) @@ -929,7 +932,7 @@ verify_group_cork(hbool_t swmr) TEST_ERROR; /* Cork the second group: GRP2 */ - if(H5Ocork(gid2) < 0) TEST_ERROR + if(H5Odisable_mdc_flushes(gid2) < 0) TEST_ERROR /* Get group object header addresses */ if(H5Oget_info(gid, &oinfo) < 0) TEST_ERROR; @@ -986,7 +989,7 @@ verify_group_cork(hbool_t swmr) TEST_ERROR; /* Cork the third group while attaching attributes */ if(i == 3) { - if(H5Ocork(gid3) < 0) TEST_ERROR + if(H5Odisable_mdc_flushes(gid3) < 0) TEST_ERROR if(verify_cork_tag(fid, oinfo3.addr, TRUE) < 0) TEST_ERROR; } @@ -1096,8 +1099,8 @@ verify_named_cork(hbool_t swmr) TEST_ERROR; /* Cork 2 named datatypes: /DT and /GRP/GRP2/DT3 */ - if(H5Ocork(tid) < 0) TEST_ERROR - if(H5Ocork(tid3) < 0) TEST_ERROR + if(H5Odisable_mdc_flushes(tid) < 0) TEST_ERROR + if(H5Odisable_mdc_flushes(tid3) < 0) TEST_ERROR /* Get named datatype object header addresses */ if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR; @@ -1162,7 +1165,7 @@ verify_named_cork(hbool_t swmr) FAIL_STACK_ERROR /* Cork the datatype: DT2 */ - if(H5Ocork(tid2) < 0) TEST_ERROR + if(H5Odisable_mdc_flushes(tid2) < 0) TEST_ERROR /* Create dataspace */ if((sid = H5Screate(H5S_SCALAR)) < 0 ) TEST_ERROR; @@ -1176,7 +1179,7 @@ verify_named_cork(hbool_t swmr) TEST_ERROR; /* Cork the datatype while attaching attributes */ if(i == 3) { - if(H5Ocork(tid3) < 0) TEST_ERROR + if(H5Odisable_mdc_flushes(tid3) < 0) TEST_ERROR if(verify_cork_tag(fid, oinfo3.addr, TRUE) < 0) TEST_ERROR; } @@ -1191,7 +1194,7 @@ verify_named_cork(hbool_t swmr) if(H5Oget_info(did, &oinfo4) < 0) TEST_ERROR; /* Cork the dataset: DSET */ - if(H5Ocork(did) < 0) TEST_ERROR + if(H5Odisable_mdc_flushes(did) < 0) TEST_ERROR /* Verify cork status of the datatype: DT */ if(verify_cork_tag(fid, oinfo.addr, FALSE) < 0) @@ -1204,13 +1207,13 @@ verify_named_cork(hbool_t swmr) TEST_ERROR; /* Un-cork the datatype: DT3 */ - if(H5Ouncork(tid3) < 0) TEST_ERROR + if(H5Oenable_mdc_flushes(tid3) < 0) TEST_ERROR /* Verify cork status of the datatype: DT3 */ if(verify_cork_tag(fid, oinfo3.addr, FALSE) < 0) TEST_ERROR; /* Cork the datatype: DT */ - if(H5Ocork(tid) < 0) TEST_ERROR + if(H5Odisable_mdc_flushes(tid) < 0) TEST_ERROR /* Verify cork status of the datatype: DT */ if(verify_cork_tag(fid, oinfo.addr, TRUE) < 0) @@ -1378,7 +1381,7 @@ verify_multiple_cork(hbool_t swmr) TEST_ERROR /* Cork the group: gid2 */ - if(H5Ocork(gid2) < 0) + if(H5Odisable_mdc_flushes(gid2) < 0) TEST_ERROR /* Verify cork status of the group: gid2 */ @@ -1387,7 +1390,7 @@ verify_multiple_cork(hbool_t swmr) TEST_ERROR /* Check cork status of the group: gid1 */ - if(H5Ois_corked(gid1, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(gid1, &corked) < 0) TEST_ERROR; if(!corked) TEST_ERROR @@ -1404,7 +1407,7 @@ verify_multiple_cork(hbool_t swmr) TEST_ERROR /* Cork the dataset: did1 */ - if(H5Ocork(did1) < 0) + if(H5Odisable_mdc_flushes(did1) < 0) TEST_ERROR /* Verify cork status of the dataset: did1 */ @@ -1413,7 +1416,7 @@ verify_multiple_cork(hbool_t swmr) TEST_ERROR /* Check cork status of the dataset: did2 */ - if(H5Ois_corked(did2, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(did2, &corked) < 0) TEST_ERROR; if(!corked) TEST_ERROR @@ -1430,7 +1433,7 @@ verify_multiple_cork(hbool_t swmr) TEST_ERROR /* Cork the datatype: tid2 */ - if(H5Ocork(tid2) < 0) + if(H5Odisable_mdc_flushes(tid2) < 0) TEST_ERROR /* Verify cork status of the datatype: tid2 */ @@ -1439,12 +1442,12 @@ verify_multiple_cork(hbool_t swmr) TEST_ERROR; /* Check cork status of the datatype: tid1 */ - if(H5Ois_corked(tid1, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(tid1, &corked) < 0) TEST_ERROR; if(!corked) TEST_ERROR /* Uncork the group: gid1 */ - if(H5Ouncork(gid1) < 0) + if(H5Oenable_mdc_flushes(gid1) < 0) TEST_ERROR /* Verify cork status of the group: gid1 */ @@ -1453,7 +1456,7 @@ verify_multiple_cork(hbool_t swmr) TEST_ERROR /* Check cork status of the group: gid2 */ - if(H5Ois_corked(gid2, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(gid2, &corked) < 0) TEST_ERROR; if(corked) TEST_ERROR @@ -1461,7 +1464,7 @@ verify_multiple_cork(hbool_t swmr) if(H5Gclose(gid2) < 0) TEST_ERROR /* Check cork status of the group: gid1 */ - if(H5Ois_corked(gid1, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(gid1, &corked) < 0) TEST_ERROR; if(corked) TEST_ERROR @@ -1473,7 +1476,7 @@ verify_multiple_cork(hbool_t swmr) if(H5Gclose(gid1) < 0) TEST_ERROR /* Uncork the dataset: gid2 */ - if(H5Ouncork(did2) < 0) + if(H5Oenable_mdc_flushes(did2) < 0) TEST_ERROR /* Verify cork status of the dataset: did2 */ @@ -1482,7 +1485,7 @@ verify_multiple_cork(hbool_t swmr) TEST_ERROR /* Check cork status of the dataset: did1 */ - if(H5Ois_corked(did1, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(did1, &corked) < 0) TEST_ERROR; if(corked) TEST_ERROR @@ -1490,7 +1493,7 @@ verify_multiple_cork(hbool_t swmr) if(H5Dclose(did2) < 0) TEST_ERROR /* Check cork status of the dataset: did1 */ - if(H5Ois_corked(did1, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(did1, &corked) < 0) TEST_ERROR; if(corked) TEST_ERROR @@ -1502,7 +1505,7 @@ verify_multiple_cork(hbool_t swmr) if(H5Dclose(did1) < 0) TEST_ERROR /* Check cork status of the datatype: tid1 */ - if(H5Ois_corked(tid1, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(tid1, &corked) < 0) TEST_ERROR; if(!corked) TEST_ERROR @@ -1510,7 +1513,7 @@ verify_multiple_cork(hbool_t swmr) if(H5Tclose(tid1) < 0) TEST_ERROR /* Check cork status of the datatype: tid2 */ - if(H5Ois_corked(tid2, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(tid2, &corked) < 0) TEST_ERROR; if(!corked) TEST_ERROR @@ -1519,21 +1522,21 @@ verify_multiple_cork(hbool_t swmr) /* Should fail to cork the attribute: aidg2; not an object */ H5E_BEGIN_TRY { - ret = H5Ocork(aidg2); + ret = H5Odisable_mdc_flushes(aidg2); } H5E_END_TRY; if(ret >= 0) TEST_ERROR /* Should fail to uncork the attribute: aidd1; not an object */ H5E_BEGIN_TRY { - ret = H5Ocork(aidd1); + ret = H5Odisable_mdc_flushes(aidd1); } H5E_END_TRY; if(ret >= 0) TEST_ERROR /* Should fail to check cork status of the attribute: aidt2; not an object */ H5E_BEGIN_TRY { - ret = H5Ois_corked(aidt2, &corked); + ret = H5Oare_mdc_flushes_disabled(aidt2, &corked); } H5E_END_TRY; if(ret >= 0) TEST_ERROR @@ -1548,15 +1551,15 @@ verify_multiple_cork(hbool_t swmr) /* Should fail to cork the file: fid1; not an object */ H5E_BEGIN_TRY { - ret = H5Ois_corked(fid1, &corked); - ret = H5Ocork(fid1); + ret = H5Oare_mdc_flushes_disabled(fid1, &corked); + ret = H5Odisable_mdc_flushes(fid1); } H5E_END_TRY; if(ret >= 0) TEST_ERROR /* Should fail to uncork the file: fid2; not an object */ H5E_BEGIN_TRY { - ret = H5Ouncork(fid2); + ret = H5Oenable_mdc_flushes(fid2); } H5E_END_TRY; if(ret >= 0) TEST_ERROR @@ -1593,7 +1596,7 @@ error: /*------------------------------------------------------------------------- * Function: test_objs_cork * - * Purpose: This function verifies H5Ocork/H5Ouncork/H5Ois_corked public + * Purpose: This function verifies H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled public * routines are working as specified. * * Return: 0 on Success, 1 on Failure @@ -1616,9 +1619,9 @@ test_objs_cork(hbool_t newformat) /* Testing Macro */ if(newformat) { - TESTING("H5Ocork/H5Ouncork/H5Ois_corked (new library format)"); + TESTING("H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled (new library format)"); } else { - TESTING("H5Ocork/H5Ouncork/H5Ois_corked (old library format)"); + TESTING("H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled (old library format)"); } /* Create fapl */ @@ -1640,16 +1643,16 @@ test_objs_cork(hbool_t newformat) TEST_ERROR /* Check cork status of the group: not corked */ - if(H5Ois_corked(gid, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(gid, &corked) < 0) TEST_ERROR if(corked) TEST_ERROR /* Cork the group: an object */ - if(H5Ocork(gid) < 0) + if(H5Odisable_mdc_flushes(gid) < 0) TEST_ERROR /* Check cork status of the group: corked */ - if(H5Ois_corked(gid, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(gid, &corked) < 0) TEST_ERROR if(!corked) TEST_ERROR @@ -1663,7 +1666,7 @@ test_objs_cork(hbool_t newformat) /* Should fail to cork the datatype: not an object */ H5E_BEGIN_TRY { - ret = H5Ocork(tid); + ret = H5Odisable_mdc_flushes(tid); } H5E_END_TRY; if(ret >= 0) TEST_ERROR @@ -1673,16 +1676,16 @@ test_objs_cork(hbool_t newformat) TEST_ERROR /* Check cork status of the named datatype: not corked */ - if(H5Ois_corked(tid, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(tid, &corked) < 0) TEST_ERROR if(corked) TEST_ERROR /* Cork the named datatype: an object */ - if(H5Ocork(tid) < 0) + if(H5Odisable_mdc_flushes(tid) < 0) TEST_ERROR /* Check cork status of the named datatype: corked */ - if(H5Ois_corked(tid, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(tid, &corked) < 0) TEST_ERROR if(!corked) TEST_ERROR @@ -1698,7 +1701,7 @@ test_objs_cork(hbool_t newformat) /* Should fail to uncork the dataspace: not an object */ H5E_BEGIN_TRY { - ret = H5Ouncork(sid); + ret = H5Oenable_mdc_flushes(sid); } H5E_END_TRY; if(ret >= 0) TEST_ERROR @@ -1713,22 +1716,22 @@ test_objs_cork(hbool_t newformat) /* Should fail to check cork status of the attribute: not an object */ H5E_BEGIN_TRY { - ret = H5Ois_corked(aid, &corked); + ret = H5Oare_mdc_flushes_disabled(aid, &corked); } H5E_END_TRY; if(ret >= 0) TEST_ERROR /* Check cork status of the dataset: not corked */ - if(H5Ois_corked(did, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(did, &corked) < 0) TEST_ERROR if(corked) TEST_ERROR /* Cork the dataset: an object */ - if(H5Ocork(did) < 0) + if(H5Odisable_mdc_flushes(did) < 0) TEST_ERROR /* Check cork status of the dataset: corked */ - if(H5Ois_corked(did, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(did, &corked) < 0) TEST_ERROR if(!corked) TEST_ERROR @@ -1741,23 +1744,23 @@ test_objs_cork(hbool_t newformat) TEST_ERROR /* Check cork status of the group */ - if(H5Ois_corked(gid, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(gid, &corked) < 0) TEST_ERROR if(corked) TEST_ERROR /* Cork the group */ - if(H5Ocork(gid) < 0) + if(H5Odisable_mdc_flushes(gid) < 0) TEST_ERROR /* Should fail to cork the group again */ H5E_BEGIN_TRY { - ret = H5Ocork(gid); + ret = H5Odisable_mdc_flushes(gid); } H5E_END_TRY; if(ret >= 0) TEST_ERROR /* Check cork status of the group */ - if(H5Ois_corked(gid, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(gid, &corked) < 0) TEST_ERROR if(!corked) TEST_ERROR @@ -1766,23 +1769,23 @@ test_objs_cork(hbool_t newformat) TEST_ERROR /* Check cork status of the named datatype */ - if(H5Ois_corked(tid, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(tid, &corked) < 0) TEST_ERROR if(corked) TEST_ERROR /* Should fail to un-cork the named datatype that is not corked yet */ H5E_BEGIN_TRY { - ret = H5Ouncork(tid); + ret = H5Oenable_mdc_flushes(tid); } H5E_END_TRY; if(ret >= 0) TEST_ERROR /* Cork the named datatype */ - if(H5Ocork(tid) < 0) + if(H5Odisable_mdc_flushes(tid) < 0) TEST_ERROR /* Check cork status of the named datatype */ - if(H5Ois_corked(tid, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(tid, &corked) < 0) TEST_ERROR if(!corked) TEST_ERROR @@ -1791,25 +1794,25 @@ test_objs_cork(hbool_t newformat) TEST_ERROR /* Check cork status of the dataset */ - if(H5Ois_corked(did, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(did, &corked) < 0) TEST_ERROR if(corked) TEST_ERROR /* Cork the dataset */ - if(H5Ocork(did) < 0) + if(H5Odisable_mdc_flushes(did) < 0) TEST_ERROR /* Check cork status of dataset */ - if(H5Ois_corked(did, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(did, &corked) < 0) TEST_ERROR if(!corked) TEST_ERROR /* Un-cork the dataset */ - if(H5Ouncork(did) < 0) + if(H5Oenable_mdc_flushes(did) < 0) TEST_ERROR /* Check cork status of the dataset */ - if(H5Ois_corked(did, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(did, &corked) < 0) TEST_ERROR if(corked) TEST_ERROR @@ -1843,7 +1846,7 @@ error: /*------------------------------------------------------------------------- * Function: test_dset_cork * - * Purpose: This function verifies H5Ocork/H5Ouncork/H5Ois_corked are + * Purpose: This function verifies H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled are * working as specified when manipulating datasets. * * Return: 0 on Success, 1 on Failure @@ -1874,9 +1877,9 @@ test_dset_cork(hbool_t newformat) /* Testing Macro */ if(newformat) { - TESTING("H5Ocork/H5Ouncork/H5Ois_corked (new library format)"); + TESTING("H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled (new library format)"); } else { - TESTING("H5Ocork/H5Ouncork/H5Ois_corked (old library format)"); + TESTING("H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled (old library format)"); } /* Create fapl */ @@ -1904,7 +1907,7 @@ test_dset_cork(hbool_t newformat) TEST_ERROR /* Cork the named datatype */ - if(H5Ocork(tid1) < 0) + if(H5Odisable_mdc_flushes(tid1) < 0) TEST_ERROR /* Set up dataset creation property list */ @@ -1930,21 +1933,21 @@ test_dset_cork(hbool_t newformat) TEST_ERROR /* Check cork status of the named datatype */ - if(H5Ois_corked(tid1, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(tid1, &corked) < 0) TEST_ERROR if(!corked) TEST_ERROR /* Cork the dataset */ - if(H5Ocork(did1) < 0) + if(H5Odisable_mdc_flushes(did1) < 0) TEST_ERROR /* Check cork status of the dataset */ - if(H5Ois_corked(did1, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(did1, &corked) < 0) TEST_ERROR if(!corked) TEST_ERROR /* Check cork status of the group */ - if(H5Ois_corked(gid, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(gid, &corked) < 0) TEST_ERROR if(corked) TEST_ERROR @@ -1962,12 +1965,12 @@ test_dset_cork(hbool_t newformat) TEST_ERROR /* Check cork status of the dataset */ - if(H5Ois_corked(did1, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(did1, &corked) < 0) TEST_ERROR if(!corked) TEST_ERROR /* Check cork status of the named datatype */ - if(H5Ois_corked(tid1, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(tid1, &corked) < 0) TEST_ERROR if(!corked) TEST_ERROR @@ -1980,7 +1983,7 @@ test_dset_cork(hbool_t newformat) TEST_ERROR /* Check cork status of dataset */ - if(H5Ois_corked(did1, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(did1, &corked) < 0) TEST_ERROR if(corked) TEST_ERROR @@ -1989,7 +1992,7 @@ test_dset_cork(hbool_t newformat) TEST_ERROR /* Cork the dataset */ - if(H5Ocork(did1) < 0) + if(H5Odisable_mdc_flushes(did1) < 0) TEST_ERROR /* Delete the dataset */ @@ -1997,7 +2000,7 @@ test_dset_cork(hbool_t newformat) TEST_ERROR /* Check cork status of the dataset */ - if(H5Ois_corked(did1, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(did1, &corked) < 0) TEST_ERROR if(!corked) TEST_ERROR @@ -2009,7 +2012,7 @@ test_dset_cork(hbool_t newformat) TEST_ERROR /* Cork the dataset */ - if(H5Ocork(did1) < 0) + if(H5Odisable_mdc_flushes(did1) < 0) TEST_ERROR /* Write to the dataset */ @@ -2021,7 +2024,7 @@ test_dset_cork(hbool_t newformat) TEST_ERROR /* Check cork status of the dataset */ - if(H5Ois_corked(did1, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(did1, &corked) < 0) TEST_ERROR if(!corked) TEST_ERROR @@ -2037,16 +2040,16 @@ test_dset_cork(hbool_t newformat) TEST_ERROR /* Cork the first opened dataset */ - if(H5Ocork(did1) < 0) + if(H5Odisable_mdc_flushes(did1) < 0) TEST_ERROR /* Check cork status of the first opened dataset */ - if(H5Ois_corked(did1, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(did1, &corked) < 0) TEST_ERROR if(!corked) TEST_ERROR /* Check cork status of the second opened dataset */ - if(H5Ois_corked(did2, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(did2, &corked) < 0) TEST_ERROR if(!corked) TEST_ERROR @@ -2054,7 +2057,7 @@ test_dset_cork(hbool_t newformat) if(H5Dclose(did2) < 0) TEST_ERROR /* Check cork status of the first opened dataset */ - if(H5Ois_corked(did1, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(did1, &corked) < 0) TEST_ERROR if(!corked) TEST_ERROR @@ -2062,7 +2065,7 @@ test_dset_cork(hbool_t newformat) if(H5Dclose(did1) < 0) TEST_ERROR /* Check cork status of the named datatype */ - if(H5Ois_corked(tid1, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(tid1, &corked) < 0) TEST_ERROR if(!corked) TEST_ERROR @@ -2071,21 +2074,21 @@ test_dset_cork(hbool_t newformat) TEST_ERROR /* Check cork status of the second opened named datatype */ - if(H5Ois_corked(tid2, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(tid2, &corked) < 0) TEST_ERROR if(!corked) TEST_ERROR /* Uncork the second opened named datatype */ - if(H5Ouncork(tid2) < 0) + if(H5Oenable_mdc_flushes(tid2) < 0) TEST_ERROR /* Check cork status of the second opened named datatype */ - if(H5Ois_corked(tid2, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(tid2, &corked) < 0) TEST_ERROR if(corked) TEST_ERROR /* Check cork status of the first opened named datatype */ - if(H5Ois_corked(tid1, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(tid1, &corked) < 0) TEST_ERROR if(corked) TEST_ERROR @@ -2096,7 +2099,7 @@ test_dset_cork(hbool_t newformat) if(H5Tclose(tid2) < 0) TEST_ERROR /* Check cork status of the group */ - if(H5Ois_corked(gid, &corked) < 0) + if(H5Oare_mdc_flushes_disabled(gid, &corked) < 0) TEST_ERROR if(corked) TEST_ERROR diff --git a/test/test_usecases.sh.in b/test/test_usecases.sh.in index 61a3a21..dcd7f82 100644 --- a/test/test_usecases.sh.in +++ b/test/test_usecases.sh.in @@ -98,8 +98,8 @@ TOOLTEST() { fi } -# run tests for H5Ocork/H5Ouncork/H5Oiscork here temporary -USECORK=use_cork +# run tests for H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled here temporary +USECORK=use_disable_mdc_flushes for p in $USECORK; do TOOLTEST $p TOOLTEST $p -y 3 diff --git a/test/use_cork.c b/test/use_disable_mdc_flushes.c index 32f9ebc..2e04bcf 100644 --- a/test/use_cork.c +++ b/test/use_disable_mdc_flushes.c @@ -14,7 +14,7 @@ /* * This is copied from use_append_chunk.c with modifications to show - * the usage of H5Ocork/H5Ouncork/H5Ois_corked public routines. + * the usage of H5Odisable_mdc_flushes/H5Oenable_mdc_flushes/H5Oare_mdc_flushes_disabled public routines. */ #include "h5test.h" @@ -24,7 +24,7 @@ #include "H5Dpkg.h" /* Global Variable definitions */ -const char *progname_g="use_cork"; /* program name */ +const char *progname_g="use_disable_mdc_flushes"; /* program name */ /* these two definitions must match each other */ #define UC_DATATYPE H5T_NATIVE_SHORT /* use case HDF5 data type */ @@ -52,10 +52,10 @@ static int setup_parameters(int argc, char * const argv[]); /* * Note: Long options are not yet implemented. * - * usage: use_cork [OPTIONS] + * usage: use_disable_mdc_flushes [OPTIONS] * OPTIONS * -h, --help Print a usage message and exit - * -f FN Test file name [default: use_cork.h5] + * -f FN Test file name [default: use_disable_mdc_flushes.h5] * -n N, --nplanes=N Number of planes to write. [default: 1000] * -s N, --swmr=N Use SWMR mode (0: no, non-0: yes) default is yes * -z N, --chunksize=N Chunk size [default: 256] @@ -288,21 +288,21 @@ create_file(void) static int write_file(void) { - hid_t fid; /* File ID for new HDF5 file */ - hid_t dsid; /* dataset ID */ - hid_t fapl; /* File access property list */ - hid_t dcpl; /* Dataset creation property list */ + hid_t fid; /* File ID for new HDF5 file */ + hid_t dsid; /* dataset ID */ + hid_t fapl; /* File access property list */ + hid_t dcpl; /* Dataset creation property list */ char *name; UC_CTYPE *buffer, *bufptr; /* data buffer */ hsize_t cz=chunksize_g; /* Chunk size */ - hid_t f_sid; /* dataset file space id */ - hid_t m_sid; /* memory space id */ - int rank; /* rank */ + hid_t f_sid; /* dataset file space id */ + hid_t m_sid; /* memory space id */ + int rank; /* rank */ hsize_t chunk_dims[3]; /* Chunk dimensions */ - hsize_t dims[3]; /* Dataspace dimensions */ - hsize_t memdims[3]; /* Memory space dimensions */ + hsize_t dims[3]; /* Dataspace dimensions */ + hsize_t memdims[3]; /* Memory space dimensions */ hsize_t start[3] = {0,0,0}, count[3]; /* Hyperslab selection values */ - hbool_t corked; /* Object's cork status */ + hbool_t disabled; /* Object's disabled status */ hsize_t i, j, k; name = filename_g; @@ -324,20 +324,20 @@ write_file(void) return -1; } - /* Cork the datset */ - if(H5Ocork(dsid) < 0) { - fprintf(stderr, "H5Ocork failed\n"); + /* Disabled mdc flushed for the dataset */ + if(H5Odisable_mdc_flushes(dsid) < 0) { + fprintf(stderr, "H5Odisable_mdc_flushes failed\n"); return -1; } - /* Get cork status of the dataset */ - if(H5Ois_corked(dsid, &corked) < 0) { - fprintf(stderr, "H5Ois_corked failed\n"); + /* Get mdc disabled status of the dataset */ + if(H5Oare_mdc_flushes_disabled(dsid, &disabled) < 0) { + fprintf(stderr, "H5Oare_mdc_flushes_disabled failed\n"); return -1; - } else if(corked) - printf("Dataset is corked.\n"); + } else if(disabled) + printf("Dataset has disabled mdc flushes.\n"); else - printf("Dataset should be corked.\n"); + printf("Dataset should have disabled its mdc flushes.\n"); /* Find chunksize used */ if ((dcpl = H5Dget_create_plist(dsid)) < 0){ @@ -451,11 +451,11 @@ write_file(void) return -1; } - /* Uncork the dataset */ - /* Closing the dataset later will uncork automatically if this is not done */ - if(corked) - if(H5Ouncork(dsid) < 0) { - fprintf(stderr, "Failed to H5Ouncork\n"); + /* Enable mdc flushes for the dataset */ + /* Closing the dataset later will enable mdc flushes automatically if this is not done */ + if(disabled) + if(H5Oenable_mdc_flushes(dsid) < 0) { + fprintf(stderr, "Failed to H5Oenable_mdc_flushes\n"); return -1; } @@ -506,7 +506,7 @@ main(int argc, char *argv[]) /* ============*/ /* Create file */ /* ============*/ - printf("Creating skeleton data file for testing H5Ocork()...\n"); + printf("Creating skeleton data file for testing H5Odisable_mdc_flushes()...\n"); if (create_file() < 0){ fprintf(stderr, "***encounter error\n"); Hgoto_error(1); |