summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authormainzer <mainzer#hdfgroup.org>2019-01-15 22:36:51 (GMT)
committermainzer <mainzer#hdfgroup.org>2019-01-15 22:36:51 (GMT)
commitb4f607bc13841c5366f232e16c776d700d15b5be (patch)
tree1aba531e6d30925e11aa6393a14a4c91a0e0dec8 /test
parent4f8917f9086088ac5cc7fa3c3deb400afbf33b68 (diff)
downloadhdf5-b4f607bc13841c5366f232e16c776d700d15b5be.zip
hdf5-b4f607bc13841c5366f232e16c776d700d15b5be.tar.gz
hdf5-b4f607bc13841c5366f232e16c776d700d15b5be.tar.bz2
Intermin commit to allow update from Vailin's recent changes
Diffstat (limited to 'test')
-rw-r--r--test/testvfdswmr.sh.in7
-rw-r--r--test/vfd_swmr.c112
-rw-r--r--test/vfd_swmr_addrem_writer.c4
-rw-r--r--test/vfd_swmr_generator.c4
-rw-r--r--test/vfd_swmr_reader.c4
-rw-r--r--test/vfd_swmr_remove_reader.c4
-rw-r--r--test/vfd_swmr_remove_writer.c4
-rw-r--r--test/vfd_swmr_sparse_reader.c4
-rw-r--r--test/vfd_swmr_sparse_writer.c4
-rw-r--r--test/vfd_swmr_writer.c4
10 files changed, 92 insertions, 59 deletions
diff --git a/test/testvfdswmr.sh.in b/test/testvfdswmr.sh.in
index ba9081b..1e596e0 100644
--- a/test/testvfdswmr.sh.in
+++ b/test/testvfdswmr.sh.in
@@ -25,11 +25,8 @@ srcdir=@srcdir@
## test parameters
###############################################################################
-#Nreaders=5 # number of readers to launch
-#Nrdrs_spa=3 # number of sparse readers to launch
-# Temporarily set readers to be 0 for testing VFD SWMR writer only
-Nreaders=0 # number of readers to launch
-Nrdrs_spa=0 # number of sparse readers to launch
+Nreaders=5 # number of readers to launch
+Nrdrs_spa=3 # number of sparse readers to launch
Nrecords=200000 # number of records to write
Nrecs_rem=40000 # number of times to shrink
Nrecs_spa=20000 # number of records to write in the sparse test
diff --git a/test/vfd_swmr.c b/test/vfd_swmr.c
index 2427eb1..d664957 100644
--- a/test/vfd_swmr.c
+++ b/test/vfd_swmr.c
@@ -1037,10 +1037,11 @@ test_reader_md_concur(void)
H5O_info_t oinfo; /* Object metadata information */
char dname[100]; /* Name of dataset */
hsize_t dims[2] = {50, 20}; /* Dataset dimension sizes */
- hsize_t max_dims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; /* Dataset maximum dimension sizes */
- hsize_t chunk_dims[2] = {2, 5}; /* Dataset chunked dimension sizes */
- unsigned num_entries = 0 ; /* Number of entries in the index */
- H5FD_vfd_swmr_idx_entry_t *index = NULL; /* Pointer to the index entries */
+ hsize_t max_dims[2] = /* Dataset maximum dimension sizes */
+ {H5S_UNLIMITED, H5S_UNLIMITED};
+ hsize_t chunk_dims[2] = {2, 5}; /* Dataset chunked dimension sizes */
+ unsigned num_entries = 0 ; /* Number of entries in the index */
+ H5FD_vfd_swmr_idx_entry_t *index = NULL; /* Pointer to the index entries */
hid_t fcpl = -1; /* File creation property list */
hid_t fid_writer = -1; /* File ID for writer */
@@ -1060,8 +1061,10 @@ test_reader_md_concur(void)
TESTING("Verify the metadata file for VFD SWMR reader");
/* Allocate memory for the configuration structure */
- if((config_writer = (H5F_vfd_swmr_config_t *)HDmalloc(sizeof(H5F_vfd_swmr_config_t))) == NULL)
+ if((config_writer = (H5F_vfd_swmr_config_t *)
+ HDmalloc(sizeof(H5F_vfd_swmr_config_t))) == NULL)
FAIL_STACK_ERROR;
+
HDmemset(config_writer, 0, sizeof(H5F_vfd_swmr_config_t));
/* Create a copy of the file access property list */
@@ -1073,7 +1076,7 @@ test_reader_md_concur(void)
config_writer->tick_len = 1;
config_writer->max_lag = 3;
config_writer->vfd_swmr_writer = TRUE;
- config_writer->md_pages_reserved = 2;
+ config_writer->md_pages_reserved = 256;
HDstrcpy(config_writer->md_file_path, MD_FILENAME);
/* Set the VFD SWMR configuration in fapl */
@@ -1089,8 +1092,10 @@ test_reader_md_concur(void)
FAIL_STACK_ERROR
/* Set file space strategy */
- if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, FALSE, (hsize_t)1) < 0)
+ if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE,
+ FALSE, (hsize_t)1) < 0)
FAIL_STACK_ERROR;
+
if(H5Pset_file_space_page_size(fcpl, FS_PAGE_SIZE) < 0)
FAIL_STACK_ERROR;
@@ -1105,6 +1110,7 @@ test_reader_md_concur(void)
/* Create 2 pipes */
if(HDpipe(parent_pfd) < 0)
FAIL_STACK_ERROR
+
if(HDpipe(child_pfd) < 0)
FAIL_STACK_ERROR
@@ -1121,7 +1127,7 @@ test_reader_md_concur(void)
hid_t fapl_reader = -1; /* File access property list for reader */
H5F_t *file_reader; /* File pointer for reader */
H5F_vfd_swmr_config_t *config_reader = NULL; /* VFD SWMR configuration for reader */
- unsigned child_num_entries = 0; /* Number of entries passed to reader */
+ unsigned child_num_entries = 0; /* Number of entries passed to reader */
H5FD_vfd_swmr_idx_entry_t *child_index = NULL; /* Index passed to reader */
/* Close unused write end for writer pipe */
@@ -1144,8 +1150,10 @@ test_reader_md_concur(void)
}
/* Allocate memory for the configuration structure */
- if((config_reader = (H5F_vfd_swmr_config_t *)HDmalloc(sizeof(H5F_vfd_swmr_config_t))) == NULL)
+ if((config_reader = (H5F_vfd_swmr_config_t *)
+ HDmalloc(sizeof(H5F_vfd_swmr_config_t))) == NULL)
HDexit(EXIT_FAILURE);
+
HDmemset(config_reader, 0, sizeof(H5F_vfd_swmr_config_t));
/* Set up the VFD SWMR configuration as reader */
@@ -1153,7 +1161,7 @@ test_reader_md_concur(void)
config_reader->tick_len = 1;
config_reader->max_lag = 3;
config_reader->vfd_swmr_writer = FALSE;
- config_reader->md_pages_reserved = 2;
+ config_reader->md_pages_reserved = 256;
HDstrcpy(config_reader->md_file_path, MD_FILENAME);
/* Create a copy of the file access property list */
@@ -1206,16 +1214,23 @@ test_reader_md_concur(void)
if(child_num_entries) {
/* Allocate memory for num_entries index */
- if((child_index = (H5FD_vfd_swmr_idx_entry_t *)HDcalloc(child_num_entries, sizeof(H5FD_vfd_swmr_idx_entry_t))) == NULL)
+ if((child_index = (H5FD_vfd_swmr_idx_entry_t *)
+ HDcalloc(child_num_entries,
+ sizeof(H5FD_vfd_swmr_idx_entry_t))) == NULL)
HDexit(EXIT_FAILURE);
/* Read index from writer pipe */
- if(HDread(parent_pfd[0], child_index, child_num_entries * sizeof(H5FD_vfd_swmr_idx_entry_t)) < 0)
+ if(HDread(parent_pfd[0], child_index,
+ child_num_entries * sizeof(H5FD_vfd_swmr_idx_entry_t)) < 0)
+
HDexit(EXIT_FAILURE);
}
- /* Read and verify the expected header and index info in the metadata file */
- if(H5FD__vfd_swmr_reader_md_test(file_reader->shared->lf, child_num_entries, child_index) < 0)
+ /* Read and verify the expected header and index info in the
+ * metadata file
+ */
+ if(H5FD__vfd_swmr_reader_md_test(file_reader->shared->lf,
+ child_num_entries, child_index) < 0)
HDexit(EXIT_FAILURE);
/* Send notification 4 to parent that the verification is complete */
@@ -1244,16 +1259,22 @@ test_reader_md_concur(void)
if(child_num_entries) {
/* Allocate memory for num_entries index */
- if((child_index = (H5FD_vfd_swmr_idx_entry_t *)HDcalloc(child_num_entries, sizeof(H5FD_vfd_swmr_idx_entry_t))) == NULL)
+ if((child_index = (H5FD_vfd_swmr_idx_entry_t *)
+ HDcalloc(child_num_entries,
+ sizeof(H5FD_vfd_swmr_idx_entry_t))) == NULL)
HDexit(EXIT_FAILURE);
/* Read index from writer pipe */
- if(HDread(parent_pfd[0], child_index, child_num_entries * sizeof(H5FD_vfd_swmr_idx_entry_t)) < 0)
+ if(HDread(parent_pfd[0], child_index,
+ child_num_entries * sizeof(H5FD_vfd_swmr_idx_entry_t)) < 0)
HDexit(EXIT_FAILURE);
}
- /* Read and verify the expected header and index info in the metadata file */
- if(H5FD__vfd_swmr_reader_md_test(file_reader->shared->lf, child_num_entries, child_index) < 0)
+ /* Read and verify the expected header and index info in the
+ * metadata file
+ */
+ if(H5FD__vfd_swmr_reader_md_test(file_reader->shared->lf,
+ child_num_entries, child_index) < 0)
HDexit(EXIT_FAILURE);
/* Send notification 6 to parent that the verification is complete */
@@ -1268,9 +1289,12 @@ test_reader_md_concur(void)
/* Wait for notification 7 from parent to start verification */
while(child_notify != 7) {
+
if(HDread(parent_pfd[0], &child_notify, sizeof(int)) < 0)
+
HDexit(EXIT_FAILURE);
}
+
/* Read num_entries from writer pipe */
if(HDread(parent_pfd[0], &child_num_entries, sizeof(int)) < 0)
HDexit(EXIT_FAILURE);
@@ -1281,16 +1305,22 @@ test_reader_md_concur(void)
if(child_num_entries) {
/* Allocate memory for num_entries index */
- if((child_index = (H5FD_vfd_swmr_idx_entry_t *)HDcalloc(child_num_entries, sizeof(H5FD_vfd_swmr_idx_entry_t))) == NULL)
+ if((child_index = (H5FD_vfd_swmr_idx_entry_t *)
+ HDcalloc(child_num_entries,
+ sizeof(H5FD_vfd_swmr_idx_entry_t))) == NULL)
HDexit(EXIT_FAILURE);
/* Read index from writer pipe */
- if(HDread(parent_pfd[0], child_index, child_num_entries * sizeof(H5FD_vfd_swmr_idx_entry_t)) < 0)
+ if(HDread(parent_pfd[0], child_index,
+ child_num_entries * sizeof(H5FD_vfd_swmr_idx_entry_t)) < 0)
HDexit(EXIT_FAILURE);
}
- /* Read and verify the expected header and index info in the metadata file */
- if(H5FD__vfd_swmr_reader_md_test(file_reader->shared->lf, child_num_entries, child_index) < 0)
+ /* Read and verify the expected header and index info in the
+ * metadata file
+ */
+ if(H5FD__vfd_swmr_reader_md_test(file_reader->shared->lf,
+ child_num_entries, child_index) < 0)
HDexit(EXIT_FAILURE);
/* Send notification 8 to parent that the verification is complete */
@@ -1390,7 +1420,8 @@ test_reader_md_concur(void)
/* Create a chunked dataset */
sprintf(dname, "dset %d", i);
- if((did = H5Dcreate2(fid_writer, dname, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
+ if((did = H5Dcreate2(fid_writer, dname, H5T_NATIVE_INT, sid,
+ H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
FAIL_STACK_ERROR
/* Get dataset object header address */
@@ -1405,11 +1436,13 @@ test_reader_md_concur(void)
num_entries = 12;
/* Allocate num_entries for the data buffer */
- if((buf = (uint8_t *)HDmalloc((num_entries * FS_PAGE_SIZE * sizeof(uint8_t)))) == NULL)
+ if((buf = (uint8_t *)HDmalloc((num_entries * FS_PAGE_SIZE *
+ sizeof(uint8_t)))) == NULL)
FAIL_STACK_ERROR;
/* Allocate memory for num_entries index */
- if(NULL == (index = (H5FD_vfd_swmr_idx_entry_t *)HDcalloc(num_entries, sizeof(H5FD_vfd_swmr_idx_entry_t))))
+ if(NULL == (index = (H5FD_vfd_swmr_idx_entry_t *)
+ HDcalloc(num_entries, sizeof(H5FD_vfd_swmr_idx_entry_t))))
FAIL_STACK_ERROR;
/* Construct index for updating the metadata file */
@@ -1437,7 +1470,8 @@ test_reader_md_concur(void)
FAIL_STACK_ERROR;
/* Send index to the reader */
- if(HDwrite(parent_pfd[1], index, num_entries * sizeof(H5FD_vfd_swmr_idx_entry_t)) < 0)
+ if(HDwrite(parent_pfd[1], index,
+ num_entries * sizeof(H5FD_vfd_swmr_idx_entry_t)) < 0)
FAIL_STACK_ERROR;
/*
@@ -1467,7 +1501,8 @@ test_reader_md_concur(void)
FAIL_STACK_ERROR
/* Write to the dataset */
- if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rwbuf) < 0)
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, rwbuf) < 0)
FAIL_STACK_ERROR
/* Close the dataset */
@@ -1494,7 +1529,8 @@ test_reader_md_concur(void)
FAIL_STACK_ERROR;
/* Send index to the reader */
- if(HDwrite(parent_pfd[1], index, num_entries * sizeof(H5FD_vfd_swmr_idx_entry_t)) < 0)
+ if(HDwrite(parent_pfd[1], index,
+ num_entries * sizeof(H5FD_vfd_swmr_idx_entry_t)) < 0)
FAIL_STACK_ERROR;
/*
@@ -1518,7 +1554,8 @@ test_reader_md_concur(void)
FAIL_STACK_ERROR
/* Read from the dataset */
- if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rwbuf) < 0)
+ if(H5Dread(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, rwbuf) < 0)
FAIL_STACK_ERROR
/* Close the dataset */
@@ -1545,7 +1582,8 @@ test_reader_md_concur(void)
FAIL_STACK_ERROR;
/* Send index to the reader */
- if(HDwrite(parent_pfd[1], index, num_entries * sizeof(H5FD_vfd_swmr_idx_entry_t)) < 0)
+ if(HDwrite(parent_pfd[1], index,
+ num_entries * sizeof(H5FD_vfd_swmr_idx_entry_t)) < 0)
FAIL_STACK_ERROR;
/*
@@ -1568,7 +1606,8 @@ test_reader_md_concur(void)
FAIL_STACK_ERROR
/* Write to the dataset */
- if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rwbuf) < 0)
+ if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, rwbuf) < 0)
FAIL_STACK_ERROR
/* Close the dataset */
@@ -1664,7 +1703,8 @@ error:
int
main(void)
{
- hid_t fapl = -1; /* File access property list for data files */
+ hid_t fapl = -1; /* File access property list for */
+ /* data files */
unsigned nerrors = 0; /* Cumulative error count */
char *lock_env_var = NULL; /* File locking env var pointer */
const char *env_h5_drvr = NULL; /* File Driver value from environment */
@@ -1711,13 +1751,9 @@ main(void)
nerrors += test_file_fapl();
nerrors += test_file_end_tick();
-
nerrors += test_writer_create_open_flush();
- nerrors += test_writer_md();
-
-#ifdef LATER /* Will activate the test when reader EOT is implemented */
- nerrors += test_reader_md_concur()flush ;
-#endif
+ nerrors += test_writer_md();
+ nerrors += test_reader_md_concur();
} /* end if */
diff --git a/test/vfd_swmr_addrem_writer.c b/test/vfd_swmr_addrem_writer.c
index da94adb..1bdd835 100644
--- a/test/vfd_swmr_addrem_writer.c
+++ b/test/vfd_swmr_addrem_writer.c
@@ -124,9 +124,9 @@ open_skeleton(const char *filename, unsigned verbose)
config->version = H5F__CURR_VFD_SWMR_CONFIG_VERSION;
config->tick_len = 4;
- config->max_lag = 6;
+ config->max_lag = 5;
config->vfd_swmr_writer = TRUE;
- config->md_pages_reserved = 2;
+ config->md_pages_reserved = 128;
HDstrcpy(config->md_file_path, "./my_md_file");
/* Enable VFD SWMR configuration */
diff --git a/test/vfd_swmr_generator.c b/test/vfd_swmr_generator.c
index cfdcdf7..3131f56 100644
--- a/test/vfd_swmr_generator.c
+++ b/test/vfd_swmr_generator.c
@@ -177,9 +177,9 @@ gen_skeleton(const char *filename, hbool_t verbose, hbool_t vfd_swmr_write,
config->version = H5F__CURR_VFD_SWMR_CONFIG_VERSION;
config->tick_len = 4;
- config->max_lag = 6;
+ config->max_lag = 10;
config->vfd_swmr_writer = TRUE;
- config->md_pages_reserved = 512;
+ config->md_pages_reserved = 128;
HDstrcpy(config->md_file_path, "my_md_file");
/* Enable VFD SWMR configuration in fapl */
diff --git a/test/vfd_swmr_reader.c b/test/vfd_swmr_reader.c
index da7cb50..606d0c8 100644
--- a/test/vfd_swmr_reader.c
+++ b/test/vfd_swmr_reader.c
@@ -300,9 +300,9 @@ read_records(const char *filename, hbool_t verbose, FILE *verbose_file,
config->version = H5F__CURR_VFD_SWMR_CONFIG_VERSION;
config->tick_len = 4;
- config->max_lag = 6;
+ config->max_lag = 5;
config->vfd_swmr_writer = FALSE;
- config->md_pages_reserved = 2;
+ config->md_pages_reserved = 128;
HDstrcpy(config->md_file_path, "./my_md_file");
/* Enable VFD SWMR configuration */
diff --git a/test/vfd_swmr_remove_reader.c b/test/vfd_swmr_remove_reader.c
index a278330..1c752cd 100644
--- a/test/vfd_swmr_remove_reader.c
+++ b/test/vfd_swmr_remove_reader.c
@@ -285,9 +285,9 @@ read_records(const char *filename, unsigned verbose, unsigned long nseconds,
config->version = H5F__CURR_VFD_SWMR_CONFIG_VERSION;
config->tick_len = 4;
- config->max_lag = 6;
+ config->max_lag = 5;
config->vfd_swmr_writer = FALSE;
- config->md_pages_reserved = 2;
+ config->md_pages_reserved = 128;
HDstrcpy(config->md_file_path, "./my_md_file");
/* Enable VFD SWMR configuration */
diff --git a/test/vfd_swmr_remove_writer.c b/test/vfd_swmr_remove_writer.c
index 12131c4..200c884 100644
--- a/test/vfd_swmr_remove_writer.c
+++ b/test/vfd_swmr_remove_writer.c
@@ -124,9 +124,9 @@ open_skeleton(const char *filename, unsigned verbose, unsigned old)
config->version = H5F__CURR_VFD_SWMR_CONFIG_VERSION;
config->tick_len = 4;
- config->max_lag = 6;
+ config->max_lag = 5;
config->vfd_swmr_writer = TRUE;
- config->md_pages_reserved = 2;
+ config->md_pages_reserved = 128;
HDstrcpy(config->md_file_path, "./my_md_file");
/* Enable VFD SWMR configuration */
diff --git a/test/vfd_swmr_sparse_reader.c b/test/vfd_swmr_sparse_reader.c
index 0b17bb2..93c5ba6 100644
--- a/test/vfd_swmr_sparse_reader.c
+++ b/test/vfd_swmr_sparse_reader.c
@@ -207,9 +207,9 @@ read_records(const char *filename, unsigned verbose, unsigned long nrecords,
config->version = H5F__CURR_VFD_SWMR_CONFIG_VERSION;
config->tick_len = 4;
- config->max_lag = 6;
+ config->max_lag = 5;
config->vfd_swmr_writer = FALSE;
- config->md_pages_reserved = 2;
+ config->md_pages_reserved = 128;
HDstrcpy(config->md_file_path, "./my_md_file");
/* Enable VFD SWMR configuration */
diff --git a/test/vfd_swmr_sparse_writer.c b/test/vfd_swmr_sparse_writer.c
index e4e8254..bf1728a 100644
--- a/test/vfd_swmr_sparse_writer.c
+++ b/test/vfd_swmr_sparse_writer.c
@@ -123,9 +123,9 @@ open_skeleton(const char *filename, unsigned verbose)
config->version = H5F__CURR_VFD_SWMR_CONFIG_VERSION;
config->tick_len = 4;
- config->max_lag = 6;
+ config->max_lag = 5;
config->vfd_swmr_writer = TRUE;
- config->md_pages_reserved = 2;
+ config->md_pages_reserved = 128;
HDstrcpy(config->md_file_path, "./my_md_file");
/* Enable VFD SWMR configuration */
diff --git a/test/vfd_swmr_writer.c b/test/vfd_swmr_writer.c
index 083f6298..5e19ba7 100644
--- a/test/vfd_swmr_writer.c
+++ b/test/vfd_swmr_writer.c
@@ -128,9 +128,9 @@ open_skeleton(const char *filename, hbool_t verbose, FILE *verbose_file,
config->version = H5F__CURR_VFD_SWMR_CONFIG_VERSION;
config->tick_len = 4;
- config->max_lag = 6;
+ config->max_lag = 5;
config->vfd_swmr_writer = TRUE;
- config->md_pages_reserved = 2;
+ config->md_pages_reserved = 128;
HDstrcpy(config->md_file_path, "./my_md_file");
/* Enable VFD SWMR configuration */