Skip to content

Commit

Permalink
adding support for openmpi's openshmem
Browse files Browse the repository at this point in the history
  • Loading branch information
ct-clmsn committed Oct 29, 2023
1 parent b50b269 commit d61a42a
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,7 @@ if(HPX_WITH_NETWORKING)
hpx_option(
HPX_WITH_PARCELPORT_OPENSHMEM_CONDUIT STRING
"Define which conduit to use for the OpenSHMEM parcelport" "sos"
STRINGS "sos;ucx"
STRINGS "sos;ucx;mpi"
)
endif()

Expand Down
39 changes: 37 additions & 2 deletions cmake/HPX_SetupOpenSHMEM.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,42 @@ macro(hpx_setup_openshmem)
if(NOT TARGET PkgConfig::OPENSHMEM)

set(OPENSHMEM_PC "")
if("${HPX_WITH_PARCELPORT_OPENSHMEM_CONDUIT}" STREQUAL "ucx")
if(HPX_WITH_PARCELPORT_MPI AND HPX_WITH_PARCELPORT_OPENSHMEM AND (NOT ("${HPX_WITH_PARCELPORT_OPENSHMEM_CONDUIT}" STREQUAL "mpi")))
message(FATAL "HPX_WITH_PARCELPORT_MPI & HPX_WITH_PARCELPORT_OPENSHMEM both set to ON and HPX_WITH_PARCELPORT_OPENSHMEM_CONDUIT != 'mpi'")

elseif(HPX_WITH_PARCELPORT_MPI AND HPX_WITH_PARCELPORT_OPENSHMEM AND HPX_WITH_FETCH_OPENSHMEM AND ("${HPX_WITH_PARCELPORT_OPENSHMEM_CONDUIT}" STREQUAL "mpi"))
message(
FATAL_ERROR
"HPX_WITH_FETCH_OPENSHMEM for HPX_WITH_PARCELPORT_OPENSHMEM and HPX_WITH_PARCELPORT_OPENSHMEM_CONDUIT='mpi' not supported"
)

elseif(HPX_WITH_PARCELPORT_MPI AND (MPI_FOUND OR Mpi::mpi) AND HPX_WITH_PARCELPORT_OPENSHMEM AND (NOT HPX_WITH_FETCH_OPENSHMEM) AND ("${HPX_WITH_PARCELPORT_OPENSHMEM_CONDUIT}" STREQUAL "mpi"))
set(OPENSHMEM_PC "oshmem-cxx")
pkg_search_module(OPENSHMEM IMPORTED_TARGET GLOBAL oshmem-cxx)

if(NOT OPENSHMEM_FOUND)
message(
FATAL_ERROR
"oshmem-cxx not found for HPX_WITH_PARCELPORT_MPI, HPX_WITH_PARCELPORT_OPENSHMEM, and HPX_WITH_PARCELPORT_OPENSHMEM_CONDUIT='mpi'"
)
endif()

set_target_properties(
PkgConfig::OPENSHMEM PROPERTIES INTERFACE_COMPILE_OPTIONS
"${OPENSHMEM_CFLAGS}"
)
set_target_properties(
PkgConfig::OPENSHMEM PROPERTIES INTERFACE_LINK_OPTIONS
"${OPENSHMEM_LDFLAGS}"
)
set_target_properties(
PkgConfig::OPENSHMEM PROPERTIES INTERFACE_LINK_DIRECTORIES
"${OPENSHMEM_LIBRARY_DIRS}"
)

return()

elseif("${HPX_WITH_PARCELPORT_OPENSHMEM_CONDUIT}" STREQUAL "ucx")
set(OPENSHMEM_PC "ucx")

pkg_search_module(UCX IMPORTED_TARGET GLOBAL ucx)
Expand All @@ -31,7 +66,7 @@ macro(hpx_setup_openshmem)
endif()
endif()

if((NOT OPENSHMEM_FOUND) AND HPX_WITH_FETCH_OPENSHMEM)
if((NOT OPENSHMEM_FOUND) AND HPX_WITH_FETCH_OPENSHMEM AND NOT ("${HPX_WITH_PARCELPORT_OPENSHMEM_CONDUIT}" STREQUAL "mpi"))
if(NOT CMAKE_C_COMPILER)
message(
FATAL_ERROR
Expand Down
3 changes: 0 additions & 3 deletions libs/core/openshmem_base/src/openshmem_environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
#include <hpx/modules/threading_base.hpp>
#include <hpx/modules/util.hpp>

#include <mpp/shmem-def.h>
#include <mpp/shmem.h>

#include <atomic>
#include <cstddef>
#include <cstdint>
Expand Down

0 comments on commit d61a42a

Please sign in to comment.