-
Notifications
You must be signed in to change notification settings - Fork 12
refactor: comm space generic datatype conversion #189
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
Merged
cedricchevalier19
merged 5 commits into
kokkos:develop
from
dssgabriel:refactor/datatype-conversion
Dec 8, 2025
Merged
refactor: comm space generic datatype conversion #189
cedricchevalier19
merged 5 commits into
kokkos:develop
from
dssgabriel:refactor/datatype-conversion
Dec 8, 2025
Conversation
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
CommunicationSpace-generic datatype conversion667eca0 to
aadfdca
Compare
Collaborator
Author
|
I am unsure why the Open MPI builds fail in the CI. Everything builds and passes on my machine with Open MPI 5.0.8 Here is my workflow for anyone willing to try and reproduce: spack load [email protected] [email protected] [email protected] [email protected]
mkdir -p build/_deps
# Kokkos 5.0.0 w/ OpenMP backend
git clone https://github.com/kokkos/kokkos.git --depth 1 --branch 5.0.0 build/_deps/kokkos-src
cmake -S build/_deps/kokkos-src -B build/_deps/kokkos-build-omp -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_EXTENSIONS=OFF -DKokkos_ENABLE_OPENMP=ON
cmake --build build/_deps/kokkos-build-omp -j
cmake --install build/_deps/kokkos-build-omp --prefix build/_deps/kokkos-install-omp
cmake -B build/kokkoscomm-mpi-omp -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_COLOR_DIAGNOSTICS=ON -DCMAKE_CXX_STANDARD=20 -DCMAKE_CXX_EXTENSIONS=OFF -DCMAKE_CXX_FLAGS='-Wall -Wextra -Wpedantic -Wmissing-include-dirs' -DKokkos_ROOT=build/_deps/kokkos-install-omp -DKokkosComm_ENABLE_MPI=ON -DKokkosComm_ENABLE_TESTS=ON -DKokkosComm_ENABLE_PERFTESTS=ON
cmake --build build/kokkoscomm-mpi-omp -j
ctest --test-dir build/kokkoscomm-mpi-omp --output-on-failure |
bc21ada to
fff3960
Compare
Member
|
@dssgabriel, a related? openmpi issue: open-mpi/ompi#10017. |
fff3960 to
ca0b82e
Compare
Signed-off-by: Gabriel Dos Santos <[email protected]>
Overhaul datatype conversion: - fully generic: over communication space & type - fully compile-time known - declarative-style (similar implementation strategy to e.g., `std::is_integral`) - exposed as top-level function in the KokkosComm:: namespace - not an implementation detail anymore (some tests were relying on it) Signed-off-by: Gabriel Dos Santos <[email protected]>
Signed-off-by: Gabriel Dos Santos <[email protected]>
Signed-off-by: Gabriel Dos Santos <[email protected]>
Signed-off-by: Gabriel Dos Santos <[email protected]>
ad037cd to
4911943
Compare
cedricchevalier19
approved these changes
Dec 8, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-core
Area: KokkosComm core library implementation
C-enhancement
Category: an enhancement or bug fix
SNL-CI-APPROVAL
Required to run SNL CI on non-SNL contributions
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.
This PR is based on #188 (so we'll need to merge that first) and leverages the newly introduced member type aliases on the comm space concept to implement a
CommunicationSpace-generic datatype conversion API. The present PR supersedes #186.The new implementation is generic over both the communication space and the base type to convert, and remains fully compile-time known.
Some notable changes:
if constexprstatements (similar implementation strategy to e.g.,std::is_integral)KokkosComm::namespacedatatype_for(T&&)utility so we can retrieve the datatype from a variable, e.g.:I have kept the
mpi/impl/types.hppfile for now, as it defines the logic for creating MPI datatypes (inmpi_view_type), although it appears this functionality is currently unused in Kokkos Comm.The remaining changes propagate this new API throughout the rest of the code base.