Repository navigation
openshmem parcelport #7519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ct-clmsn
wants to merge
29
commits into
TheHPXProject:master
Choose a base branch
from
ct-clmsn:openshmem_parcelport_fall2026
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+4,515
−5
Open
openshmem parcelport #7519
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
3dcb0aa
initial import of functional openshmem parcelport
bec99c8
updated copyrights
176a965
minor updates to comments
c130fb1
fixes asio compilation issue
2fa6609
clang formatting fixes
309320d
formatting changes
c963497
cmake formatting fixes
1f2588b
Restore original parcelport_gasnet.cpp
2546acc
Update locality.hpp
ct-clmsn 7f57555
working openshmem parcelport
ce8e814
multiple updates to fix hpx.parcel.openshmem.uniform_check
1a8f2c2
performance improvements for openshmem parcelport - thanks to constra…
816df39
Fix OpenSHMEM parcelport startup, delivery and shutdown
constracktor 2a12d58
Run OpenSHMEM parcelport tests in gcc-14 CI
constracktor 4065371
Apply clang-format to OpenSHMEM parcelport changes
constracktor 79925ac
Keep OpenSHMEM parcelport inert when not selected
constracktor 4c184e7
Run OpenSHMEM tests on UCX shared-memory transports
constracktor d46dc40
Install the OpenSHMEM mailbox header
constracktor a04e86f
Remove unused code and stats from the OpenSHMEM parcelport, load coun…
constracktor 28853fa
Handle OpenSHMEM counter wrap-around and acquire the counters
constracktor c1911a7
Link OpenSHMEM by full paths, accept unbuilt parcelports in hpxrun.py
hkaiser f50246e
Document building and running HPX with the OpenSHMEM parcelport
hkaiser 6b01337
Address review comments on the OpenSHMEM parcelport
hkaiser 88c2719
Apply clang-format and cmake-format, fix inspect issues
hkaiser f4c94fa
Give the localities on one host different cores
hkaiser d0a84cb
Progress the OpenSHMEM parcelport from the worker threads by default
hkaiser 6912c54
Document how the OpenSHMEM parcelport sends and receives parcels
hkaiser 8c247f3
Let the processes agree on the symmetric heap address in hpxrun.py
hkaiser e87b932
Include <utility> for std::swap in the OpenSHMEM receiver
hkaiser File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| # Copyright (c) 2025 The STE||AR-Group | ||
| # | ||
| # SPDX-License-Identifier: BSL-1.0 | ||
| # Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
| # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
|
|
||
| macro(find_openshmem) | ||
| # Only Open MPI's OpenSHMEM is supported. The package is located through | ||
| # pkg-config (pkg_check_modules uses PKG_CONFIG_PATH and the standard install | ||
| # locations), i.e. via the oshmem-c.pc, oshmem.pc or oshmem-cxx.pc module | ||
| # files. oshmem-c/oshmem are preferred because they carry the -loshmem link | ||
| # flag. | ||
| find_package(PkgConfig QUIET) | ||
| if(NOT PKG_CONFIG_FOUND) | ||
| hpx_error("pkg-config was not found; OpenSHMEM detection requires it") | ||
| endif() | ||
|
|
||
| set(_oshmem_pkg_names oshmem-c oshmem oshmem-cxx) | ||
| foreach(_pkg ${_oshmem_pkg_names}) | ||
| pkg_check_modules(OSHMEM QUIET IMPORTED_TARGET GLOBAL ${_pkg}) | ||
| if(OSHMEM_FOUND) | ||
| set(OpenSHMEM_PKG ${_pkg}) | ||
| break() | ||
| endif() | ||
| endforeach() | ||
|
|
||
| set(OpenSHMEM_FOUND ${OSHMEM_FOUND}) | ||
|
|
||
| if(NOT OpenSHMEM_FOUND) | ||
| hpx_error( | ||
| "Could not find Open MPI OpenSHMEM. Tried: ${_oshmem_pkg_names}. " | ||
| "Please set PKG_CONFIG_PATH to the directory containing the oshmem.pc " | ||
| "module files." | ||
| ) | ||
| endif() | ||
|
|
||
| if(NOT OSHMEM_INCLUDE_DIRS OR NOT (OSHMEM_LIBRARY_DIRS OR OSHMEM_LIBRARIES)) | ||
| hpx_error( | ||
| "Could not find OSHMEM_INCLUDE_DIRS or OSHMEM_LIBRARIES/OSHMEM_LIBRARY_DIRS" | ||
| ) | ||
| endif() | ||
|
|
||
| # Open MPI's oshmem moves data through its `osc/ucp` component, so a | ||
| # UCX-enabled Open MPI is required for the transport to work at all. The UCX | ||
| # libraries only appear in pkg-config's `Libs.private` field; the | ||
| # pkg_check_modules call above exposes those through the generated | ||
| # <prefix>_STATIC_* results, which are used here for inspection only. The | ||
| # link line derived from the static query is intentionally not used: it drags | ||
| # in Open MPI's own private dependencies (libevent, hwloc, pmix) that would | ||
| # clash with HPX's copies. | ||
| if(NOT DEFINED HPX_OPENSHMEM_REQUIRE_UCX) | ||
| set(HPX_OPENSHMEM_REQUIRE_UCX | ||
| FALSE | ||
| CACHE BOOL | ||
| "Fail the OpenSHMEM detection if UCX was not enabled in Open MPI" | ||
| ) | ||
| endif() | ||
|
|
||
| set(OpenSHMEM_UCX_FOUND FALSE) | ||
| set(OpenSHMEM_UCX_LIBRARIES "") | ||
| set(OpenSHMEM_UCX_LIBRARY_DIRS "") | ||
|
|
||
| # An oshmem module built with `--with-ucx=...` records -lucp -luct -lucs -lucm | ||
| # in `Libs.private`. Match the library names rather than directory names so | ||
| # that a UCX installed in a non-standard location still matches. | ||
| set(_oshmem_ucx_libs "") | ||
| foreach(_lib IN LISTS OSHMEM_STATIC_LIBRARIES) | ||
| if(_lib MATCHES "^(ucp|uct|ucs|ucm)$") | ||
| list(APPEND _oshmem_ucx_libs "${_lib}") | ||
| endif() | ||
| endforeach() | ||
|
|
||
| if(_oshmem_ucx_libs) | ||
| set(OpenSHMEM_UCX_FOUND TRUE) | ||
|
|
||
| # Resolve each flag to the same directory Open MPI recorded, so that the | ||
| # linker cannot silently satisfy -lucp from a different UCX that happened to | ||
| # sit on the default search path. | ||
| foreach(_lib IN LISTS _oshmem_ucx_libs) | ||
| set(_ucx_lib "") | ||
| foreach(_dir IN LISTS OSHMEM_STATIC_LIBRARY_DIRS) | ||
| if(EXISTS "${_dir}/lib${_lib}${CMAKE_SHARED_LIBRARY_SUFFIX}") | ||
| set(_ucx_lib "${_dir}/lib${_lib}${CMAKE_SHARED_LIBRARY_SUFFIX}") | ||
| list(APPEND OpenSHMEM_UCX_LIBRARY_DIRS "${_dir}") | ||
| break() | ||
| endif() | ||
| endforeach() | ||
|
|
||
| if(_ucx_lib) | ||
| list(APPEND OpenSHMEM_UCX_LIBRARIES "${_ucx_lib}") | ||
| else() | ||
| # No matching file next to the other Open MPI libraries; fall back to | ||
| # the plain -l flag and let the linker resolve it. | ||
| list(APPEND OpenSHMEM_UCX_LIBRARIES "-l${_lib}") | ||
| endif() | ||
| endforeach() | ||
|
|
||
| if(OpenSHMEM_UCX_LIBRARY_DIRS) | ||
| list(REMOVE_DUPLICATES OpenSHMEM_UCX_LIBRARY_DIRS) | ||
| endif() | ||
|
|
||
| hpx_info("OpenSHMEM: UCX detected in Open MPI's private libraries: " | ||
| "${OpenSHMEM_UCX_LIBRARIES}" | ||
| ) | ||
| else() | ||
| set(_oshmem_ucx_hint | ||
| "OpenSHMEM was found, but UCX does not appear in the private " | ||
| "libraries of '${OpenSHMEM_PKG}.pc'. Open MPI was most likely built " | ||
| "without '--with-ucx', in which case it has no 'osc/ucp' component " | ||
| "and Open SHMEM data movement will not work as expected." | ||
| ) | ||
|
|
||
| if(HPX_OPENSHMEM_REQUIRE_UCX) | ||
| hpx_error("${_oshmem_ucx_hint}") | ||
| else() | ||
| hpx_warn("${_oshmem_ucx_hint}") | ||
| hpx_warn( | ||
| "Set '-DHPX_OPENSHMEM_REQUIRE_UCX=ON' to turn this into a hard error." | ||
| ) | ||
| endif() | ||
| endif() | ||
|
|
||
| message(STATUS "Found OpenSHMEM (${OpenSHMEM_PKG}): ${OSHMEM_INCLUDE_DIRS}") | ||
| endmacro() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| # Copyright (c) 2025 The STE||AR-Group | ||
| # | ||
| # SPDX-License-Identifier: BSL-1.0 | ||
| # Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
| # file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
|
|
||
| include(HPX_Message) | ||
| include(${CMAKE_CURRENT_LIST_DIR}/FindOpenSHMEM.cmake) | ||
|
|
||
| macro(hpx_setup_openshmem) | ||
| if(NOT TARGET OpenSHMEM::openshmem) | ||
|
|
||
| # When this macro runs at HPX build time the OpenSHMEM location is detected | ||
| # through pkg-config (oshmem-c/oshmem/oshmem-cxx) and the resulting values | ||
| # are cached. When it runs on a consumer (find_package(HPX)) the cached | ||
| # values are reused as-is, so the consumer needs neither pkg-config nor the | ||
| # oshmem module files themselves. | ||
| if(NOT HPX_OPENSHMEM_LIBRARIES) | ||
|
|
||
| find_openshmem() | ||
|
|
||
| if(NOT OpenSHMEM_FOUND) | ||
| hpx_error("OpenSHMEM was not found") | ||
| endif() | ||
|
|
||
| if(COMMAND hpx_add_config_define) | ||
| hpx_add_config_define(HPX_HAVE_PARCELPORT_OPENSHMEM) | ||
| endif() | ||
|
|
||
| # `OSHMEM_LIBRARIES` is derived from the public `Libs` field only, so it | ||
| # does not carry the UCX libraries that Open MPI keeps in `Libs.private`. | ||
| # A shared link picks those up transitively through liboshmem.so's | ||
| # DT_NEEDED entries; a static link does not, so append the explicitly | ||
| # resolved UCX paths in that case. The paths are absolute, so they cannot | ||
| # be satisfied by a different UCX on the default search path. Use the full | ||
| # paths: OSHMEM_LIBRARIES has only the names, without directories. | ||
| set(_oshmem_link_libraries "${OSHMEM_LINK_LIBRARIES}") | ||
| if(HPX_OPENSHMEM_REQUIRE_UCX AND OpenSHMEM_UCX_LIBRARIES) | ||
| list(APPEND _oshmem_link_libraries ${OpenSHMEM_UCX_LIBRARIES}) | ||
| endif() | ||
|
|
||
| set(HPX_OPENSHMEM_LIBRARIES | ||
| "${_oshmem_link_libraries}" | ||
| CACHE INTERNAL "OpenSHMEM libraries" FORCE | ||
| ) | ||
| set(HPX_OPENSHMEM_INCLUDE_DIRS | ||
| "${OSHMEM_INCLUDE_DIRS}" | ||
| CACHE INTERNAL "OpenSHMEM include directories" FORCE | ||
| ) | ||
| set(HPX_OPENSHMEM_UCX_LIBRARIES | ||
| "${OpenSHMEM_UCX_LIBRARIES}" | ||
| CACHE INTERNAL "UCX libraries backing this OpenSHMEM installation" | ||
| FORCE | ||
| ) | ||
| endif() | ||
|
|
||
| add_library(OpenSHMEM::openshmem INTERFACE IMPORTED GLOBAL) | ||
| set_target_properties( | ||
| OpenSHMEM::openshmem | ||
| PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${HPX_OPENSHMEM_INCLUDE_DIRS}" | ||
| INTERFACE_LINK_LIBRARIES "${HPX_OPENSHMEM_LIBRARIES}" | ||
| ) | ||
|
|
||
| hpx_info("OpenSHMEM libraries: ${HPX_OPENSHMEM_LIBRARIES}") | ||
| hpx_info("OpenSHMEM include dirs: ${HPX_OPENSHMEM_INCLUDE_DIRS}") | ||
| hpx_info("OpenSHMEM UCX libraries: ${HPX_OPENSHMEM_UCX_LIBRARIES}") | ||
| endif() | ||
| endmacro() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.