Skip to content
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

Kokkos: Avoid using TriBITS in Kokkos #11779

Closed

Conversation

masterleinad
Copy link
Contributor

@masterleinad masterleinad commented Apr 10, 2023

@trilinos/kokkos @bartlettroscoe

Motivation

Currently, we are essentially using three build systems in Kokkos:

  • Makefile-based (only supported for using Kokkos inline, not standalone)
  • raw CMake
  • through Trilinos using TriBITS

We discussed that we want to try to lighten that burden by removing a full TriBITS option by only providing only necessary additions to the raw CMake build system. This pull request explores doing this.

Related Issues

Testing

Compiling Trilinos locally

Additional Information

This is not fully working yet. I can compile Trilinos but we don't export Kokkos in a way usable for exporting other libraries depending on Kokkos.

@trilinos-autotester
Copy link
Contributor

Status Flag 'Pre-Test Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging
NO INSPECTION HAS BEEN PERFORMED ON THIS PULL REQUEST! - This PR must be inspected by setting label 'AT: PRE-TEST INSPECTED'.

@bartlettroscoe bartlettroscoe added the AT: WIP Causes the PR autotester to not test the PR. (Remove to allow testing to occur.) label Apr 10, 2023
@bartlettroscoe
Copy link
Member

@masterleinad, what about defining and running tests in a Trilinos build with internal Kokkos? Would that be supported?

I will submit a sister PR to remove the usage of subpackages from the Kokkos TriBITS build and the rest of the Trilinos packages at the end of this week.

@masterleinad
Copy link
Contributor Author

@masterleinad, what about defining and running tests in a Trilinos build with internal Kokkos? Would that be supported?

We can discuss if it's acceptable to temporarily disable all Kokkos tests in Trilinos. My preference would be to reenable them in a later pull request, though.

@crtrott
Copy link
Member

crtrott commented Apr 11, 2023

Agreed I think we start with just not having tests for Kokkos itself enabled in Trilinos and then go from there.

@bartlettroscoe
Copy link
Member

Agreed I think we start with just not having tests for Kokkos itself enabled in Trilinos and then go from there.

From what I have seen a part of #11808 and kokkos/kokkos#6104 I don't see why you would have to disable Kokkos tests with the native Kokkos CMake build system when building Kokkos under Trilinos. It already responds to the options Kokkos_ENABLE_TESTS and Kokkos_ENABLE_EXAMPLES which are standard TriBITS options.

The more challenging part will be generating a KokkosConfig.cmake file for the build dir and the install dir and such issues. (And that has to be done or we break Trilinos for customers currently getting Trilinos from find_package(Trilinos).)

@masterleinad
Copy link
Contributor Author

The more challenging part will be generating a KokkosConfig.cmake file for the build dir and the install dir and such issues.

See kokkos/kokkos#6078.

@masterleinad masterleinad force-pushed the avoid_tribits_kokkos branch from a0168b1 to b8c45ed Compare May 5, 2023 16:22
@@ -867,7 +867,7 @@ macro(tribits_package_postprocess)
tribits_package_finalize_dependency_vars()
tribits_package_postprocess_common()

if (${PACKAGE_NAME}_SOURCE_DIR STREQUAL ${PROJECT_NAME}_SOURCE_DIR)
if (${PACKAGE_NAME}_SOURCE_DIR STREQUAL ${CMAKE_PROJECT_NAME}_SOURCE_DIR)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bartlettroscoe What do you think about this change? This allows using project in Kokkos.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, the change from PROJECT_NAME to CMAKE_PROJECT_NAME needs to be made throughout TriBITS to address this issue and allow calls to project() from individual packages.

