Skip to content

Commit 2628014

Browse files
authored
ParallelAdd: Buffer unpacking should respect the deterministic flag (#5247)
1 parent 0c6bb5a commit 2628014

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Src/Base/AMReX_FabArray.H

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ struct PCData {
145145
Vector<std::size_t> recv_size;
146146
Vector<MPI_Request> recv_reqs;
147147
Vector<MPI_Request> send_reqs;
148+
bool deterministic = false;
148149

149150
};
150151

Src/Base/AMReX_FabArrayCommI.H

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,8 @@ FabArray<FAB>::ParallelCopy_nowait (const FabArray<FAB>& src,
578578
pcd->src = &src;
579579
pcd->op = op;
580580
pcd->tag = tag;
581+
// Deterministic GPU unpacking is currently implemented only for ADD.
582+
pcd->deterministic = deterministic && (op == FabArrayBase::ADD);
581583

582584
NC = std::min(NCompLeft,FabArrayBase::MaxComp);
583585
const bool last_iter = (NCompLeft == NC);
@@ -708,7 +710,8 @@ FabArray<FAB>::ParallelCopy_finish ()
708710
if (Gpu::inLaunchRegion())
709711
{
710712
unpack_recv_buffer_gpu(*this, pcd->DC, pcd->NC, pcd->recv_data, pcd->recv_size,
711-
recv_cctc, pcd->op, is_thread_safe, thecpc->m_id, false);
713+
recv_cctc, pcd->op, is_thread_safe, thecpc->m_id,
714+
pcd->deterministic);
712715
}
713716
else
714717
#endif

0 commit comments

Comments
 (0)