Skip to content

Add KokkosComm external package + detection in Tpetra#14135

Open
cwpearson wants to merge 2 commits intotrilinos:developfrom
cwpearson:feature/kokkos-comm-package
Open

Add KokkosComm external package + detection in Tpetra#14135
cwpearson wants to merge 2 commits intotrilinos:developfrom
cwpearson:feature/kokkos-comm-package

Conversation

@cwpearson
Copy link
Copy Markdown
Contributor

Add Kokkos Comm as an optional external package KokkosComm.

Kokkos Comm is maintained at https://github.com/kokkos/kokkos-comm

Corresponding PR to add TriBITS support to Kokkos Comm: kokkos/kokkos-comm#165

@trilinos/tpetra

Motivation

  • Facilitate research at transport layer
  • Improve Kokkos + MPI ergonomics

Testing

Currently, a single Tpetra unit test that checks that the KokkosComm headers can be included.

@cwpearson cwpearson self-assigned this Jun 18, 2025
@cwpearson cwpearson requested a review from a team as a code owner June 18, 2025 18:34
@github-actions
Copy link
Copy Markdown

CDash for AT1 results [Only accessible from Sandia networks]
CDash for AT2 results [Currently only accessible from Sandia networks]

@cwpearson cwpearson changed the title PackagesList.cmake: Add KokkosComm (optional external) Add KokkosComm external package + detection in Tpetra Jun 18, 2025
@trilinos-autotester
Copy link
Copy Markdown
Contributor

Status Flag 'Pre-Test Inspection' - Auto Inspected - Inspection is Not Necessary for this Pull Request.

@trilinos-autotester
Copy link
Copy Markdown
Contributor

Status Flag 'Pull Request AutoTester' - Testing Jenkins Projects:

Pull Request Auto Testing STARTING (click to expand)

Build Information

Test Name: PR_gcc-openmpi-openmp

  • Build Num: 1679
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel8_sems-gnu-8.5.0-openmpi-4.1.6-openmp_release-debug_static_no-kokkos-arch_no-asan_no-complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_no-package-enables
PR_LABELS
PULLREQUESTNUM 14135
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL rhel8
TRILINOS_SOURCE_REPO https://github.com/cwpearson/Trilinos
TRILINOS_SOURCE_SHA a81cfa4
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA a96ba6e

Build Information

Test Name: PR_clang

  • Build Num: 1726
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel8_sems-clang-11.0.1-openmpi-4.0.5-serial_release-debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_no-package-enables
PR_LABELS
PULLREQUESTNUM 14135
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL rhel8
TRILINOS_SOURCE_REPO https://github.com/cwpearson/Trilinos
TRILINOS_SOURCE_SHA a81cfa4
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA a96ba6e

Build Information

Test Name: PR_cuda-uvm

  • Build Num: 1725
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel8_sems-cuda-11.4.2-gnu-10.1.0-openmpi-4.1.6_release_static_Volta70_no-asan_complex_no-fpic_mpi_pt_no-rdc_uvm_deprecated-on_no-package-enables
PR_LABELS
PULLREQUESTNUM 14135
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL rhel8
TRILINOS_SOURCE_REPO https://github.com/cwpearson/Trilinos
TRILINOS_SOURCE_SHA a81cfa4
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA a96ba6e

Build Information

Test Name: PR_CompSim

  • Build Num: 28
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
BLOCKING_BUILD false
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel8_aue-gcc-openmpi_release_static_no-kokkos-arch_no-asan_complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_compsim
PR_LABELS
PULLREQUESTNUM 14135
PULLREQUEST_CDASH_TRACK Experimental
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL rhel8
TRILINOS_SOURCE_REPO https://github.com/cwpearson/Trilinos
TRILINOS_SOURCE_SHA a81cfa4
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA a96ba6e

Using Repos:

Repo: TRILINOS (cwpearson/Trilinos)
  • Branch: feature/kokkos-comm-package
  • SHA: a81cfa4
  • Mode: TEST_REPO

Pull Request Author: cwpearson

@cgcgcg
Copy link
Copy Markdown
Contributor

cgcgcg commented Jun 18, 2025

@bartlettroscoe Would you mind having a look to see if this is the correct way of adding an external package?

@cwpearson cwpearson requested a review from bartlettroscoe June 18, 2025 19:22
@trilinos-autotester
Copy link
Copy Markdown
Contributor

Status Flag 'Pull Request AutoTester' - Jenkins Testing: all Jobs PASSED

Pull Request Auto Testing has PASSED (click to expand)

Build Information

