summaryrefslogtreecommitdiffstats
path: root/test/vfd_swmr_sparse_reader.c
diff options
context:
space:
mode:
authorvchoi <vchoi@jelly.ad.hdfgroup.org>2021-02-02 22:01:35 (GMT)
committervchoi <vchoi@jelly.ad.hdfgroup.org>2021-02-02 22:01:35 (GMT)
commitd8e77f13be0b849fdadedf2fb4689eb2ce04aaeb (patch)
treecdc33e6b5dae4d920ab8ef7b5f8691a8d36a13a1 /test/vfd_swmr_sparse_reader.c
parent592f8b738eb3fbab9805f2bf2ed9130539a6663b (diff)
downloadhdf5-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_sparse_reader.c')
-rw-r--r--test/vfd_swmr_sparse_reader.c34
1 files changed, 11 insertions, 23 deletions
diff --git a/test/vfd_swmr_sparse_reader.c b/test/vfd_swmr_sparse_reader.c
index 4f87ac5..3f07dc9 100644
--- a/test/vfd_swmr_sparse_reader.c
+++ b/test/vfd_swmr_sparse_reader.c
@@ -34,6 +34,7 @@
#include "h5test.h"
#include "vfd_swmr_common.h"
+#include "swmr_common.h"
/****************/
/* Local Macros */
@@ -200,33 +201,20 @@ read_records(const char *filename, unsigned verbose, unsigned long nrecords,
HDassert(filename);
HDassert(poll_time != 0);
- /* Create file access property list */
- if((fapl = h5_fileaccess()) < 0)
- goto error;
-
- if(H5Pset_fclose_degree(fapl, H5F_CLOSE_SEMI) < 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;
-
/* Allocate memory for the configuration structure */
if((config = 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 = FALSE;
- config->md_pages_reserved = 128;
- HDstrcpy(config->md_file_path, "./rw-shadow");
+ /* config, tick_len, max_lag, writer, flush_raw_data, md_pages_reserved, md_file_path */
+ init_vfd_swmr_config(config, 4, 5 , FALSE, FALSE, 128, "./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(FALSE, TRUE, FALSE, config)) < 0) {
+ fprintf(stderr, "%s.%d: vfd_swmr_create_fapl failed\n", __func__, __LINE__);
+ goto error;
+ }
+
+ if(H5Pset_fclose_degree(fapl, H5F_CLOSE_SEMI) < 0)
goto error;
/* Emit informational message */
@@ -506,7 +494,7 @@ int main(int argc, const char *argv[])
}
/* Reading records from datasets */
- if(read_records(COMMON_FILENAME, verbose, (unsigned long) nrecords, (unsigned)poll_time, (unsigned)reopen_count) < 0) {
+ if(read_records(VFD_SWMR_FILENAME, verbose, (unsigned long) nrecords, (unsigned)poll_time, (unsigned)reopen_count) < 0) {
HDfprintf(stderr, "READER: Error reading records from datasets!\n");
HDexit(1);
} /* end if */