From ff00c5a446086ec40a2aed983ab45fe29ae6c6fc Mon Sep 17 00:00:00 2001 From: Marcin Krotkiewski Date: Tue, 20 Dec 2022 12:20:05 +0100 Subject: [PATCH] fix OOMPH_ANY_SOURCE for MPI backend --- src/communicator_base.hpp | 2 ++ src/mpi/communicator.hpp | 1 + src/ucx/endpoint.hpp | 2 -- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/communicator_base.hpp b/src/communicator_base.hpp index e491da43..87d6f3d6 100644 --- a/src/communicator_base.hpp +++ b/src/communicator_base.hpp @@ -14,6 +14,8 @@ namespace oomph { +#define OOMPH_ANY_SOURCE (int)-1 + template class communicator_base { diff --git a/src/mpi/communicator.hpp b/src/mpi/communicator.hpp index 21e5b167..d894e2ef 100644 --- a/src/mpi/communicator.hpp +++ b/src/mpi/communicator.hpp @@ -52,6 +52,7 @@ class communicator_impl : public communicator_base { MPI_Request r; device_guard dg(ptr); + if(OOMPH_ANY_SOURCE == src) src = MPI_ANY_SOURCE; OOMPH_CHECK_MPI_RESULT(MPI_Irecv(dg.data(), size, MPI_BYTE, src, tag, mpi_comm(), &r)); return {r}; } diff --git a/src/ucx/endpoint.hpp b/src/ucx/endpoint.hpp index 22c5cd61..66440987 100644 --- a/src/ucx/endpoint.hpp +++ b/src/ucx/endpoint.hpp @@ -16,8 +16,6 @@ namespace oomph { -#define OOMPH_ANY_SOURCE (int)-1 - struct endpoint_t { using rank_type = communicator::rank_type;