Test Name: PR_gcc-openmpi-openmp

  • Build Num: 1679
  • Status: PASSED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel8_sems-gnu-8.5.0-openmpi-4.1.6-openmp_release-debug_static_no-kokkos-arch_no-asan_no-complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_no-package-enables
PR_LABELS
PULLREQUESTNUM 14135
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL rhel8
TRILINOS_SOURCE_REPO https://github.com/cwpearson/Trilinos
TRILINOS_SOURCE_SHA a81cfa4
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA a96ba6e

Build Information

Test Name: PR_clang

  • Build Num: 1726
  • Status: PASSED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel8_sems-clang-11.0.1-openmpi-4.0.5-serial_release-debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_no-package-enables
PR_LABELS
PULLREQUESTNUM 14135
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL rhel8
TRILINOS_SOURCE_REPO https://github.com/cwpearson/Trilinos
TRILINOS_SOURCE_SHA a81cfa4
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA a96ba6e

Build Information

Test Name: PR_cuda-uvm

  • Build Num: 1725
  • Status: PASSED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel8_sems-cuda-11.4.2-gnu-10.1.0-openmpi-4.1.6_release_static_Volta70_no-asan_complex_no-fpic_mpi_pt_no-rdc_uvm_deprecated-on_no-package-enables
PR_LABELS
PULLREQUESTNUM 14135
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL rhel8
TRILINOS_SOURCE_REPO https://github.com/cwpearson/Trilinos
TRILINOS_SOURCE_SHA a81cfa4
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA a96ba6e

Build Information

Test Name: PR_CompSim

  • Build Num: 28
  • Status: PASSED

Jenkins Parameters

Parameter Name Value
BLOCKING_BUILD false
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel8_aue-gcc-openmpi_release_static_no-kokkos-arch_no-asan_complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_compsim
PR_LABELS
PULLREQUESTNUM 14135
PULLREQUEST_CDASH_TRACK Experimental
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL rhel8
TRILINOS_SOURCE_REPO https://github.com/cwpearson/Trilinos
TRILINOS_SOURCE_SHA a81cfa4
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA a96ba6e


CDash Test Results for PR# 14135.

@trilinos-autotester
Copy link
Copy Markdown
Contributor

Status Flag 'Pre-Merge Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging
NO REVIEWS HAVE BEEN PERFORMED ON THIS PULL REQUEST!

@trilinos-autotester
Copy link
Copy Markdown
Contributor

All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur...

@trilinos-autotester
Copy link
Copy Markdown
Contributor

All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur...

3 similar comments
@trilinos-autotester
Copy link
Copy Markdown
Contributor

All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur...

@trilinos-autotester
Copy link
Copy Markdown
Contributor

All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur...

@trilinos-autotester
Copy link
Copy Markdown
Contributor

All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur...

@trilinos-autotester
Copy link
Copy Markdown
Contributor

All Jobs Finished; status = PASSED, However PR is now STALE, and must be retested. Set the AT: RETEST Label to force retest....

Signed-off-by: Carl Pearson <cwpears@sandia.gov>
@cwpearson cwpearson force-pushed the feature/kokkos-comm-package branch from a81cfa4 to d4b7676 Compare June 24, 2025 22:51
@trilinos-autotester
Copy link
Copy Markdown
Contributor

Status Flag 'Pre-Test Inspection' - Auto Inspected - Inspection is Not Necessary for this Pull Request.

@trilinos-autotester
Copy link
Copy Markdown
Contributor

Status Flag 'Pull Request AutoTester' - Testing Jenkins Projects:

Pull Request Auto Testing STARTING (click to expand)

Build Information

Test Name: PR_gcc-openmpi-openmp

  • Build Num: 1701
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel8_sems-gnu-8.5.0-openmpi-4.1.6-openmp_release-debug_static_no-kokkos-arch_no-asan_no-complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_no-package-enables
PR_LABELS
PULLREQUESTNUM 14135
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL rhel8
TRILINOS_SOURCE_REPO https://github.com/cwpearson/Trilinos
TRILINOS_SOURCE_SHA d4b7676
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 4b81d3a

Build Information

Test Name: PR_clang

  • Build Num: 1748
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel8_sems-clang-11.0.1-openmpi-4.0.5-serial_release-debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_no-package-enables
PR_LABELS
PULLREQUESTNUM 14135
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL rhel8
TRILINOS_SOURCE_REPO https://github.com/cwpearson/Trilinos
TRILINOS_SOURCE_SHA d4b7676
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 4b81d3a

Build Information

