No MPI communicaton after MPI_Finalize() and no MPI_Finalize() unless we are initialized.
This commit is contained in:
@ -337,8 +337,15 @@ more MPI calls may be made.
|
||||
|
||||
void lammps_mpi_finalize()
|
||||
{
|
||||
MPI_Barrier(MPI_COMM_WORLD);
|
||||
MPI_Finalize();
|
||||
int flag;
|
||||
MPI_Initialized(&flag);
|
||||
if (flag) {
|
||||
MPI_Finalized(&flag);
|
||||
if (!flag) {
|
||||
MPI_Barrier(MPI_COMM_WORLD);
|
||||
MPI_Finalize();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
Reference in New Issue
Block a user