ENH: UPstream: extra checking for already clear comms

This commit is contained in:
mattijs
2013-04-03 16:30:44 +01:00
parent 5c517879ed
commit f3b8d9de6f

View File

@ -441,9 +441,14 @@ void Foam::UPstream::freePstreamCommunicator(const label communicator)
{
if (PstreamGlobals::MPICommunicators_[communicator] != MPI_COMM_NULL)
{
// Free communicator. Sets communicator to MPI_COMM_NULL
MPI_Comm_free(&PstreamGlobals::MPICommunicators_[communicator]);
}
MPI_Group_free(&PstreamGlobals::MPIGroups_[communicator]);
if (PstreamGlobals::MPIGroups_[communicator] != MPI_GROUP_NULL)
{
// Free greoup. Sets group to MPI_GROUP_NULL
MPI_Group_free(&PstreamGlobals::MPIGroups_[communicator]);
}
}
}