Test Name: PR_cuda-uvm

  • Build Num: 1747
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel8_sems-cuda-11.4.2-gnu-10.1.0-openmpi-4.1.6_release_static_Volta70_no-asan_complex_no-fpic_mpi_pt_no-rdc_uvm_deprecated-on_no-package-enables
PR_LABELS
PULLREQUESTNUM 14135
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL rhel8
TRILINOS_SOURCE_REPO https://github.com/cwpearson/Trilinos
TRILINOS_SOURCE_SHA d4b7676
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 4b81d3a

Build Information

Test Name: PR_CompSim

  • Build Num: 49
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
BLOCKING_BUILD false
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel8_aue-gcc-openmpi_release_static_no-kokkos-arch_no-asan_complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_compsim
PR_LABELS
PULLREQUESTNUM 14135
PULLREQUEST_CDASH_TRACK Experimental
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL rhel8
TRILINOS_SOURCE_REPO https://github.com/cwpearson/Trilinos
TRILINOS_SOURCE_SHA d4b7676
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 4b81d3a

Using Repos:

Repo: TRILINOS (cwpearson/Trilinos)
  • Branch: feature/kokkos-comm-package
  • SHA: d4b7676
  • Mode: TEST_REPO

Pull Request Author: cwpearson

@trilinos-autotester
Copy link
Copy Markdown
Contributor

Status Flag 'Pull Request AutoTester' - Jenkins Testing: all Jobs PASSED

Pull Request Auto Testing has PASSED (click to expand)

Build Information

Test Name: PR_gcc-openmpi-openmp

  • Build Num: 1701
  • Status: PASSED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel8_sems-gnu-8.5.0-openmpi-4.1.6-openmp_release-debug_static_no-kokkos-arch_no-asan_no-complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_no-package-enables
PR_LABELS
PULLREQUESTNUM 14135
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL rhel8
TRILINOS_SOURCE_REPO https://github.com/cwpearson/Trilinos
TRILINOS_SOURCE_SHA d4b7676
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 4b81d3a

Build Information

Test Name: PR_clang

  • Build Num: 1748
  • Status: PASSED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel8_sems-clang-11.0.1-openmpi-4.0.5-serial_release-debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_no-package-enables
PR_LABELS
PULLREQUESTNUM 14135
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL rhel8
TRILINOS_SOURCE_REPO https://github.com/cwpearson/Trilinos
TRILINOS_SOURCE_SHA d4b7676
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 4b81d3a

Build Information

Test Name: PR_cuda-uvm

  • Build Num: 1747
  • Status: PASSED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel8_sems-cuda-11.4.2-gnu-10.1.0-openmpi-4.1.6_release_static_Volta70_no-asan_complex_no-fpic_mpi_pt_no-rdc_uvm_deprecated-on_no-package-enables
PR_LABELS
PULLREQUESTNUM 14135
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL rhel8
TRILINOS_SOURCE_REPO https://github.com/cwpearson/Trilinos
TRILINOS_SOURCE_SHA d4b7676
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 4b81d3a

Build Information

Test Name: PR_CompSim

  • Build Num: 49
  • Status: PASSED

Jenkins Parameters

Parameter Name Value
BLOCKING_BUILD false
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel8_aue-gcc-openmpi_release_static_no-kokkos-arch_no-asan_complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_compsim
PR_LABELS
PULLREQUESTNUM 14135
PULLREQUEST_CDASH_TRACK Experimental
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL rhel8
TRILINOS_SOURCE_REPO https://github.com/cwpearson/Trilinos
TRILINOS_SOURCE_SHA d4b7676
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 4b81d3a


CDash Test Results for PR# 14135.

@trilinos-autotester
Copy link
Copy Markdown
Contributor

Status Flag 'Pre-Merge Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging
NO REVIEWS HAVE BEEN PERFORMED ON THIS PULL REQUEST!

@trilinos-autotester
Copy link
Copy Markdown
Contributor

All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur...

3 similar comments
@trilinos-autotester
Copy link
Copy Markdown
Contributor

All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur...

@trilinos-autotester
Copy link
Copy Markdown
Contributor

All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur...

@trilinos-autotester
Copy link
Copy Markdown
Contributor

All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur...

@trilinos-autotester
Copy link
Copy Markdown
Contributor

All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur...

1 similar comment
@trilinos-autotester
Copy link
Copy Markdown
Contributor

All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur...

@trilinos-autotester
Copy link
Copy Markdown
Contributor

All Jobs Finished; status = PASSED, However PR is now STALE, and must be retested. Set the AT: RETEST Label to force retest....

Copy link
Copy Markdown
Member