In addition, TriBITS will need to change ${PROJECT_SOURCE_DIR} and ${PROJECT_BINARY_DIR} to ${${CMAKE_PROJECT_NAME}_PROJECT_SOURCE_DIR} and ${{${CMAKE_PROJECT_NAME}_PROJECT_BINARY_DIR}, respectively, almost everywhere.

Would you mind creating a TriBITS GitHUb issue for this and point out the places where you had to make this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -2177,7 +2177,7 @@ macro(tribits_configure_enabled_packages)
endif()
if (NOT ${PACKAGE_NAME}_TRIBITS_PACKAGE_POSTPROCESS)
tribits_report_invalid_tribits_usage(
Copy link
Member

@bartlettroscoe bartlettroscoe May 18, 2023

Choose a reason for hiding this comment

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

I think I will be able to adjust the logic to avoid this check if the target ${PACKAGE_NAME}::all_libs is already defined.

I will be creating a PR that will duplicate this Kokkos use case (i.e. using a raw CMake build system for a TriBITS-compliant internal package that does not call any TrBITS functions). This is one of the issues I will hit with that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that would be good. I think we would rather define the target then calling tribits_package_postprocess().

@bartlettroscoe
Copy link
Member

CC: @jwillenbring, @sebrowne, @rppawlo, @ccober6, @jhux2

FYI: If the native Kokkos CMake build system does not use tribits_add_test() (or have the equivalent behavior), then this this will break the Trilinos PR builds because of the need to be able surgically disable tests (and even individual GTest unit tests). For example, see #11940 (comment). (I.e. there is more to managing tests than just calling add_test().)

So perhaps it is best to just disable Kokkos tests when building under Trilinos for the foreseeable future?

@masterleinad masterleinad force-pushed the avoid_tribits_kokkos branch from 2f4b430 to 0379a15 Compare June 2, 2023 13:59
@masterleinad masterleinad force-pushed the avoid_tribits_kokkos branch from 0379a15 to 0a7d48b Compare June 2, 2023 14:01
@masterleinad
Copy link
Contributor Author

So perhaps it is best to just disable Kokkos tests when building under Trilinos for the foreseeable future?

Yes, let me hardcode that.
@bartlettroscoe Any other comments on the pull request? Is there anything obvious I am conceptionally missing for this to work? Otherwise, I would appreciate getting some CI running on this.

@bartlettroscoe bartlettroscoe added AT: PRE-TEST INSPECTED Required to test outside contributions. This label alone will not allow a PR to merge. and removed AT: WIP Causes the PR autotester to not test the PR. (Remove to allow testing to occur.) labels Jun 2, 2023
@bartlettroscoe
Copy link
Member

@masterleinad,

So perhaps it is best to just disable Kokkos tests when building under Trilinos for the foreseeable future?

Yes, let me hardcode that.

Not being able to run Kokkos tests when someone is building Trilinos on a new platform is a bit sketchy. Perhaps just disable the native Kokkos tests by default for all Trilinos builds but allow the user to enable them if they would like? Issues like #11940 (comment) are mostly a problem for automated testing that can't tolerate random failures.

I would appreciate getting some CI running on this.

I removed the label AT: WIP and set the label AT: PRE-TEST INSPECTED so the autotester should run to test this.

I will work on the TriBITS test and changes for this use case.

@trilinos-autotester trilinos-autotester removed the AT: PRE-TEST INSPECTED Required to test outside contributions. This label alone will not allow a PR to merge. label Jun 2, 2023
@trilinos-autotester
Copy link
Contributor

Status Flag 'Pre-Test Inspection' - SUCCESS: The last commit to this Pull Request has been INSPECTED by label AT: PRE-TEST INSPECTED! Autotester is Removing Label; This inspection will remain valid until a new commit to source branch is performed.

@trilinos-autotester
Copy link
Contributor

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

Pull Request Auto Testing STARTING (click to expand)

Build Information

Test Name: Trilinos_PR_gcc-8.3.0

  • Build Num: 2326
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel7_sems-gnu-8.3.0-openmpi-1.10.1-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 11779
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL trilinos-any
TRILINOS_SOURCE_BRANCH avoid_tribits_kokkos
TRILINOS_SOURCE_REPO https://github.com/masterleinad/Trilinos
TRILINOS_SOURCE_SHA 0a7d48b
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 8194354

Build Information

Test Name: Trilinos_PR_gcc-8.3.0-serial

  • Build Num: 854
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel7_sems-v2-gnu-8.3.0-serial_release-debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_no-mpi_no-pt_no-rdc_no-uvm_deprecated-on_no-package-enables
PR_LABELS
PULLREQUESTNUM 11779
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL trilinos-any
TRILINOS_SOURCE_BRANCH avoid_tribits_kokkos
TRILINOS_SOURCE_REPO https://github.com/masterleinad/Trilinos
TRILINOS_SOURCE_SHA 0a7d48b
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 8194354

Build Information

Test Name: Trilinos_PR_gcc-8.3.0-debug

  • Build Num: 846
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel7_sems-gnu-8.3.0-openmpi-1.10.1-serial_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 11779
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL trilinos-any
TRILINOS_SOURCE_BRANCH avoid_tribits_kokkos
TRILINOS_SOURCE_REPO https://github.com/masterleinad/Trilinos
TRILINOS_SOURCE_SHA 0a7d48b
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 8194354

Build Information

Test Name: Trilinos_PR_clang-11.0.1

  • Build Num: 845
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel7_sems-clang-11.0.1-openmpi-1.10.1-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 11779
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL trilinos-any
TRILINOS_SOURCE_BRANCH avoid_tribits_kokkos
TRILINOS_SOURCE_REPO https://github.com/masterleinad/Trilinos
TRILINOS_SOURCE_SHA 0a7d48b
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 8194354

Build Information

Test Name: Trilinos_PR_python3

  • Build Num: 2074
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel7_sems-gnu-7.2.0-anaconda3-serial_debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_no-mpi_no-pt_no-rdc_no-uvm_deprecated-on_pr-framework
PR_LABELS
PULLREQUESTNUM 11779
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL ascic
TRILINOS_SOURCE_BRANCH avoid_tribits_kokkos
TRILINOS_SOURCE_REPO https://github.com/masterleinad/Trilinos
TRILINOS_SOURCE_SHA 0a7d48b
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 8194354

Build Information

Test Name: Trilinos_PR_cuda-11.4.2-uvm-off

  • Build Num: 1847
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel7_sems-cuda-11.4.2-sems-gnu-10.1.0-sems-openmpi-4.0.5_release_static_Volta70_no-asan_complex_no-fpic_mpi_pt_no-rdc_no-uvm_deprecated-on_no-package-enables
PR_LABELS
PULLREQUESTNUM 11779
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL GPU
TRILINOS_SOURCE_BRANCH avoid_tribits_kokkos
TRILINOS_SOURCE_REPO https://github.com/masterleinad/Trilinos
TRILINOS_SOURCE_SHA 0a7d48b
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 8194354

Build Information

Test Name: Trilinos_PR_intel-2021.3

  • Build Num: 485
  • Status: STARTED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel7_sems-intel-2021.3-sems-openmpi-4.0.5_release-debug_shared_no-kokkos-arch_no-asan_no-complex_fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_no-package-enables
PR_LABELS
PULLREQUESTNUM 11779
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL trilinos-any
TRILINOS_SOURCE_BRANCH avoid_tribits_kokkos
TRILINOS_SOURCE_REPO https://github.com/masterleinad/Trilinos
TRILINOS_SOURCE_SHA 0a7d48b
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 8194354

Using Repos:

Repo: TRILINOS (masterleinad/Trilinos)
  • Branch: avoid_tribits_kokkos
  • SHA: 0a7d48b
  • Mode: TEST_REPO

Pull Request Author: masterleinad

@trilinos-autotester
Copy link
Contributor

Status Flag 'Pull Request AutoTester' - Jenkins Testing: 1 or more Jobs FAILED

Note: Testing will normally be attempted again in approx. 2 Hrs 30 Mins. If a change to the PR source branch occurs, the testing will be attempted again on next available autotester run.

Pull Request Auto Testing has FAILED (click to expand)

Build Information

Test Name: Trilinos_PR_gcc-8.3.0

  • Build Num: 2326
  • Status: FAILED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel7_sems-gnu-8.3.0-openmpi-1.10.1-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 11779
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL trilinos-any
TRILINOS_SOURCE_BRANCH avoid_tribits_kokkos
TRILINOS_SOURCE_REPO https://github.com/masterleinad/Trilinos
TRILINOS_SOURCE_SHA 0a7d48b
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 8194354

Build Information

Test Name: Trilinos_PR_gcc-8.3.0-serial

  • Build Num: 854
  • Status: FAILED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel7_sems-v2-gnu-8.3.0-serial_release-debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_no-mpi_no-pt_no-rdc_no-uvm_deprecated-on_no-package-enables
PR_LABELS
PULLREQUESTNUM 11779
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL trilinos-any
TRILINOS_SOURCE_BRANCH avoid_tribits_kokkos
TRILINOS_SOURCE_REPO https://github.com/masterleinad/Trilinos
TRILINOS_SOURCE_SHA 0a7d48b
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 8194354

Build Information

Test Name: Trilinos_PR_gcc-8.3.0-debug

  • Build Num: 846
  • Status: FAILED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel7_sems-gnu-8.3.0-openmpi-1.10.1-serial_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 11779
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL trilinos-any
TRILINOS_SOURCE_BRANCH avoid_tribits_kokkos
TRILINOS_SOURCE_REPO https://github.com/masterleinad/Trilinos
TRILINOS_SOURCE_SHA 0a7d48b
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 8194354

Build Information

Test Name: Trilinos_PR_clang-11.0.1

  • Build Num: 845
  • Status: FAILED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel7_sems-clang-11.0.1-openmpi-1.10.1-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 11779
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL trilinos-any
TRILINOS_SOURCE_BRANCH avoid_tribits_kokkos
TRILINOS_SOURCE_REPO https://github.com/masterleinad/Trilinos
TRILINOS_SOURCE_SHA 0a7d48b
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 8194354

Build Information

Test Name: Trilinos_PR_python3

  • Build Num: 2074
  • Status: PASSED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel7_sems-gnu-7.2.0-anaconda3-serial_debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_no-mpi_no-pt_no-rdc_no-uvm_deprecated-on_pr-framework
PR_LABELS
PULLREQUESTNUM 11779
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL ascic
TRILINOS_SOURCE_BRANCH avoid_tribits_kokkos
TRILINOS_SOURCE_REPO https://github.com/masterleinad/Trilinos
TRILINOS_SOURCE_SHA 0a7d48b
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 8194354

Build Information

Test Name: Trilinos_PR_cuda-11.4.2-uvm-off

  • Build Num: 1847
  • Status: FAILED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel7_sems-cuda-11.4.2-sems-gnu-10.1.0-sems-openmpi-4.0.5_release_static_Volta70_no-asan_complex_no-fpic_mpi_pt_no-rdc_no-uvm_deprecated-on_no-package-enables
PR_LABELS
PULLREQUESTNUM 11779
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL GPU
TRILINOS_SOURCE_BRANCH avoid_tribits_kokkos
TRILINOS_SOURCE_REPO https://github.com/masterleinad/Trilinos
TRILINOS_SOURCE_SHA 0a7d48b
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 8194354

Build Information

Test Name: Trilinos_PR_intel-2021.3

  • Build Num: 485
  • Status: FAILED

Jenkins Parameters

Parameter Name Value
FORCE_CLEAN true
GENCONFIG_BUILD_NAME rhel7_sems-intel-2021.3-sems-openmpi-4.0.5_release-debug_shared_no-kokkos-arch_no-asan_no-complex_fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_no-package-enables
PR_LABELS
PULLREQUESTNUM 11779
PULLREQUEST_CDASH_TRACK Pull Request
TEST_REPO_ALIAS TRILINOS
TRILINOS_NODE_LABEL trilinos-any
TRILINOS_SOURCE_BRANCH avoid_tribits_kokkos
TRILINOS_SOURCE_REPO https://github.com/masterleinad/Trilinos
TRILINOS_SOURCE_SHA 0a7d48b
TRILINOS_SRN_CONFIG true
TRILINOS_TARGET_BRANCH develop
TRILINOS_TARGET_REPO https://github.com/trilinos/Trilinos
TRILINOS_TARGET_SHA 8194354


CDash Test Results for PR# 11779.


Wiki: How to Reproduce PR Testing Builds and Errors.

@bartlettroscoe
Copy link
Member

@masterleinad, since I suspect you can't see the PR testing results linked to on CDash above, all of the builds failed with the configure error:

Processing enabled top-level package: ShyLU_Node (HTS, Tacho, Tests, Examples)
-- ShyLU_NodeHTS_hts_test_1: Added test (BASIC, PROCESSORS=2)!
CMake Error at packages/shylu/shylu_node/tacho/CMakeLists.txt:12 (MESSAGE):
  Tacho can not be build with Pthreads as the Kokkos Host Backend.


-- Configuring incomplete, errors occurred!

@masterleinad
Copy link
Contributor Author

@bartlettroscoe Hmm... Can you give me an example configuration? Locally I can configure with ShyLU support and OpenMP ON or OFF but of course, I get that error if I try to enable Pthread which seems to be expected.

@bartlettroscoe
Copy link
Member

Can you give me an example configuration?

@masterleinad, it can be hard to reproduce these PR configurations if you are not on an SNL machine. See:

Any chance you have access to the SNL SRN as part of your Kokkos collaboration work?

Otherwise, I will give this a try once I have a TriBITS example and test set up.

@masterleinad
Copy link
Contributor Author

@bartlettroscoe So it looks like the configuration does TPL_ENABLE_Pthread=ON and we currently have

KOKKOS_TPL_OPTION(THREADS ${Kokkos_ENABLE_THREADS} TRIBITS Pthread)

which should imply that the default for Kokkos_ENABLE_THREADS should be the same but this is not actually the place where the default is set but in
KOKKOS_DEVICE_OPTION(THREADS OFF HOST "Whether to build C++ threads backend")
and we are missing something like

diff --git a/packages/kokkos/cmake/kokkos_enable_devices.cmake b/packages/kokkos/cmake/kokkos_enable_devices.cmake
index d4a7744eb59..0f7bad1e999 100644
--- a/packages/kokkos/cmake/kokkos_enable_devices.cmake
+++ b/packages/kokkos/cmake/kokkos_enable_devices.cmake
@@ -18,8 +18,11 @@ KOKKOS_CFG_DEPENDS(DEVICES NONE)
 # Put a check in just in case people are using this option
 KOKKOS_DEPRECATED_LIST(DEVICES ENABLE)
 
-
+IF(Trilinos_ENABLE_Kokkos AND TPL_ENABLE_Pthread)
+KOKKOS_DEVICE_OPTION(THREADS ON HOST "Whether to build C++ threads backend")
+ELSE()
 KOKKOS_DEVICE_OPTION(THREADS OFF HOST "Whether to build C++ threads backend")
+ENDIF()

with current Trilinos/Kokkos develop to set the default correctly. This pull request forces Kokkos_ENABLE_THREADS to have the same values as TPL_ENABLE_PThread if specified, thus fixing the issue differently. As we are seeing right now, this uncovers that some of the test configurations are invalid: Tacho can't be built with THREADS/Pthread support but apparently TPL_ENABLE_Pthread=ON is set which implies ShyLU_NodeTacho_ENABLE_Pthread=ON and this variable is entirely ignored in favor of Kokkos_ENABLE_THREADS which is currently always OFF if not set explicitly.

@masterleinad
Copy link
Contributor Author

This means the Trilinos CI doesn't test the THREADS backend unless Kokkos_ENABLE_THREADS=ON is set.

@bartlettroscoe
Copy link
Member

bartlettroscoe commented Jun 2, 2023

@masterleinad, technically speaking, the value of Kokkos_ENABLE_Pthread should determine threading support in Kokkos, not TPL_ENABLE_Pthread (see 10.7 How to add a new TriBITS external package/TPL dependency and Support for optional package can be explicitly disabled). So Kokkos should set the default for the cache var Kokkos_ENABLE_THREADS from ${Kokkos_ENABLE_Pthread} and NOT ${TPL_ENABLE_Pthread}.

SIDENOTE: That reminds me, we need to update that in the Kokkos CMake function KOKKOS_TPL_OPTION() at:

IF (NOT "${TPL_ENABLE_${PARSED_TRIBITS}}" STREQUAL "")
#Tribits brought its own default that should take precedence
SET(DEFAULT ${TPL_ENABLE_${PARSED_TRIBITS}})
ENDIF()

to change TPL_ENABLE_${PARSED_TRIBITS} to Kokkos_ENABLE_${PARSED_TRIBITS} to be technically correct.

NOTE: The name Pthread is historical going back before even Kokkos. CMake makes it hard to deal with multiple variables representing the same thing. And then there is the relationship between cache and non-cache vars that makes things even more complex (but TriBITS actually exploits that the non-cache var overrides the cache var as described in TriBITS auto-enables/disables done using non-cache local variables).

We will work out these issues.

@trilinos-autotester
Copy link
Contributor

Status Flag 'Pre-Test Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging
NO INSPECTION HAS BEEN PERFORMED ON THIS PULL REQUEST! - This PR must be inspected by setting label 'AT: PRE-TEST INSPECTED'.

@trilinos-autotester
Copy link
Contributor

Status Flag 'Pre-Test Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging
NO INSPECTION HAS BEEN PERFORMED ON THIS PULL REQUEST! - This PR must be inspected by setting label 'AT: PRE-TEST INSPECTED'.

@sebrowne
Copy link
Contributor

Can this be closed in favor of #13423 ?

@masterleinad
Copy link
Contributor Author

Can this be closed in favor of #13423 ?

Sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

5 participants