[svn-r27338] Bring revision #24747 from revise_chksum_retry branch to revise_chunks.
Plus couple fixes: 1) test/test_swmr.c: fix to use H5Dopen2() 2) test/noencoder.h5: clear status_flags in superblock
This commit is contained in:
2
MANIFEST
2
MANIFEST
@@ -1133,7 +1133,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
|
||||
|
||||
33
src/H5O.c
33
src/H5O.c
@@ -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() */
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@@ -1550,7 +1550,6 @@ done:
|
||||
herr_t
|
||||
H5O_close(H5O_loc_t *loc)
|
||||
{
|
||||
hbool_t corked;
|
||||
herr_t ret_value = SUCCEED; /* Return value */
|
||||
|
||||
FUNC_ENTER_NOAPI(FAIL)
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -29,12 +29,12 @@ AM_CPPFLAGS+=-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 \
|
||||
testswmr.sh testflushrefresh.sh test_usecases.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 \
|
||||
|
||||
@@ -112,7 +112,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) \
|
||||
@@ -120,7 +120,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) \
|
||||
@@ -616,10 +616,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)
|
||||
@@ -681,7 +681,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) \
|
||||
@@ -706,7 +706,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;; \
|
||||
@@ -1207,8 +1207,8 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 accum.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 \
|
||||
@@ -1220,7 +1220,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.clog2 accum.h5 \
|
||||
# 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 testswmr.sh testflushrefresh.sh \
|
||||
@@ -1228,11 +1228,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
|
||||
@@ -1291,7 +1292,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 \
|
||||
@@ -1872,9 +1873,9 @@ use_append_mchunks$(EXEEXT): $(use_append_mchunks_OBJECTS) $(use_append_mchunks_
|
||||
@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)
|
||||
@@ -2016,7 +2017,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:
|
||||
|
||||
43
test/cache.c
43
test/cache.c
@@ -17290,6 +17290,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.
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -33465,20 +33468,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)
|
||||
{
|
||||
@@ -33662,11 +33663,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 */
|
||||
@@ -33705,9 +33706,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.
|
||||
*
|
||||
* ========================================================================
|
||||
* ========================================================================
|
||||
@@ -33759,8 +33760,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.
|
||||
*
|
||||
* ========================================================================
|
||||
* ========================================================================
|
||||
@@ -33875,14 +33877,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 */
|
||||
@@ -33904,8 +33906,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.
|
||||
*
|
||||
* ========================================================================
|
||||
* ========================================================================
|
||||
@@ -33936,7 +33938,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;
|
||||
@@ -34048,8 +34050,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) {
|
||||
@@ -34158,12 +34160,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;
|
||||
|
||||
@@ -3056,6 +3056,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().";
|
||||
@@ -3332,6 +3333,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().";
|
||||
|
||||
195
test/cork.c
195
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
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1551,7 +1551,7 @@ test_start_swmr_write(hid_t in_fapl)
|
||||
FAIL_STACK_ERROR;
|
||||
|
||||
/* Open the first dataset */
|
||||
if((did1 = H5Dopen(fid, "dataset1", H5P_DEFAULT)) < 0)
|
||||
if((did1 = H5Dopen2(fid, "dataset1", H5P_DEFAULT)) < 0)
|
||||
FAIL_STACK_ERROR;
|
||||
|
||||
/* Create a group */
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
Reference in New Issue
Block a user