@bartlettroscoe bartlettroscoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cwpearson, is the expected use case:

  1. Kokkos and KokkosComm (and perhaps KokkosKernels) are pre installed
  2. Trilinos is configured against pre-installed Kokkos, KokkosComm (and perhaps KokkosKernels) with -DTPL_ENABLE_Kokkos=ON, -DTPL_ENABLE_KokkosComm=ON (and -DTPL_ENABLE_KokkosKernels=ON?)

?

Is KokkosComm ever supposed to be built as part of Trilinos?

To be clear, how are you currently testing this? What configure options are you passing into Trilinos?

Shards packages/shards PT
Triutils packages/triutils ST
EpetraExt packages/epetraext ST
KokkosComm packages/kokkos-comm EX
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cwpearson, this line means that KokkosComm will be expected to be located under packages/kokkos-comm/ and can be built from source as part of Trilinos if someone enables Trilinos with Trilinos_ENABLE_KokkosComm=ON. I don't think that is what you want but since KokkosComm depends on the Kokkos package, which is also listed in this PackagesList.cmake file, you have no choice.

Also, this means the KokkosComm must be a TriBITS-compliant external package.

TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(SGM)
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(UMR)
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(TrilinosLinearSolvers)
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(KokkosComm)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, you have no choice but to add this since the directory packages/kokkos-comm does not exist.

We need to better specify this use case because, technically, a package like this should be defining its dependencies on upstream packages, which can't happen if the directory packages/kokkos-comm is missing. At the very least, the file packages/kokkos-comm/cmake/Dependencies.cmake should exist. TriBITS does not yet have explicit tests for this exact use case, which would also be a useful example for any future cases like this.

