Better conditional for call to MPI_Type_free (thanks Cliff Dugal)

This commit is contained in:
Paul Romano 2019-09-06 14:08:24 -05:00
parent 9036e79c10
commit 3aedd6a337

View file

@ -127,9 +127,7 @@ int openmc_finalize()
// Free all MPI types
#ifdef OPENMC_MPI
int init_called;
MPI_Initialized(&init_called);
if (init_called) MPI_Type_free(&mpi::bank);
if (mpi::bank != MPI_DATATYPE_NULL) MPI_Type_free(&mpi::bank);
#endif
return 0;