Skip to content

Commit

Permalink
Add test to make sure transform_mpi does not pass references to value…
Browse files Browse the repository at this point in the history
…s sent from previous senders
  • Loading branch information
msimberg committed Nov 14, 2024
1 parent 329ef2d commit 3afc0a7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libs/pika/async_mpi/tests/unit/algorithm_transform_mpi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,10 @@ int pika_main()
{
int data = 0, count = 1;
if (rank == 0) { data = 42; }
auto s = mpi::transform_mpi(
const_reference_sender<int>{count}, [&](int& count, MPI_Request* request) {
MPI_Ibcast(&data, count, datatype, 0, comm, request);
auto s = mpi::transform_mpi(const_reference_sender<int>{count},
[&](int& count_transform_mpi, MPI_Request* request) {
PIKA_TEST(&count_transform_mpi != &count);
MPI_Ibcast(&data, count_transform_mpi, datatype, 0, comm, request);
});
tt::sync_wait(PIKA_MOVE(s));
PIKA_TEST_EQ(data, 42);
Expand Down

0 comments on commit 3afc0a7

Please sign in to comment.