Skip to content

Commit e56bb4a

Browse files
committed
add missing mpi_init_thread
Signed-off-by: Thomas Naughton <naughtont@ornl.gov>
1 parent 9ee8b22 commit e56bb4a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

environ-mgmt/src/test_add_del_err_codes_pthreads.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,16 @@ void *thread_func(void *arg)
7777
int main(int argc, char **argv)
7878
{
7979
int rank, size;
80+
int provided;
8081

81-
MPI_Init(&argc, &argv);
82+
MPI_Init_thread(&argc, &argv, MPI_THREAD_MULTIPLE, &provided);
8283
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
8384
MPI_Comm_size(MPI_COMM_WORLD, &size);
8485

86+
if (provided < MPI_THREAD_MULTIPLE) {
87+
printf("Warning: MPI does not provide MPI_THREAD_MULTIPLE support\n");
88+
}
89+
8590
if (rank == 0) {
8691
printf("MPI initialized with %d processes\n", size);
8792

0 commit comments

Comments
 (0)