Skip to content

Commit

Permalink
Allow Grid to Mpi_init.
Browse files Browse the repository at this point in the history
  • Loading branch information
goracle authored and jcosborn committed Feb 15, 2018
1 parent d829be7 commit d6d0fe8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/mpi/QMP_init_mpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@ QMP_init_machine_mpi (int* argc, char*** argv, QMP_thread_level_t required,
break;
}

if (MPI_Init_thread(argc, argv, mpi_req, &mpi_prv) != MPI_SUCCESS)
QMP_abort_string (-1, "MPI_Init failed");
int flag;
MPI_Initialized(&flag); // needed to coexist with other libs apparently
if ( !flag ) {
if (MPI_Init_thread(argc, argv, mpi_req, &mpi_prv) != MPI_SUCCESS)
QMP_abort_string (-1, "MPI_Init failed");
}else{
MPI_Query_thread(&mpi_prv);
}

switch(mpi_prv) {
case MPI_THREAD_SINGLE:
Expand Down

0 comments on commit d6d0fe8

Please sign in to comment.