Commit 0b7862bd authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Fix bug when PPM_abort_f is called before MPI has been initialized.

parent 9f2a8445
......@@ -102,10 +102,13 @@ FCALLSCSUB1(PPM_set_default_comm_f, PPM_SET_DEFAULT_COMM,
void
PPM_abort_f(MPI_Fint *comm_f, const char *msg, const char *source, int line)
{
MPI_Comm comm_c;
#if defined(USE_MPI) && defined(HAVE_MPI_COMM_F2C)
MPI_Comm comm_c = MPI_Comm_f2c((MPI_Fint)*comm_f);
int flag = 0;
if (MPI_Initialized(&flag) == MPI_SUCCESS && flag)
comm_c = MPI_Comm_f2c((MPI_Fint)*comm_f);
#else
MPI_Comm comm_c = *comm_f;
comm_c = *comm_f;
#endif
PPM_abort(&comm_c, msg, source, line);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment