From 440590e86afe0831cf53052a78fe282c1ea47455 Mon Sep 17 00:00:00 2001 From: Shintaro Iwasaki Date: Sat, 11 Apr 2020 10:29:26 -0500 Subject: [PATCH] test/mpi/threads/spawn: initialize the thread package th_taskmaster.c uses MTest thread functions for forking and joining threads, but the thread package is not initialized. This patch fixes it. Note that we cannot explicitly use MTest_Init_thread() since the corresponding MTest_Finalize() prints "No Errors" as many as spawned MPI processes, breaking this test. --- test/mpi/threads/spawn/th_taskmaster.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/mpi/threads/spawn/th_taskmaster.c b/test/mpi/threads/spawn/th_taskmaster.c index e89374c4a72..d826bf0004f 100644 --- a/test/mpi/threads/spawn/th_taskmaster.c +++ b/test/mpi/threads/spawn/th_taskmaster.c @@ -68,13 +68,13 @@ int main(int argc, char *argv[]) #endif /* USE_THREADS */ #ifdef USE_THREADS - CHECK_SUCCESS(MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided)); + CHECK_SUCCESS(MTest_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided)); if (provided != MPI_THREAD_MULTIPLE) { fprintf(stderr, "MPI does not provide THREAD_MULTIPLE support\n"); MPI_Abort(MPI_COMM_WORLD, -1); } #else - CHECK_SUCCESS(MPI_Init(&argc, &argv)); + CHECK_SUCCESS(MTest_Init(&argc, &argv)); #endif CHECK_SUCCESS(MPI_Comm_get_parent(&parent)); @@ -141,7 +141,7 @@ int main(int argc, char *argv[]) } fn_exit: - MPI_Finalize(); + MTest_Finalize(0); return 0; }