Skip to content

Commit

Permalink
Fix: MPI_Comm_free(MPI_COMM_NULL)
Browse files Browse the repository at this point in the history
Avoid that a minimal cycle of MPI and AMReX init and finalize
segfaults.
  • Loading branch information
ax3l committed Jan 29, 2024
1 parent ab99ea6 commit 4d892ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Src/Base/AMReX_ParallelDescriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ EndParallel ()
m_mpi_ops.clear();
}

if (!call_mpi_finalize) {
if (!call_mpi_finalize && m_comm != MPI_COMM_NULL) {
BL_MPI_REQUIRE( MPI_Comm_free(&m_comm) );
}
m_comm = MPI_COMM_NULL;
Expand Down

0 comments on commit 4d892ce

Please sign in to comment.