1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-04 19:25:56 +01:00

Finalize protection

This commit is contained in:
paboyle 2018-03-05 12:22:18 +00:00
parent 4790e99817
commit 1dc86efd26

View File

@ -401,7 +401,10 @@ void *SharedMemory::ShmBufferTranslate(int rank,void * local_p)
}
SharedMemory::~SharedMemory()
{
MPI_Comm_free(&ShmComm);
int MPI_is_finalised; MPI_Finalized(&MPI_is_finalised);
if ( !MPI_is_finalised ) {
MPI_Comm_free(&ShmComm);
}
};
}