Skip to content

Commit

Permalink
Minor changes in Src/Base/AMReX_MPMD (AMReX-Codes#3800)
Browse files Browse the repository at this point in the history
Minor changes to `MPMD::Copier` class to enable its utilization for
non-cell centered `MultiFab`.
  • Loading branch information
siddanib authored Mar 14, 2024
1 parent 201e6a9 commit bde2963
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions Src/Base/AMReX_MPMD.H
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public:
private:
std::map<int,FabArrayBase::CopyComTagsContainer> m_SndTags;
std::map<int,FabArrayBase::CopyComTagsContainer> m_RcvTags;
bool m_is_thread_safe;
};

template <typename FAB>
Expand Down Expand Up @@ -166,12 +167,12 @@ void Copier::recv (FabArray<FAB>& mf, int icomp, int ncomp) const
#ifdef AMREX_USE_GPU
if (Gpu::inLaunchRegion() && (mf.arena()->isDevice() || mf.arena()->isManaged())) {
mf.unpack_recv_buffer_gpu(mf, icomp, ncomp, recv_data, recv_size, recv_cctc,
FabArrayBase::COPY, true);
FabArrayBase::COPY, m_is_thread_safe);
} else
#endif
{
mf.unpack_recv_buffer_cpu(mf, icomp, ncomp, recv_data, recv_size, recv_cctc,
FabArrayBase::COPY, true);
FabArrayBase::COPY, m_is_thread_safe);
}
}

Expand Down
4 changes: 2 additions & 2 deletions Src/Base/AMReX_MPMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ Copier::Copier (BoxArray const& ba, DistributionMapping const& dm)
// MPI_COMM_WORLD.

// Build communication meta-data

AMREX_ALWAYS_ASSERT(ba.ixType().cellCentered());
AMREX_ALWAYS_ASSERT(ba.ixType() == oba.ixType());
m_is_thread_safe = ba.ixType().cellCentered();

std::vector<std::pair<int,Box> > isects;

Expand Down

0 comments on commit bde2963

Please sign in to comment.