But with TriBITS-compliant external packages, it is harmless to not declare a dependency of KokkosComm on Kokkos if someone always configures Trilinos with -DTPL_ENABLE_Kokkos=ON when they are configuring with -DTPL_ENABLE_KokkosComm=ON.. The advantage of declaring a dependency of KokkosComm on Kokkos is that if someone configures Trilinos with just -DTPL_ENABLE_KokkosComm=ON, TriBITS will automatically assume Kokkos is already pre-installed and will also treat it as an external TriBITS compliant package (so you don't need to also set -DTPL_ENABLE_Kokkos=ON. Otherwise, if someone just configures Trilinos with -DTPL_ENABLE_KokkosComm=ON, TriBITS will try to enable and build the internal copy of Kokkos under packages/kokkos/ and that would be a huge mess with very confusing configure-time errors.

Comment on lines +819 to +832
# ============================================================
# Kokkos Comm
# ============================================================

IF (NOT DEFINED ${PACKAGE_NAME}_ENABLE_KokkosComm)
IF (DEFINED TpetraCore_ENABLE_KokkosComm)
SET (${PACKAGE_NAME}_ENABLE_KokkosComm "${TpetraCore_ENABLE_KokkosComm}")
ELSEIF (DEFINED TPL_ENABLE_KokkosComm)
SET (${PACKAGE_NAME}_ENABLE_KokkosComm "${TPL_ENABLE_KokkosComm}")
ELSE ()
SET (${PACKAGE_NAME}_ENABLE_KokkosComm OFF)
ENDIF ()
ENDIF ()
ASSERT_DEFINED (${PACKAGE_NAME}_ENABLE_KokkosComm)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why bother setting Tpetra_ENABLE_KokkosComm? The way this is defined, it will not get put into the generated TpetraConfig.cmake file. See tribits_pkg_export_cache_var().

My advice is not bother setting Tpetra_ENABLE_KokkosComm and just use the TriBITS-defined var TpetraCore_ENABLE_KokkosComm and be done with it. (And that is what the other code in this PR is using anyway, see below.)

Therefore, I would just rip out this block of code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, makes sense!

#cmakedefine HAVE_TPETRACORE_MPI_ADVANCE

/* Determine if we have the KokkosComm TPL */
#cmakedefine HAVE_TPETRACORE_KOKKOSCOMM
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This gets defined based on the value of TpetraCore_ENABLE_KokkosComm automatically. See:

There is no use for Tpetra_ENABLE_KokkosComm.

@@ -0,0 +1,12 @@
TRIBITS_SET_AND_INC_DIRS(DIR ${CMAKE_CURRENT_SOURCE_DIR})

IF (${PACKAGE_NAME}_ENABLE_KokkosComm)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: This variable ${PACKAGE_NAME}_ENABLE_KokkosComm will be named TpetraCore_ENABLE_KokkosComm because this is in the TpetraCore (sub)package. No need for Tpetra_ENABLE_KokkosComm.

As mentioned above, I would move this if() statement to the base-level directory CMakeLists.txt file.


int main(int argc, char* argv[])
{
return 0;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a dummy test driver to make sure this gets enabled, built, and run?

You will fill this in with real tests?

ImportExport
ImportExport2
inout
KokkosComm
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to move the if (${PACKAGE_NAME}_ENABLE_KokkosComm) statement to add these tests as:

if (${PACKAGE_NAME}_ENABLE_KokkosComm)
   add_subdirectory(KokkosComm)
endif()

so the build directory KokkosComm does not even get generated with KokkosComm is not enabled. (It was just be confusing the people to have this subdir exist if it was just empty.)

@trilinos-autotester
Copy link
Copy Markdown
Contributor

Status Flag 'Pre-Merge Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging
THE LAST COMMIT TO THIS PULL REQUEST HAS BEEN REVIEWED, BUT NOT ACCEPTED OR REQUIRES CHANGES!

@trilinos-autotester
Copy link
Copy Markdown
Contributor

All Jobs Finished; status = PASSED, However PR is now STALE, and must be retested. Set the AT: RETEST Label to force retest....

@cwpearson
Copy link
Copy Markdown
Contributor Author

@bartlettroscoe thanks!

Kokkos Comm is a very immature piece of the Kokkos ecosystem separately hosted here: https://github.com/kokkos/kokkos-comm.

I didn't want to start snapshotting Kokkos Comm into Trilinos yet, since it's very immature / unstable / has no history of sustained maintenance.

The vision is something like this:

  • Using Kokkos Comm + Tpetra is entirely opt-in (existing Trilinos builds unaffected)
  • People on the Tpetra team will be able to symlink (or otherwise add) the Kokkos Comm source into packages/kokkos-comm on their own computers and set some configure time flags to set up Tpetra with Kokkos Comm support.
    • correspondingly, Kokkos Comm would be a TriBITS-compliant package
  -DTPL_ENABLE_MPI=ON \
  -DTrilinos_ENABLE_KokkosComm=ON \

We have a corresponding PR in Kokkos Comm to make it TriBITS compliant: kokkos/kokkos-comm#165

  • Kokkos Comm would defer to TriBITs MPI handling under that mode

Does this approach make sense? Since Kokkos Comm relies on Kokkos, considering it a TPL didn't seem like the right path.

@bartlettroscoe
Copy link
Copy Markdown
Member

@cwpearson,

Kokkos Comm is a very immature piece of the Kokkos ecosystem separately hosted here: kokkos/kokkos-comm.

Okay, I can see from:

that you are going with raw CMake to create a TriBITS-compliant internal or external package:

like:

I didn't want to start snapshotting Kokkos Comm into Trilinos yet, since it's very immature / unstable / has no history of sustained maintenance.

Makes perfect sense. That is why we have the EX Experimental category and TriBITS supports missing packages👍

  -DTPL_ENABLE_MPI=ON \
  -DTrilinos_ENABLE_KokkosComm=ON \

Okay, so KokkosComm is actually currently being used as an internal TriBITS package (i.e., ${PACKAGE_NAME}_PACKAGE_BUILD_STATUS=INTERNAL, see tribits_get_package_enable_status() and Lists of external and internal packages).

Does this approach make sense? Since Kokkos Comm relies on Kokkos, considering it a TPL didn't seem like the right path.

In fact, since Kokkos is currently defined as an internal TriBITS package in Trilinos/PackagesList.cmake, you also have to define KokkosComm as an internal TriBITS package as well. (But of course, any internal TriBITS package subgraph can be treated as pre-installed TriBITS-compliant external packages.)

The title "Add KokkosComm external package ..." threw me off thinking the intent was to pre-build and pre-install KokkosComm. (If I had looked at the PR kokkos/kokkos-comm#165 beforehand, I would not have been confused at all 😊.)

Let me know if you have any other questions or would like a review of kokkos/kokkos-comm#165 (once it is ready).

@cwpearson
Copy link
Copy Markdown
Contributor Author

cwpearson commented Jul 1, 2025

@bartlettroscoe I will incorporate your suggestions and probably come back with some follow-ups.

@trilinos-autotester
Copy link
Copy Markdown
Contributor

All Jobs Finished; status = PASSED, However PR is now STALE, and must be retested. Set the AT: RETEST Label to force retest....

1 similar comment
@trilinos-autotester
Copy link
Copy Markdown
Contributor

All Jobs Finished; status = PASSED, However PR is now STALE, and must be retested. Set the AT: RETEST Label to force retest....

@bartlettroscoe
Copy link
Copy Markdown
Member

NOTE: I added the label AT: WIP to stop the AT1 notification emails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants