Skip to content

Commit

Permalink
MPI sender correction
Browse files Browse the repository at this point in the history
  • Loading branch information
isidorostsa committed Jun 5, 2024
1 parent a8d51fe commit 7838bb1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
6 changes: 6 additions & 0 deletions libs/core/async_mpi/include/hpx/async_mpi/transform_mpi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ namespace hpx { namespace mpi { namespace experimental {
template <typename R, typename F>
struct transform_mpi_receiver
{
#ifdef HPX_HAVE_STDEXEC
using is_receiver = void;
#endif
HPX_NO_UNIQUE_ADDRESS std::decay_t<R> r;
HPX_NO_UNIQUE_ADDRESS std::decay_t<F> f;

Expand Down Expand Up @@ -143,6 +146,9 @@ namespace hpx { namespace mpi { namespace experimental {
template <typename Sender, typename F>
struct transform_mpi_sender
{
#ifdef HPX_HAVE_STDEXEC
using is_sender = void;
#endif
HPX_NO_UNIQUE_ADDRESS std::decay_t<Sender> s;
HPX_NO_UNIQUE_ADDRESS std::decay_t<F> f;

Expand Down
19 changes: 8 additions & 11 deletions libs/core/async_mpi/tests/unit/algorithm_transform_mpi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ int hpx_main()
data = 42;
}
auto result =
hpx::get<0>(*(ex::just(&data, count, datatype, 0, comm) |
mpi::transform_mpi(MPI_Ibcast) | tt::sync_wait()));
hpx::get<0>(*tt::sync_wait(ex::just(&data, count, datatype, 0, comm) |
mpi::transform_mpi(MPI_Ibcast)));
if (rank != 0)
{
HPX_TEST_EQ(data, 42);
Expand All @@ -160,10 +160,9 @@ int hpx_main()
bool exception_thrown = false;
try
{
mpi::transform_mpi(
tt::sync_wait(mpi::transform_mpi(
error_sender<int*, int, MPI_Datatype, int, MPI_Comm>{},
MPI_Ibcast) |
tt::sync_wait();
MPI_Ibcast));
HPX_TEST(false);
}
catch (std::runtime_error const& e)
Expand Down Expand Up @@ -207,9 +206,8 @@ int hpx_main()
bool exception_thrown = false;
try
{
mpi::transform_mpi(
ex::just(data, count, datatype, -1, comm), MPI_Ibcast) |
tt::sync_wait();
tt::sync_wait(mpi::transform_mpi(
ex::just(data, count, datatype, -1, comm), MPI_Ibcast));
HPX_TEST(false);
}
catch (std::runtime_error const& e)
Expand All @@ -232,9 +230,8 @@ int hpx_main()
bool exception_thrown = false;
try
{
mpi::transform_mpi(
ex::just(data, count, datatype, -1, comm), MPI_Ibcast) |
tt::sync_wait();
tt::sync_wait(mpi::transform_mpi(
ex::just(data, count, datatype, -1, comm), MPI_Ibcast));
HPX_TEST(false);
}
catch (std::runtime_error const&)
Expand Down

0 comments on commit 7838bb1

Please sign in to comment.