diff options
author | Vailin Choi <vchoi@jam.ad.hdfgroup.org> | 2018-11-14 21:35:35 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@jam.ad.hdfgroup.org> | 2018-11-14 21:35:35 (GMT) |
commit | ce2748f0114cb1eae00799f8349a5451152c7fa3 (patch) | |
tree | fd3e39e6de7b37651a2c7047bd3ad128b5c4e204 /test/vfd_swmr_reader.c | |
parent | e62f4bd4fab00b0cd03e269a858c21558a9321fa (diff) | |
download | hdf5-ce2748f0114cb1eae00799f8349a5451152c7fa3.zip hdf5-ce2748f0114cb1eae00799f8349a5451152c7fa3.tar.gz hdf5-ce2748f0114cb1eae00799f8349a5451152c7fa3.tar.bz2 |
(A) Fixes for the assertion failures described in issue #2 (see John Mainzer's last checkin message):
--src/H5PB.c: checks for size >= page size
--src/H5MF.c: disable/enable page buffering in H5MF_tidy_self_referential_fsm_hack()
--src/H5MFsection.c: call H5PB_remove_entry() for both raw/metadata pages in H5MF__sect_small_merge()
(B) Port and modify existing concurrent swmr tests to VFD SWMR. Also modify the following:
--remove flushes from VFD SWMR writer tests
--set Nreaders to 0 in test/testvfdswmr.sh.in to test for writers only
Please enter the commit message for your changes. Lines starting
Diffstat (limited to 'test/vfd_swmr_reader.c')
-rw-r--r-- | test/vfd_swmr_reader.c | 66 |
1 files changed, 32 insertions, 34 deletions
diff --git a/test/vfd_swmr_reader.c b/test/vfd_swmr_reader.c index d074771..da7cb50 100644 --- a/test/vfd_swmr_reader.c +++ b/test/vfd_swmr_reader.c @@ -14,15 +14,13 @@ /*------------------------------------------------------------------------- * * Created: vfd_swmr_reader.c + * (copied and modified from swmr_reader.c) * * Purpose: Reads data from a randomly selected subset of the datasets - * in the SWMR test file. + * in the VFD SWMR test file. * * This program is intended to run concurrently with the - * swmr_writer program. - * - * This is copied from swmr_reader.c and modified for testing - * with VFD SWMR. + * vfd_swmr_writer program. * *------------------------------------------------------------------------- */ @@ -208,7 +206,7 @@ read_records(const char *filename, hbool_t verbose, FILE *verbose_file, symbol_t record; /* The record to read from the dataset */ unsigned v; /* Local index variable */ hbool_t use_log_vfd = FALSE; /* Use the log VFD (set this manually) */ -H5F_vfd_swmr_config_t *config = NULL; /* Configuration for VFD SWMR */ + H5F_vfd_swmr_config_t *config = NULL; /* Configuration for VFD SWMR */ HDassert(filename); HDassert(nseconds != 0); @@ -284,11 +282,33 @@ H5F_vfd_swmr_config_t *config = NULL; /* Configuration for VFD SWMR */ if(use_log_vfd) { char verbose_name[1024]; - HDsnprintf(verbose_name, sizeof(verbose_name), "swmr_reader.log.%u", random_seed); + HDsnprintf(verbose_name, sizeof(verbose_name), "vfd_swmr_reader.log.%u", random_seed); H5Pset_fapl_log(fapl, verbose_name, H5FD_LOG_ALL, (size_t)(512 * 1024 * 1024)); } /* end if */ + /* + * Set up to open the file with VFD SWMR configured. + */ + /* Enable page buffering */ + if(H5Pset_page_buffer_size(fapl, 4096, 0, 0) < 0) + return -1; + + /* Allocate memory for the configuration structure */ + if((config = (H5F_vfd_swmr_config_t *)HDmalloc(sizeof(H5F_vfd_swmr_config_t))) == NULL) + return -1; + + config->version = H5F__CURR_VFD_SWMR_CONFIG_VERSION; + config->tick_len = 4; + config->max_lag = 6; + config->vfd_swmr_writer = FALSE; + config->md_pages_reserved = 2; + HDstrcpy(config->md_file_path, "./my_md_file"); + + /* Enable VFD SWMR configuration */ + if(H5Pset_vfd_swmr_config(fapl, config) < 0) + return -1; + /* Loop over reading records until [at least] the correct # of seconds have passed */ while(curr_time < (time_t)(start_time + (time_t)nseconds)) { @@ -296,28 +316,6 @@ H5F_vfd_swmr_config_t *config = NULL; /* Configuration for VFD SWMR */ if(verbose) HDfprintf(verbose_file, "Opening file: %s\n", filename); - /* - * Set up to open the file with VFD SWMR configured. - */ - /* Enable page buffering */ - if(H5Pset_page_buffer_size(fapl, 4096, 0, 0) < 0) - return -1; - - /* Allocate memory for the configuration structure */ - if((config = (H5F_vfd_swmr_config_t *)HDmalloc(sizeof(H5F_vfd_swmr_config_t))) == NULL) - return -1; - - config->version = H5F__CURR_VFD_SWMR_CONFIG_VERSION; - config->tick_len = 4; - config->max_lag = 6; - config->vfd_swmr_writer = FALSE; - config->md_pages_reserved = 2; - HDstrcpy(config->md_file_path, "./my_md_file"); - - /* Enable VFD SWMR configuration */ - if(H5Pset_vfd_swmr_config(fapl, config) < 0) - return -1; - /* Open the file with VFD SWMR configured */ if((fid = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) return -1; @@ -375,6 +373,9 @@ H5F_vfd_swmr_config_t *config = NULL; /* Configuration for VFD SWMR */ if(H5Pclose(fapl) < 0) return -1; + if(config) + HDfree(config); + /* Emit informational message */ if(verbose) HDfprintf(verbose_file, "Closing datasets\n"); @@ -391,9 +392,6 @@ H5F_vfd_swmr_config_t *config = NULL; /* Configuration for VFD SWMR */ HDfree(sym_com); } /* end if */ - /* Free the config structure */ - if(config) - HDfree(config); return 0; } /* end read_records() */ @@ -403,7 +401,7 @@ usage(void) printf("\n"); printf("Usage error!\n"); printf("\n"); - printf("Usage: swmr_reader [-q] [-s <# of seconds to sleep between polling>]\n"); + printf("Usage: vfd_swmr_reader [-q] [-s <# of seconds to sleep between polling>]\n"); printf(" [-h <# of common symbols to poll>] [-l <# of random symbols to poll>]\n"); printf(" [-r <random seed>] <# of seconds to test>\n"); printf("\n"); @@ -511,7 +509,7 @@ int main(int argc, const char *argv[]) if(verbose) { char verbose_name[1024]; - HDsnprintf(verbose_name, sizeof(verbose_name), "swmr_reader.out.%u", random_seed); + HDsnprintf(verbose_name, sizeof(verbose_name), "vfd_swmr_reader.out.%u", random_seed); if(NULL == (verbose_file = HDfopen(verbose_name, "w"))) { HDfprintf(stderr, "Can't open verbose output file!\n"); HDexit(1); |