Skip to content

Commit c81cc8a

Browse files
hmenkeWentzell
authored andcommitted
get() and put() only make sense on the same rank without MPI
1 parent 0375e3c commit c81cc8a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

c++/mpi/window.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ namespace mpi {
301301
auto target_datatype = mpi_type<TargetType>::get();
302302
check_mpi_call(MPI_Get(origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count, target_datatype, win_), "MPI_Get");
303303
} else {
304+
ASSERT(target_rank == 0); // there are no other ranks
304305
std::copy(data_, data_ + target_count, origin_addr);
305306
}
306307
}
@@ -330,6 +331,7 @@ namespace mpi {
330331
auto target_datatype = mpi_type<TargetType>::get();
331332
check_mpi_call(MPI_Put(origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count, target_datatype, win_), "MPI_Put");
332333
} else {
334+
ASSERT(target_rank == 0); // there are no other ranks
333335
std::copy(origin_addr, origin_addr + origin_count, data_);
334336
}
335337
}

0 commit comments

Comments
 (0)