Skip to content

Commit

Permalink
Fix bug for certain MPI distributions
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiangrimberg committed Jun 21, 2024
1 parent 440532b commit d101185
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions palace/utils/geodata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ std::unique_ptr<mfem::ParMesh> ReadMesh(MPI_Comm comm, const IoData &iodata)
const auto &refinement = iodata.model.refinement;
const bool use_amr = refinement.max_it > 0;
const bool use_mesh_partitioner = !use_amr || !refinement.nonconformal;
MPI_Comm node_comm = nullptr;
MPI_Comm node_comm;
if (!use_mesh_partitioner)
{
MPI_Comm_split_type(comm, MPI_COMM_TYPE_SHARED, Mpi::Rank(comm), MPI_INFO_NULL,
Expand All @@ -93,7 +93,8 @@ std::unique_ptr<mfem::ParMesh> ReadMesh(MPI_Comm comm, const IoData &iodata)
// Only one process per node reads the serial mesh.
{
BlockTimer bt(Timer::IO);
if ((use_mesh_partitioner && Mpi::Root(comm)) || Mpi::Root(node_comm))
if ((use_mesh_partitioner && Mpi::Root(comm)) ||
(!use_mesh_partitioner && Mpi::Root(node_comm)))
{
smesh = LoadMesh(iodata.model.mesh, iodata.model.remove_curvature);
MFEM_VERIFY(!(smesh->Nonconforming() && use_mesh_partitioner),
Expand Down

0 comments on commit d101185

Please sign in to comment.