Skip to content

Commit

Permalink
test/mpi/threads/spawn: initialize the thread package
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
shintaro-iwasaki committed Apr 12, 2020
1 parent db30d4f commit 440590e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/mpi/threads/spawn/th_taskmaster.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -141,7 +141,7 @@ int main(int argc, char *argv[])
}

fn_exit:
MPI_Finalize();
MTest_Finalize(0);

return 0;
}

0 comments on commit 440590e

Please sign in to comment.