From 19731869d365caaf7f37db73949d97c018e06054 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Mon, 13 May 2024 18:10:36 +0200 Subject: [PATCH] Utility header to convert to native mpi handles --- libsrc/core/CMakeLists.txt | 2 +- libsrc/core/ng_mpi_native.hpp | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 libsrc/core/ng_mpi_native.hpp diff --git a/libsrc/core/CMakeLists.txt b/libsrc/core/CMakeLists.txt index 71cbf0bc..eca94b8c 100644 --- a/libsrc/core/CMakeLists.txt +++ b/libsrc/core/CMakeLists.txt @@ -93,7 +93,7 @@ install(FILES ngcore.hpp archive.hpp type_traits.hpp version.hpp ngcore_api.hpp xbool.hpp signal.hpp bitarray.hpp table.hpp hashtable.hpp ranges.hpp ngstream.hpp simd.hpp simd_avx.hpp simd_avx512.hpp simd_generic.hpp simd_sse.hpp simd_arm64.hpp register_archive.hpp autodiff.hpp autodiffdiff.hpp - ng_mpi.hpp ng_mpi_generated_declarations.hpp + ng_mpi.hpp ng_mpi_generated_declarations.hpp ng_mpi_native.hpp DESTINATION ${NG_INSTALL_DIR_INCLUDE}/core COMPONENT netgen_devel) if(ENABLE_CPP_CORE_GUIDELINES_CHECK) diff --git a/libsrc/core/ng_mpi_native.hpp b/libsrc/core/ng_mpi_native.hpp new file mode 100644 index 00000000..6c8f40ce --- /dev/null +++ b/libsrc/core/ng_mpi_native.hpp @@ -0,0 +1,21 @@ +#ifndef NG_MPI_NATIVE_HPP +#define NG_MPI_NATIVE_HPP + +#include + +#include "mpi_wrapper.hpp" +#include "ng_mpi.hpp" + +namespace ngcore { + +MPI_Comm NG_MPI_Native(NG_MPI_Comm comm) { + return reinterpret_cast(comm.value); +} + +MPI_Comm NG_MPI_Native(NgMPI_Comm comm) { + return reinterpret_cast(static_cast(comm).value); +} + +} // namespace ngcore + +#endif // NG_MPI_NATIVE_HPP