summaryrefslogtreecommitdiffstats
path: root/testpar/t_bigio.c
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2023-11-15 14:20:50 (GMT)
committerGitHub <noreply@github.com>2023-11-15 14:20:50 (GMT)
commitc779464bfe3dabd767144526a868a5b06538161f (patch)
tree24dbf660c97b36d8634ce2cd8440cb2b61e3bcb3 /testpar/t_bigio.c
parente807dee0fd6c007d7c41327c1ed0e8f5bc617f72 (diff)
downloadhdf5-c779464bfe3dabd767144526a868a5b06538161f.zip
hdf5-c779464bfe3dabd767144526a868a5b06538161f.tar.gz
hdf5-c779464bfe3dabd767144526a868a5b06538161f.tar.bz2
Add GitHub actions for testing VOL connectors (#3849)
* Fix issue with HDF5_VOL_ALLOW_EXTERNAL CMake variable * Add initial API test workflow * Initialize parallel testing with MPI_THREAD_MULTIPLE when testing API * Add CMake variable to allow specifying a VOL connector's package name * Remove call to MPI_Init in serial API tests While previously necessary, it now interferes with VOL connectors that may need to be initialized with MPI_THREAD_MULTIPLE
Diffstat (limited to 'testpar/t_bigio.c')
-rw-r--r--testpar/t_bigio.c39
1 files changed, 36 insertions, 3 deletions
diff --git a/testpar/t_bigio.c b/testpar/t_bigio.c
index 910c7a2..068e3aa 100644
--- a/testpar/t_bigio.c
+++ b/testpar/t_bigio.c
@@ -1867,6 +1867,11 @@ main(int argc, char **argv)
/* Set the bigio processing limit to be 'newsize' bytes */
hsize_t oldsize = H5_mpi_set_bigio_count(newsize);
hid_t acc_plist = H5I_INVALID_HID;
+#ifdef H5_HAVE_TEST_API
+ int required = MPI_THREAD_MULTIPLE;
+ int provided;
+#endif
+ int mpi_code;
/* Having set the bigio handling to a size that is manageable,
* we'll set our 'bigcount' variable to be 2X that limit so
@@ -1876,9 +1881,37 @@ main(int argc, char **argv)
if (newsize != oldsize)
bigcount = newsize * 2;
- MPI_Init(&argc, &argv);
- MPI_Comm_size(MPI_COMM_WORLD, &mpi_size_g);
- MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank_g);
+#ifdef H5_HAVE_TEST_API
+ /* Attempt to initialize with MPI_THREAD_MULTIPLE if possible */
+ if (MPI_SUCCESS != (mpi_code = MPI_Init_thread(&argc, &argv, required, &provided))) {
+ printf("MPI_Init_thread failed with error code %d\n", mpi_code);
+ return -1;
+ }
+#else
+ if (MPI_SUCCESS != (mpi_code = MPI_Init(&argc, &argv))) {
+ printf("MPI_Init failed with error code %d\n", mpi_code);
+ return -1;
+ }
+#endif
+
+ if (MPI_SUCCESS != (mpi_code = MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank_g))) {
+ printf("MPI_Comm_rank failed with error code %d\n", mpi_code);
+ MPI_Finalize();
+ return -1;
+ }
+
+#ifdef H5_HAVE_TEST_API
+ /* Warn about missing MPI_THREAD_MULTIPLE support */
+ if ((provided < required) && MAIN_PROCESS)
+ printf("** MPI doesn't support MPI_Init_thread with MPI_THREAD_MULTIPLE **\n");
+#endif
+
+ if (MPI_SUCCESS != (mpi_code = MPI_Comm_size(MPI_COMM_WORLD, &mpi_size_g))) {
+ if (MAIN_PROCESS)
+ printf("MPI_Comm_size failed with error code %d\n", mpi_code);
+ MPI_Finalize();
+ return -1;
+ }
/* Attempt to turn off atexit post processing so that in case errors
* happen during the test and the process is aborted, it will not get