diff options
author | vchoi <vchoi@jelly.ad.hdfgroup.org> | 2021-02-02 22:01:35 (GMT) |
---|---|---|
committer | vchoi <vchoi@jelly.ad.hdfgroup.org> | 2021-02-02 22:01:35 (GMT) |
commit | d8e77f13be0b849fdadedf2fb4689eb2ce04aaeb (patch) | |
tree | cdc33e6b5dae4d920ab8ef7b5f8691a8d36a13a1 /test/vfd_swmr_remove_writer.c | |
parent | 592f8b738eb3fbab9805f2bf2ed9130539a6663b (diff) | |
download | hdf5-d8e77f13be0b849fdadedf2fb4689eb2ce04aaeb.zip hdf5-d8e77f13be0b849fdadedf2fb4689eb2ce04aaeb.tar.gz hdf5-d8e77f13be0b849fdadedf2fb4689eb2ce04aaeb.tar.bz2 |
(1) Add new routine to configure for VFD SWMR: init_vfd_swmr_config()
(2) Revise routine to setup fapl for VFD SWMR legacy and other integration tests: vfd_swmr_create_fapl()
(3) Update all VFD SWMR integration tests to use the above two routines
(4) Clean up VFD SWMR legacy tests: turn on compression in test script, remove #ifdef OUT H5Fflush(), message file name
Diffstat (limited to 'test/vfd_swmr_remove_writer.c')
-rw-r--r-- | test/vfd_swmr_remove_writer.c | 45 |
1 files changed, 10 insertions, 35 deletions
diff --git a/test/vfd_swmr_remove_writer.c b/test/vfd_swmr_remove_writer.c index ae64ff0..9ec5b98 100644 --- a/test/vfd_swmr_remove_writer.c +++ b/test/vfd_swmr_remove_writer.c @@ -34,6 +34,7 @@ #include "h5test.h" #include "vfd_swmr_common.h" +#include "swmr_common.h" /****************/ /* Local Macros */ @@ -83,35 +84,15 @@ open_skeleton(const char *filename, unsigned verbose, HDassert(filename); - /* Create file access property list */ - if((fapl = h5_fileaccess()) < 0) + /* Allocate memory for the configuration structure */ + if((config = (H5F_vfd_swmr_config_t *)HDcalloc(1, sizeof(H5F_vfd_swmr_config_t))) == NULL) goto error; - /* FOR NOW: set to use latest format, the "old" parameter is not used */ - if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto error; - - /* - * Set up to open the file with VFD SWMR configured. - */ - - /* Enable page buffering */ - if(H5Pset_page_buffer_size(fapl, 4096, 0, 0) < 0) - goto error; + /* config, tick_len, max_lag, writer, flush_raw_data, md_pages_reserved, md_file_path */ + init_vfd_swmr_config(config, 4, 5 , TRUE, FALSE, 128, "./rw-shadow"); - /* Allocate memory for the configuration structure */ - if((config = (H5F_vfd_swmr_config_t *)HDcalloc(1, sizeof(H5F_vfd_swmr_config_t))) == NULL) - goto error; - - config->version = H5F__CURR_VFD_SWMR_CONFIG_VERSION; - config->tick_len = 4; - config->max_lag = 5; - config->writer = TRUE; - config->md_pages_reserved = 128; - HDstrcpy(config->md_file_path, "./rw-shadow"); - - /* Enable VFD SWMR configuration */ - if(H5Pset_vfd_swmr_config(fapl, config) < 0) + /* use_latest_format, use_vfd_swmr, only_meta_page, config */ + if((fapl = vfd_swmr_create_fapl(TRUE, TRUE, FALSE, config)) < 0) goto error; /* Open the file */ @@ -224,12 +205,6 @@ remove_records(hid_t fid, unsigned verbose, unsigned long nshrinks, unsigned lon /* Check for counter being reached */ if(0 == shrink_to_flush) { -#ifdef TEMP_OUT - /* Flush contents of file */ - if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) - return -1; -#endif - /* Reset flush counter */ shrink_to_flush = flush_count; } /* end if */ @@ -376,17 +351,17 @@ int main(int argc, const char *argv[]) /* Emit informational message */ if(verbose) { HDfprintf(stderr, "WRITER: Opening skeleton file: %s\n", - COMMON_FILENAME); + VFD_SWMR_FILENAME); } /* Open file skeleton */ - if((fid = open_skeleton(COMMON_FILENAME, verbose, old)) < 0) { + if((fid = open_skeleton(VFD_SWMR_FILENAME, verbose, old)) < 0) { HDfprintf(stderr, "WRITER: Error opening skeleton file!\n"); HDexit(1); } /* end if */ /* Send a message to indicate "H5Fopen" is complete--releasing the file lock */ - h5_send_message(WRITER_MESSAGE, NULL, NULL); + h5_send_message(VFD_SWMR_WRITER_MESSAGE, NULL, NULL); /* Emit informational message */ if(verbose) |