summaryrefslogtreecommitdiffstats
path: root/test/vfd_swmr_bigset_writer.c
diff options
context:
space:
mode:
authorRay Lu <songyulu@hdfgroup.org>2022-01-04 02:55:33 (GMT)
committerRay Lu <songyulu@hdfgroup.org>2022-01-04 02:55:33 (GMT)
commit7fa3e66be58958b556d3d929211ffd0faf8b5f40 (patch)
tree90766484bb1de5a9858b86f084fe901eadeebe1a /test/vfd_swmr_bigset_writer.c
parent0d084f201d05cfc9c2e6227da401a950eae0a210 (diff)
downloadhdf5-7fa3e66be58958b556d3d929211ffd0faf8b5f40.zip
hdf5-7fa3e66be58958b556d3d929211ffd0faf8b5f40.tar.gz
hdf5-7fa3e66be58958b556d3d929211ffd0faf8b5f40.tar.bz2
Rearragned how the auxiliary process is tested: let the test script launch it if the --enable-aux-process option is enabled during configure.
Diffstat (limited to 'test/vfd_swmr_bigset_writer.c')
-rw-r--r--test/vfd_swmr_bigset_writer.c45
1 files changed, 16 insertions, 29 deletions
diff --git a/test/vfd_swmr_bigset_writer.c b/test/vfd_swmr_bigset_writer.c
index 1284b75..9cbc3c2 100644
--- a/test/vfd_swmr_bigset_writer.c
+++ b/test/vfd_swmr_bigset_writer.c
@@ -494,6 +494,11 @@ state_init(state_t *s, int argc, char **argv)
TEST_ERROR;
}
+#ifdef H5_HAVE_AUX_PROCESS
+ if (s->vds == vds_multi)
+ exit(EXIT_SUCCESS);
+#endif
+
if (s->vds != vds_off && s->expand_2d) {
HDfprintf(stderr, "virtual datasets and 2D datasets are mutually exclusive\n");
TEST_ERROR;
@@ -2544,7 +2549,6 @@ main(int argc, char **argv)
state_t s;
np_state_t np;
size_t i;
- pid_t pid;
H5F_generate_md_ck_cb_t cb_info; /* Callback */
if (!state_init(&s, argc, argv)) {
@@ -2552,23 +2556,6 @@ main(int argc, char **argv)
TEST_ERROR;
}
- /* If using the auxiliary process, the reader creates a child process to run it */
- if (s.use_aux_proc && !s.writer) {
- pid = fork();
-
- if (pid == 0) {
- /* Run the auxiliary process to apply the updater files to the metadata file.
- * 'aux' is the executable of the auxiliary process which should be in the shell
- * path. Otherwise, use its absolute path. 'mdfile' is the metadata file created
- * by the auxiliary process. 'bigset_updater.*' are the updater files created
- * by the writer. */
- system("aux mdfile bigset_updater");
-
- /* Exit this process after the auxiliary process finishes */
- exit(0);
- }
- }
-
if ((mat = newmat(s)) == NULL) {
HDfprintf(stderr, "could not allocate matrix\n");
TEST_ERROR;
@@ -2592,20 +2579,20 @@ main(int argc, char **argv)
/* config, tick_len, max_lag, writer, maintain_metadata_file, generate_updater_files,
* flush_raw_data, md_pages_reserved, md_file_path, updater_file_path */
- if (s.use_aux_proc) {
- /* If using the auxiliary process, the writer creates the updater files.
- * The reader uses the metadata file generated by the auxiliary process. */
- if (s.writer) {
- init_vfd_swmr_config(&config, s.tick_len, s.max_lag, s.writer, FALSE, TRUE, s.flush_raw_data, 128,
- "./bigset-shadow-%zu", "bigset_updater", i);
- } else {
- init_vfd_swmr_config(&config, s.tick_len, s.max_lag, s.writer, TRUE, FALSE, s.flush_raw_data, 128,
- "./mdfile", NULL);
- }
+#ifdef H5_HAVE_AUX_PROCESS
+ /* If using the auxiliary process, the writer creates the updater files.
+ * The reader uses the metadata file generated by the auxiliary process. */
+ if (s.writer) {
+ init_vfd_swmr_config(&config, s.tick_len, s.max_lag, s.writer, FALSE, TRUE, s.flush_raw_data, 128,
+ "./bigset-shadow-%zu", "bigset_updater", i);
} else {
init_vfd_swmr_config(&config, s.tick_len, s.max_lag, s.writer, TRUE, FALSE, s.flush_raw_data, 128,
- "./bigset-shadow-%zu", NULL, i);
+ "./mdfile", NULL);
}
+#else
+ init_vfd_swmr_config(&config, s.tick_len, s.max_lag, s.writer, TRUE, FALSE, s.flush_raw_data, 128,
+ "./bigset-shadow-%zu", NULL, i);
+#endif
/* use_latest_format, use_vfd_swmr, only_meta_page, page_buf_size, config */
if ((fapl = vfd_swmr_create_fapl(true, s.use_vfd_swmr, true, s.page_buf_size, &config)) < 0) {