From 1b7df0f09762c118516b57feeacebfdc1d0a6c2f Mon Sep 17 00:00:00 2001 From: Maarten Arnst Date: Thu, 29 Aug 2024 09:04:47 +0200 Subject: [PATCH 01/49] Pass value_in to tpl set by universal ref --- .../teuchos/parameterlist/src/Teuchos_ParameterList.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/teuchos/parameterlist/src/Teuchos_ParameterList.hpp b/packages/teuchos/parameterlist/src/Teuchos_ParameterList.hpp index 65f815365c42..25a5d9ceda42 100644 --- a/packages/teuchos/parameterlist/src/Teuchos_ParameterList.hpp +++ b/packages/teuchos/parameterlist/src/Teuchos_ParameterList.hpp @@ -251,7 +251,7 @@ class TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT ParameterList { */ template ParameterList& set (std::string const& name, - T const& value, + T&& value, std::string const& docString = "", RCP const& validator = null); @@ -921,7 +921,7 @@ ParameterList& ParameterList::setName( const std::string &name_in ) template inline ParameterList& ParameterList::set( - std::string const& name_in, T const& value_in, std::string const& docString_in, + std::string const& name_in, T&& value_in, std::string const& docString_in, RCP const& validator_in ) { @@ -934,7 +934,7 @@ ParameterList& ParameterList::set( const RCP validator = (nonnull(validator_in) ? validator_in : param->validator()); // Create temp param to validate before setting - ParameterEntry param_new(value_in, false, false, docString, validator ); + ParameterEntry param_new(std::forward(value_in), false, false, docString, validator ); if (nonnull(validator)) { validator->validate(param_new, name_in, this->name()); } @@ -942,7 +942,7 @@ ParameterList& ParameterList::set( *param = param_new; } else { - ParameterEntry param_new(value_in, false, false, docString_in, validator_in); + ParameterEntry param_new(std::forward(value_in), false, false, docString_in, validator_in); if (nonnull(param_new.validator())) { param_new.validator()->validate(param_new, name_in, this->name()); } From 45aee728a9014e89d8b4faacdab09b35eeb32138 Mon Sep 17 00:00:00 2001 From: Maarten Arnst Date: Thu, 29 Aug 2024 21:35:27 +0200 Subject: [PATCH 02/49] Add unit test of ParameterList::set move semantics --- .../test/ParameterList/ParameterList_UnitTests.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/teuchos/parameterlist/test/ParameterList/ParameterList_UnitTests.cpp b/packages/teuchos/parameterlist/test/ParameterList/ParameterList_UnitTests.cpp index a05dba416d0d..968fb4d3255e 100644 --- a/packages/teuchos/parameterlist/test/ParameterList/ParameterList_UnitTests.cpp +++ b/packages/teuchos/parameterlist/test/ParameterList/ParameterList_UnitTests.cpp @@ -442,6 +442,18 @@ TEUCHOS_UNIT_TEST( ParameterList, set_get_string ) } +TEUCHOS_UNIT_TEST( ParameterList, set_string_move_semantics) +{ + ParameterList pl; + + ECHO(std::string my_string{"my text"}); + ECHO(pl.set("my string", std::move(my_string))); + + // Check that the parameter value was moved by checking that my_string is now empty. + TEST_ASSERT(my_string.empty()); + + TEST_EQUALITY_CONST(pl.get("my string"), "my text"); +} TEUCHOS_UNIT_TEST( ParameterList, get_nonexisting_param ) { From ae7c617da5d07224ccda195a390316ada5cf8f29 Mon Sep 17 00:00:00 2001 From: Maarten Arnst Date: Fri, 30 Aug 2024 23:06:51 +0200 Subject: [PATCH 03/49] Add rval ref version to const ref version of tpl:set rather than replace with univ ref version --- .../src/Teuchos_ParameterList.hpp | 45 +++++++++++++++++-- .../ParameterList/ParameterList_UnitTests.cpp | 39 +++++++++++++--- 2 files changed, 74 insertions(+), 10 deletions(-) diff --git a/packages/teuchos/parameterlist/src/Teuchos_ParameterList.hpp b/packages/teuchos/parameterlist/src/Teuchos_ParameterList.hpp index 25a5d9ceda42..c3b7497a3ff1 100644 --- a/packages/teuchos/parameterlist/src/Teuchos_ParameterList.hpp +++ b/packages/teuchos/parameterlist/src/Teuchos_ParameterList.hpp @@ -250,6 +250,13 @@ class TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT ParameterList { */ template + ParameterList& set (std::string const& name, + const T& value, + std::string const& docString = "", + RCP const& validator = null); + + //! \overload + template>>> ParameterList& set (std::string const& name, T&& value, std::string const& docString = "", @@ -921,7 +928,7 @@ ParameterList& ParameterList::setName( const std::string &name_in ) template inline ParameterList& ParameterList::set( - std::string const& name_in, T&& value_in, std::string const& docString_in, + std::string const& name_in, const T& value_in, std::string const& docString_in, RCP const& validator_in ) { @@ -934,7 +941,7 @@ ParameterList& ParameterList::set( const RCP validator = (nonnull(validator_in) ? validator_in : param->validator()); // Create temp param to validate before setting - ParameterEntry param_new(std::forward(value_in), false, false, docString, validator ); + ParameterEntry param_new(value_in, false, false, docString, validator ); if (nonnull(validator)) { validator->validate(param_new, name_in, this->name()); } @@ -942,7 +949,7 @@ ParameterList& ParameterList::set( *param = param_new; } else { - ParameterEntry param_new(std::forward(value_in), false, false, docString_in, validator_in); + ParameterEntry param_new(value_in, false, false, docString_in, validator_in); if (nonnull(param_new.validator())) { param_new.validator()->validate(param_new, name_in, this->name()); } @@ -951,6 +958,38 @@ ParameterList& ParameterList::set( return *this; } +template +inline +ParameterList& ParameterList::set( + std::string const& name_in, T&& value_in, std::string const& docString_in, + RCP const& validator_in + ) +{ + typedef StringIndexedOrderedValueObjectContainerBase SIOVOCB; + const Ordinal param_idx = params_.getObjOrdinalIndex(name_in); + if (param_idx != SIOVOCB::getInvalidOrdinal()) { + Ptr param = params_.getNonconstObjPtr(param_idx); + const std::string docString = + (docString_in.length() ? docString_in : param->docString()); + const RCP validator = + (nonnull(validator_in) ? validator_in : param->validator()); + // Create temp param to validate before setting + ParameterEntry param_new(std::move(value_in), false, false, docString, validator ); + if (nonnull(validator)) { + validator->validate(param_new, name_in, this->name()); + } + // Strong guarantee: (if exception is thrown, the value is not changed) + *param = param_new; + } + else { + ParameterEntry param_new(std::move(value_in), false, false, docString_in, validator_in); + if (nonnull(param_new.validator())) { + param_new.validator()->validate(param_new, name_in, this->name()); + } + params_.setObj(name_in, param_new); + } + return *this; +} inline ParameterList& ParameterList::set( diff --git a/packages/teuchos/parameterlist/test/ParameterList/ParameterList_UnitTests.cpp b/packages/teuchos/parameterlist/test/ParameterList/ParameterList_UnitTests.cpp index 968fb4d3255e..e65811323dc9 100644 --- a/packages/teuchos/parameterlist/test/ParameterList/ParameterList_UnitTests.cpp +++ b/packages/teuchos/parameterlist/test/ParameterList/ParameterList_UnitTests.cpp @@ -446,13 +446,38 @@ TEUCHOS_UNIT_TEST( ParameterList, set_string_move_semantics) { ParameterList pl; - ECHO(std::string my_string{"my text"}); - ECHO(pl.set("my string", std::move(my_string))); - - // Check that the parameter value was moved by checking that my_string is now empty. - TEST_ASSERT(my_string.empty()); - - TEST_EQUALITY_CONST(pl.get("my string"), "my text"); + ECHO(std::string my_str_1{"my text 1"}); + ECHO(pl.set("my string 1", std::move(my_str_1))); + + // Check that the parameter value was moved by checking that my_str_1 is now empty. + TEST_ASSERT(my_str_1.empty()); + + TEST_EQUALITY_CONST(pl.get("my string 1"), "my text 1"); + + ECHO(std::string my_str_2{"my text 2"}); + ECHO(pl.set("my string 2", std::move(my_str_2))); + TEST_ASSERT(my_str_2.empty()); + TEST_EQUALITY_CONST(pl.get("my string 2"), "my text 2"); + + ECHO(std::string my_str_3{"my text 3"}); + ECHO(pl.set("my string 3", my_str_3)); + TEST_ASSERT( ! my_str_3.empty()); + TEST_EQUALITY_CONST(pl.get("my string 3"), "my text 3"); + + ECHO(std::string my_str_4{"my text 4"}); + ECHO(pl.set("my string 4", my_str_4)); + TEST_ASSERT( ! my_str_4.empty()); + TEST_EQUALITY_CONST(pl.get("my string 4"), "my text 4"); + + ECHO(const std::string my_str_5{"my text 5"}); + ECHO(pl.set("my string 5", my_str_5)); + TEST_ASSERT( ! my_str_5.empty()); + TEST_EQUALITY_CONST(pl.get("my string 5"), "my text 5"); + + ECHO(const std::string my_str_6{"my text 6"}); + ECHO(pl.set("my string 6", my_str_6)); + TEST_ASSERT( ! my_str_6.empty()); + TEST_EQUALITY_CONST(pl.get("my string 6"), "my text 6"); } TEUCHOS_UNIT_TEST( ParameterList, get_nonexisting_param ) From a134ec356537b3a86fc53044a2e3c7e0c62cc5fe Mon Sep 17 00:00:00 2001 From: Maarten Arnst Date: Mon, 2 Sep 2024 11:07:28 +0200 Subject: [PATCH 04/49] Revert to universal ref version. Add fallback --- .../src/Teuchos_ParameterList.hpp | 61 +++++++------------ .../ParameterList/ParameterList_UnitTests.cpp | 24 +++++--- 2 files changed, 35 insertions(+), 50 deletions(-) diff --git a/packages/teuchos/parameterlist/src/Teuchos_ParameterList.hpp b/packages/teuchos/parameterlist/src/Teuchos_ParameterList.hpp index c3b7497a3ff1..34f6115c957d 100644 --- a/packages/teuchos/parameterlist/src/Teuchos_ParameterList.hpp +++ b/packages/teuchos/parameterlist/src/Teuchos_ParameterList.hpp @@ -231,7 +231,7 @@ class TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT ParameterList { */ ParameterList& disableRecursiveAll(); - /*! \brief Set a parameter whose value has type T. + /*! \brief Templated set method. \param name [in] The parameter's name. \param value [in] The parameter's value. This determines the @@ -250,17 +250,21 @@ class TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT ParameterList { */ template - ParameterList& set (std::string const& name, - const T& value, - std::string const& docString = "", - RCP const& validator = null); + ParameterList& set (std::string const& name, + T&& value, + std::string const& docString = "", + RCP const& validator = null); - //! \overload - template>>> - ParameterList& set (std::string const& name, - T&& value, - std::string const& docString = "", - RCP const& validator = null); + /*! \overload + + \note This fallback is necessary to support legacy use cases that specify the type + of the parameter at the call site, and the type is hence not deduced. + */ + template && std::is_same_v>>> + ParameterList& set (std::string const& name, + S&& value, + std::string const& docString = "", + RCP const& validator = null); /// \brief Specialization of set() for a parameter which is a char[]. /// @@ -928,7 +932,7 @@ ParameterList& ParameterList::setName( const std::string &name_in ) template inline ParameterList& ParameterList::set( - std::string const& name_in, const T& value_in, std::string const& docString_in, + std::string const& name_in, T&& value_in, std::string const& docString_in, RCP const& validator_in ) { @@ -941,7 +945,7 @@ ParameterList& ParameterList::set( const RCP validator = (nonnull(validator_in) ? validator_in : param->validator()); // Create temp param to validate before setting - ParameterEntry param_new(value_in, false, false, docString, validator ); + ParameterEntry param_new(std::forward(value_in), false, false, docString, validator ); if (nonnull(validator)) { validator->validate(param_new, name_in, this->name()); } @@ -949,7 +953,7 @@ ParameterList& ParameterList::set( *param = param_new; } else { - ParameterEntry param_new(value_in, false, false, docString_in, validator_in); + ParameterEntry param_new(std::forward(value_in), false, false, docString_in, validator_in); if (nonnull(param_new.validator())) { param_new.validator()->validate(param_new, name_in, this->name()); } @@ -958,37 +962,14 @@ ParameterList& ParameterList::set( return *this; } -template +template inline ParameterList& ParameterList::set( - std::string const& name_in, T&& value_in, std::string const& docString_in, + std::string const& name_in, S&& value_in, std::string const& docString_in, RCP const& validator_in ) { - typedef StringIndexedOrderedValueObjectContainerBase SIOVOCB; - const Ordinal param_idx = params_.getObjOrdinalIndex(name_in); - if (param_idx != SIOVOCB::getInvalidOrdinal()) { - Ptr param = params_.getNonconstObjPtr(param_idx); - const std::string docString = - (docString_in.length() ? docString_in : param->docString()); - const RCP validator = - (nonnull(validator_in) ? validator_in : param->validator()); - // Create temp param to validate before setting - ParameterEntry param_new(std::move(value_in), false, false, docString, validator ); - if (nonnull(validator)) { - validator->validate(param_new, name_in, this->name()); - } - // Strong guarantee: (if exception is thrown, the value is not changed) - *param = param_new; - } - else { - ParameterEntry param_new(std::move(value_in), false, false, docString_in, validator_in); - if (nonnull(param_new.validator())) { - param_new.validator()->validate(param_new, name_in, this->name()); - } - params_.setObj(name_in, param_new); - } - return *this; + return set(name_in, std::forward(value_in), docString_in, validator_in); } inline diff --git a/packages/teuchos/parameterlist/test/ParameterList/ParameterList_UnitTests.cpp b/packages/teuchos/parameterlist/test/ParameterList/ParameterList_UnitTests.cpp index e65811323dc9..87c9351cf84d 100644 --- a/packages/teuchos/parameterlist/test/ParameterList/ParameterList_UnitTests.cpp +++ b/packages/teuchos/parameterlist/test/ParameterList/ParameterList_UnitTests.cpp @@ -453,31 +453,35 @@ TEUCHOS_UNIT_TEST( ParameterList, set_string_move_semantics) TEST_ASSERT(my_str_1.empty()); TEST_EQUALITY_CONST(pl.get("my string 1"), "my text 1"); +} + +TEUCHOS_UNIT_TEST( ParameterList, set_string_specified_template_argument) +{ + // Check the templated set method and its overload when the template argument is specified. + ParameterList pl; + + // The parameter value can be passed by rvalue reference. + // The main templated set method is called, and the parameter value is moved. ECHO(std::string my_str_2{"my text 2"}); ECHO(pl.set("my string 2", std::move(my_str_2))); TEST_ASSERT(my_str_2.empty()); TEST_EQUALITY_CONST(pl.get("my string 2"), "my text 2"); + // The parameter value cannot be passed by rvalue reference. + // The overload of the templated set method is called, and the parameter value is not moved. ECHO(std::string my_str_3{"my text 3"}); - ECHO(pl.set("my string 3", my_str_3)); + ECHO(pl.set("my string 3", my_str_3)); TEST_ASSERT( ! my_str_3.empty()); TEST_EQUALITY_CONST(pl.get("my string 3"), "my text 3"); - ECHO(std::string my_str_4{"my text 4"}); + ECHO(const std::string my_str_4{"my text 4"}); ECHO(pl.set("my string 4", my_str_4)); TEST_ASSERT( ! my_str_4.empty()); TEST_EQUALITY_CONST(pl.get("my string 4"), "my text 4"); - ECHO(const std::string my_str_5{"my text 5"}); - ECHO(pl.set("my string 5", my_str_5)); - TEST_ASSERT( ! my_str_5.empty()); + ECHO(pl.set("my string 5", "my text 5")); TEST_EQUALITY_CONST(pl.get("my string 5"), "my text 5"); - - ECHO(const std::string my_str_6{"my text 6"}); - ECHO(pl.set("my string 6", my_str_6)); - TEST_ASSERT( ! my_str_6.empty()); - TEST_EQUALITY_CONST(pl.get("my string 6"), "my text 6"); } TEUCHOS_UNIT_TEST( ParameterList, get_nonexisting_param ) From 8f364448ea0902241c139a0831a890e410be73c8 Mon Sep 17 00:00:00 2001 From: "Samuel E. Browne" Date: Wed, 4 Sep 2024 12:58:31 -0600 Subject: [PATCH 05/49] Add warnings/errors staging paradigm Add capability for switching 'upcoming' warnings/errors on/off. `Trilinos_WARNINGS` will do the following: `WARN` -> Warnings are added to CXX flags, deprecated packages have all warnings disabled `ERROR` -> Warnings-as-errors are added to CXX flags, deprecated packages have all warnings disabled Anything else -> No warnings/errors adde Signed-off-by: Samuel E. Browne --- CMakeLists.txt | 5 ++++- cmake/WarningsErrorsPolicy.cmake | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 cmake/WarningsErrorsPolicy.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b3515e864d3..128dfa566eb2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,10 @@ PROJECT(${PROJECT_NAME} NONE) # Set up to use ccache include("${CMAKE_CURRENT_LIST_DIR}/cmake/UseCCache.cmake") +set(deprecated_packages Amesos AztecOO Epetra EpetraExt Ifpack Intrepid Isorropia ML NewPackage Pliris PyTrilinos ShyLU_DDCore ThyraEpetraAdapters ThyraEpetraExtAdapters Triutils) + +include("${CMAKE_CURRENT_LIST_DIR}/cmake/WarningErrorsPolicy.cmake") + # Set an env so we know we are in configure set(ENV{CMAKE_IS_IN_CONFIGURE_MODE} 1) @@ -56,7 +60,6 @@ IF(${PROJECT_NAME}_ENABLE_YouCompleteMe) INCLUDE(CodeCompletion) ENDIF() -set(deprecated_packages Amesos AztecOO Epetra EpetraExt Ifpack Intrepid Isorropia ML NewPackage Pliris PyTrilinos ShyLU_DDCore ThyraEpetraAdapters ThyraEpetraExtAdapters Triutils) set(enabled_deprecated_packages "") FOREACH(package ${deprecated_packages}) IF(Trilinos_ENABLE_${package}) diff --git a/cmake/WarningsErrorsPolicy.cmake b/cmake/WarningsErrorsPolicy.cmake new file mode 100644 index 000000000000..0720cc69bb99 --- /dev/null +++ b/cmake/WarningsErrorsPolicy.cmake @@ -0,0 +1,24 @@ +set(warnings shadow parentheses sign-compare unused-variable) + + +macro(disable_warnings_for_deprecated_packages) + message(STATUS "Disabling all warnings/errors for deprecated packages") + foreach(package deprecated_packages) + set(${package}_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") + endforeach() +endmacro() + + +if("${Trilinos_WARNINGS}" STREQUAL "WARN") + message(STATUS "Trilinos warnings enabled: ${warnings}") + foreach(warning ${warnings}) + set(CMAKE_CXX_FLAGS "-W${warning} -Wno-error=${warning} ${CMAKE_CXX_FLAGS}") + endforeach() + disable_warnings_for_deprecated_packages() +elseif("${Trilinos_WARNINGS}" STREQUAL "ERROR") + message(STATUS "Trilinos warnings-as-errors enabled: ${warnings}") + foreach(warning ${warnings}) + set(CMAKE_CXX_FLAGS "-W${warning} -Wno-error=${warning} ${CMAKE_CXX_FLAGS}") + endforeach() + disable_warnings_for_deprecated_packages() +endif() From 58d686762c827e3e060858f9691f7699be3b74d9 Mon Sep 17 00:00:00 2001 From: "Samuel E. Browne" Date: Wed, 4 Sep 2024 14:16:50 -0600 Subject: [PATCH 06/49] Turn on warnings any time the compiler is GCC Signed-off-by: Samuel E. Browne --- packages/framework/ini-files/config-specs.ini | 58 +------------------ 1 file changed, 3 insertions(+), 55 deletions(-) diff --git a/packages/framework/ini-files/config-specs.ini b/packages/framework/ini-files/config-specs.ini index 59d7aef5f3ce..d017be6557fb 100644 --- a/packages/framework/ini-files/config-specs.ini +++ b/packages/framework/ini-files/config-specs.ini @@ -1180,6 +1180,9 @@ opt-set-cmake-var TPL_LAPACK_LIBRARIES STRING FORCE : -L${LAPACK_ROOT|ENV}/ [COMPILER|GNU] opt-set-cmake-var MPI_EXEC FILEPATH : mpirun +opt-set-cmake-var Trilinos_WARNINGS STRING : WARN +opt-set-cmake-var Intrepid2_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Werror +opt-set-cmake-var Tempus_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Werror [COMPILER|INTEL] opt-set-cmake-var MPI_EXEC FILEPATH : mpirun @@ -1249,51 +1252,6 @@ opt-set-cmake-var KokkosKernels_sparse_cuda_MPI_1_SET_RUN_SERIAL BOOL FORCE : ON opt-set-cmake-var KokkosKernels_batched_dla_cuda_MPI_1_SET_RUN_SERIAL BOOL FORCE : ON opt-set-cmake-var Intrepid2_unit-test_MonolithicExecutable_Intrepid2_Tests_MPI_1_SET_RUN_SERIAL BOOL FORCE : ON -[GCC_PACKAGE_SPECIFIC_WARNING_FLAGS] -# Supported packages -opt-set-cmake-var Amesos2_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow -opt-set-cmake-var Belos_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow -opt-set-cmake-var Domi_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow -opt-set-cmake-var FEI_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow -opt-set-cmake-var Galeri_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow -opt-set-cmake-var Intrepid2_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Werror -Wno-error=shadow -opt-set-cmake-var Moertel_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow -opt-set-cmake-var NOX_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow -opt-set-cmake-var Pamgen_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow -opt-set-cmake-var Phalanx_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow -opt-set-cmake-var Pike_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Werror -opt-set-cmake-var ROL_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow -opt-set-cmake-var Sacado_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow -opt-set-cmake-var Shards_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow -opt-set-cmake-var ShyLU_Node_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow -opt-set-cmake-var STK_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow -opt-set-cmake-var Stokhos_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow -# opt-set-cmake-var Tempus_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Werror -opt-set-cmake-var Zoltan_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow -opt-set-cmake-var TrilinosCouplings_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow - -# Deprecated packages -opt-set-cmake-var Amesos_CXX_FLAGS STRING FORCE : ${CMAKE_CXX_FLAGS|CMAKE} -w -opt-set-cmake-var AztecOO_CXX_FLAGS STRING FORCE : ${CMAKE_CXX_FLAGS|CMAKE} -w -opt-set-cmake-var Epetra_CXX_FLAGS STRING FORCE : ${CMAKE_CXX_FLAGS|CMAKE} -w -opt-set-cmake-var EpetraExt_CXX_FLAGS STRING FORCE : ${CMAKE_CXX_FLAGS|CMAKE} -w -opt-set-cmake-var Ifpack_CXX_FLAGS STRING FORCE : ${CMAKE_CXX_FLAGS|CMAKE} -w -opt-set-cmake-var Intrepid_CXX_FLAGS STRING FORCE : ${CMAKE_CXX_FLAGS|CMAKE} -w -opt-set-cmake-var Isorropia_CXX_FLAGS STRING FORCE : ${CMAKE_CXX_FLAGS|CMAKE} -w -opt-set-cmake-var ML_CXX_FLAGS STRING FORCE : ${CMAKE_CXX_FLAGS|CMAKE} -w -opt-set-cmake-var Pliris_CXX_FLAGS STRING FORCE : ${CMAKE_CXX_FLAGS|CMAKE} -w -opt-set-cmake-var PyTrilinos_CXX_FLAGS STRING FORCE : ${CMAKE_CXX_FLAGS|CMAKE} -w -opt-set-cmake-var ShyLU_DD_CXX_FLAGS STRING FORCE : ${CMAKE_CXX_FLAGS|CMAKE} -w -opt-set-cmake-var Triutils_CXX_FLAGS STRING FORCE : ${CMAKE_CXX_FLAGS|CMAKE} -w -opt-set-cmake-var ThyraEpetraAdapters_CXX_FLAGS STRING FORCE : ${CMAKE_CXX_FLAGS|CMAKE} -w -opt-set-cmake-var ThyraEpetraExtAdapters_CXX_FLAGS STRING FORCE : ${CMAKE_CXX_FLAGS|CMAKE} -w - - -[GCC_OPENMP_PACKAGE_SPECIFIC_WARNING_FLAGS] -use GCC_PACKAGE_SPECIFIC_WARNING_FLAGS -opt-set-cmake-var Panzer_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow -opt-set-cmake-var Percept_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Wno-error=shadow - # Full configurations intended to be loaded. @@ -1743,8 +1701,6 @@ opt-set-cmake-var TPL_Netcdf_LIBRARIES STRING FORCE : ${NETCDF_C_LIB|ENV}/libnet opt-set-cmake-var Trilinos_ENABLE_Fortran OFF BOOL : OFF opt-set-cmake-var CMAKE_CXX_FLAGS STRING : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-deprecated-declarations -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-nonnull-compare -Wno-address -Wno-inline -Wno-unused-label -Werror=parentheses -Werror=sign-compare -Werror=unused-variable -use GCC_PACKAGE_SPECIFIC_WARNING_FLAGS - [rhel8_sems-gnu-8.5.0-serial_release-debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_no-mpi_no-pt_no-rdc_no-uvm_deprecated-on_all] use rhel8_sems-gnu-8.5.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 use PACKAGE-ENABLES|ALL @@ -1782,8 +1738,6 @@ opt-set-cmake-var TPL_BLAS_LIBRARIES STRING FORCE : -L${BLAS_ROOT|ENV}/lib;-lbla opt-set-cmake-var TPL_HDF5_LIBRARIES STRING : ${HDF5_LIB|ENV}/libhdf5_hl.so;${HDF5_LIB|ENV}/libhdf5.so;${ZLIB_LIB|ENV}/libz.so;-ldl opt-set-cmake-var ML_ENABLE_SuperLU BOOL FORCE : OFF -use GCC_OPENMP_PACKAGE_SPECIFIC_WARNING_FLAGS - [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_all] use 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 use PACKAGE-ENABLES|ALL @@ -1849,8 +1803,6 @@ opt-set-cmake-var Tempus_IMEX_RK_Staggered_FSA_Tangent_MPI_1_DISABLE BOOL FORCE opt-set-cmake-var Tempus_Newmark_MPI_1_DISABLE BOOL FORCE : ON opt-set-cmake-var Tempus_Test_NewmarkImplicitAForm_HarmonicOscillator_Damped_FirstOrder_MPI_1_DISABLE BOOL FORCE : ON -use GCC_PACKAGE_SPECIFIC_WARNING_FLAGS - [rhel8_sems-gnu-8.5.0-openmpi-4.1.6-serial_debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_all] #uses sems-v2 modules use rhel8_sems-gnu-8.5.0-openmpi-4.1.6-serial_debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_no-package-enables @@ -1945,7 +1897,6 @@ opt-set-cmake-var Belos_gcrodr_complex_hb_MPI_4_DISABLE opt-set-cmake-var Belos_Tpetra_gcrodr_complex_hb_MPI_4_DISABLE BOOL : ON opt-set-cmake-var Stratimikos_Galeri_xpetra_complex_double_Jacobi_MPI_4_DISABLE BOOL : ON -use GCC_PACKAGE_SPECIFIC_WARNING_FLAGS use RHEL8_POST [rhel8_gcc-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] @@ -1987,7 +1938,6 @@ opt-set-cmake-var Trilinos_ENABLE_TrilinosBuildStats BOOL FORCE : OFF # Turned off to bypass: ML CONFIGURATION ERROR: SuperLU_5.0 detected - only SuperLU version < 5.0 currently supported for this package. opt-set-cmake-var ML_ENABLE_SuperLU BOOL FORCE : OFF -use GCC_PACKAGE_SPECIFIC_WARNING_FLAGS use RHEL8_POST [rhel8_aue-gcc-openmpi_debug_shared_no-kokkos-arch_no-asan_complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_no-package-enables] @@ -2028,8 +1978,6 @@ opt-set-cmake-var Trilinos_ENABLE_TrilinosBuildStats BOOL FORCE : OFF # Turned off to bypass: ML CONFIGURATION ERROR: SuperLU_5.0 detected - only SuperLU version < 5.0 currently supported for this package. opt-set-cmake-var ML_ENABLE_SuperLU BOOL FORCE : OFF -use GCC_PACKAGE_SPECIFIC_WARNING_FLAGS - use RHEL8_POST [rhel8_gcc-openmpi_debug_shared_no-kokkos-arch_no-asan_complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_all] From 640331e85047aab2a028c18aee42722067c39b84 Mon Sep 17 00:00:00 2001 From: "Samuel E. Browne" Date: Wed, 4 Sep 2024 14:31:55 -0600 Subject: [PATCH 07/49] Fix typo Signed-off-by: Samuel E. Browne --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 128dfa566eb2..13efb2cac6b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,7 @@ include("${CMAKE_CURRENT_LIST_DIR}/cmake/UseCCache.cmake") set(deprecated_packages Amesos AztecOO Epetra EpetraExt Ifpack Intrepid Isorropia ML NewPackage Pliris PyTrilinos ShyLU_DDCore ThyraEpetraAdapters ThyraEpetraExtAdapters Triutils) -include("${CMAKE_CURRENT_LIST_DIR}/cmake/WarningErrorsPolicy.cmake") +include("${CMAKE_CURRENT_LIST_DIR}/cmake/WarningsErrorsPolicy.cmake") # Set an env so we know we are in configure set(ENV{CMAKE_IS_IN_CONFIGURE_MODE} 1) From 6c5326f0d18f654fa5a83192b8461ae862c273ee Mon Sep 17 00:00:00 2001 From: "Samuel E. Browne" Date: Wed, 4 Sep 2024 14:32:17 -0600 Subject: [PATCH 08/49] Remove package-specific flags Just rely on warnings/errors apprach for now. Signed-off-by: Samuel E. Browne --- packages/framework/ini-files/config-specs.ini | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/framework/ini-files/config-specs.ini b/packages/framework/ini-files/config-specs.ini index d017be6557fb..72e9217eb3a0 100644 --- a/packages/framework/ini-files/config-specs.ini +++ b/packages/framework/ini-files/config-specs.ini @@ -1181,8 +1181,6 @@ opt-set-cmake-var TPL_LAPACK_LIBRARIES STRING FORCE : -L${LAPACK_ROOT|ENV}/ [COMPILER|GNU] opt-set-cmake-var MPI_EXEC FILEPATH : mpirun opt-set-cmake-var Trilinos_WARNINGS STRING : WARN -opt-set-cmake-var Intrepid2_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Werror -opt-set-cmake-var Tempus_CXX_FLAGS STRING : ${CMAKE_CXX_FLAGS|CMAKE} -Werror [COMPILER|INTEL] opt-set-cmake-var MPI_EXEC FILEPATH : mpirun From 0436d5e132ad94a789e06c73f528f6f2cfd6add7 Mon Sep 17 00:00:00 2001 From: "Samuel E. Browne" Date: Wed, 4 Sep 2024 14:39:57 -0600 Subject: [PATCH 09/49] Concatenate EXTRA_CONFIGURE_ARGS correctly Signed-off-by: Samuel E. Browne --- .../trilinosprhelpers/TrilinosPRConfigurationStandard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationStandard.py b/packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationStandard.py index 1d1555bf113c..2970e6a53715 100644 --- a/packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationStandard.py +++ b/packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationStandard.py @@ -86,7 +86,7 @@ def execute_test(self): gpu_indices = gpu_utils.list_nvidia_gpus() self.message(f"-- REMARK: Using {slots_per_gpu} slots per GPU") self.message(f"-- REMARK: Using GPUs {gpu_indices}") - cmd.append(f"-DEXTRA_CONFIGURE_ARGS:STRING=-DTrilinos_AUTOGENERATE_TEST_RESOURCE_FILE:BOOL=ON; -DTrilinos_CUDA_NUM_GPUS:STRING={len(gpu_indices)}; -DTrilinos_CUDA_SLOTS_PER_GPU:STRING={slots_per_gpu}") + self.arg_extra_configure_args = f"-DTrilinos_AUTOGENERATE_TEST_RESOURCE_FILE:BOOL=ON;-DTrilinos_CUDA_NUM_GPUS:STRING={len(gpu_indices)};-DTrilinos_CUDA_SLOTS_PER_GPU:STRING={slots_per_gpu}" + (";" + self.arg_extra_configure_args if self.arg_extra_configure_args else "") if self.arg_extra_configure_args: cmd.append(f"-DEXTRA_CONFIGURE_ARGS:STRING={self.arg_extra_configure_args}") From 87d93a51b2a2fc5cc174e46d246592ed3a660166 Mon Sep 17 00:00:00 2001 From: "Samuel E. Browne" Date: Wed, 4 Sep 2024 14:53:24 -0600 Subject: [PATCH 10/49] Add ability to pass configure args through LaunchDriver.py Signed-off-by: Samuel E. Browne --- packages/framework/pr_tools/LaunchDriver.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/framework/pr_tools/LaunchDriver.py b/packages/framework/pr_tools/LaunchDriver.py index 72cccc84d7b8..fe4f20f40372 100755 --- a/packages/framework/pr_tools/LaunchDriver.py +++ b/packages/framework/pr_tools/LaunchDriver.py @@ -82,7 +82,9 @@ def main(argv): parser.add_argument('--in-container', default=False, action="store_true", help="Build is happening in a container") parser.add_argument("--kokkos-develop", default=False, action="store_true", - help="Build is requiring to pull the current develop of kokkos and kokkos-kernels packages") + help="Build is requiring to pull the current develop of kokkos and kokkos-kernels packages") + parser.add_argument("--extra-configure-args", + help="Extra arguments that will be passed to CMake for configuring Trilinos.") args = parser.parse_args(argv) if os.getenv("TRILINOS_DIR") == None: @@ -114,6 +116,9 @@ def main(argv): if args.kokkos_develop: cmd += " --kokkos-develop" + if args.extra_configure_args: + cmd += f" --extra-configure-args=\"{args.extra_configure_args}\"" + print("LaunchDriver> EXEC: " + cmd, flush=True) cmd_output = subprocess.run(cmd, shell=True) From 2c05ce0c43e3c13d4762e5a3d829f29bc1df9aa8 Mon Sep 17 00:00:00 2001 From: kliegeois Date: Thu, 5 Sep 2024 14:52:56 -0600 Subject: [PATCH 11/49] use createIntegratorAdjointSensitivity --- ...ro_ThyraProductME_Tempus_FinalObjective.hpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/packages/piro/src/Piro_ThyraProductME_Tempus_FinalObjective.hpp b/packages/piro/src/Piro_ThyraProductME_Tempus_FinalObjective.hpp index d2ddac64e1b8..bab8717e512a 100644 --- a/packages/piro/src/Piro_ThyraProductME_Tempus_FinalObjective.hpp +++ b/packages/piro/src/Piro_ThyraProductME_Tempus_FinalObjective.hpp @@ -261,6 +261,8 @@ run_tempus(const Thyra::ModelEvaluatorBase::InArgs& inArgs, // Override nominal values in model to supplied inArgs RCP wrapped_model = rcp(new DNBOME(thyra_model_, rcpFromRef(inArgs))); + RCP wrapped_adjoint_model = rcp(new DNBOME(thyra_adjoint_model_, rcpFromRef(inArgs))); + Real t; RCP > x, x_dot; @@ -280,26 +282,28 @@ run_tempus(const Thyra::ModelEvaluatorBase::InArgs& inArgs, // Create and run integrator if (compute_dgdp && sensitivity_method_ == "Adjoint") { - const bool integratorStatus = piroTempusIntegrator_->advanceTime(time_final_); + RCP > integrator = + Tempus::createIntegratorAdjointSensitivity(tempus_params_, wrapped_model, wrapped_adjoint_model); + const bool integratorStatus = integrator->advanceTime(time_final_); TEUCHOS_TEST_FOR_EXCEPTION( !integratorStatus, std::logic_error, "Integrator failed!"); // Get final state - t = piroTempusIntegrator_->getTime(); - x = piroTempusIntegrator_->getX(); - x_dot = piroTempusIntegrator_->getXDot(); + t = integrator->getTime(); + x = integrator->getX(); + x_dot = integrator->getXDot(); if(!dgdp_mv.is_null()) - Thyra::assign(dgdp_mv.ptr(), *(piroTempusIntegrator_->getDgDp())); + Thyra::assign(dgdp_mv.ptr(), *(integrator->getDgDp())); else { //dgdp_op->setBlock(0, 0, piroTempusIntegrator->getDgDp()); dgdp_mv = Teuchos::rcp_dynamic_cast>( Teuchos::rcp_dynamic_cast>(dgdp_op->getNonconstBlock(0, 0))->getNonconstOp() ); - Thyra::assign(dgdp_mv.ptr(), *(piroTempusIntegrator_->getDgDp())); + Thyra::assign(dgdp_mv.ptr(), *(integrator->getDgDp())); } } else { RCP > integrator = Tempus::createIntegratorBasic(tempus_params_, wrapped_model); - const bool integratorStatus = integrator->advanceTime(); + const bool integratorStatus = integrator->advanceTime(time_final_); TEUCHOS_TEST_FOR_EXCEPTION( !integratorStatus, std::logic_error, "Integrator failed!"); From 7c81aae16b9c451552e43fc7ac2386d8febe2969 Mon Sep 17 00:00:00 2001 From: "Justin M. LaPre" Date: Fri, 6 Sep 2024 17:57:56 +0000 Subject: [PATCH 12/49] hotfix for DoozyX/clang-format --- .github/workflows/clang_format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/clang_format.yml b/.github/workflows/clang_format.yml index 07339d6f819c..e713245ab364 100644 --- a/.github/workflows/clang_format.yml +++ b/.github/workflows/clang_format.yml @@ -12,7 +12,7 @@ jobs: steps: - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - - uses: DoozyX/clang-format-lint-action@d7f6a5bada32b7ea520b5918416e92997678e3fd # v0.18 + - uses: DoozyX/clang-format-lint-action@c71d0bf4e21876ebec3e5647491186f8797fde31 # v0.18.2 with: source: './packages/muelu ./packages/tempus ./packages/teko ./packages/xpetra' exclude: './packages/tempus/examples' From 9d05eb0beb39028c43aa5e69218e18f590cbd6cd Mon Sep 17 00:00:00 2001 From: kliegeois Date: Fri, 6 Sep 2024 13:52:43 -0600 Subject: [PATCH 13/49] Update the redirection of Tempus --- packages/piro/src/Piro_PerformAnalysis.cpp | 11 +++++++---- packages/piro/test/Main_AnalysisDriver_Tempus.cpp | 1 - 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/piro/src/Piro_PerformAnalysis.cpp b/packages/piro/src/Piro_PerformAnalysis.cpp index 7f603b9a8340..ac1c9766572d 100644 --- a/packages/piro/src/Piro_PerformAnalysis.cpp +++ b/packages/piro/src/Piro_PerformAnalysis.cpp @@ -939,8 +939,9 @@ Piro::PerformROLTransientAnalysis( auto algo = ROL::TypeB::AlgorithmFactory(rolParams.sublist("ROL Options")); std::streambuf *coutbuf; + std::ofstream out_file; if(rolParams.get("Redirect Tempus Output", true)) { - std::ofstream out_file(rolParams.get("Tempus Output Filename", "log_tempus.txt")); + out_file.open(rolParams.get("Tempus Output Filename", "log_tempus.txt")); coutbuf = std::cout.rdbuf(); std::cout.rdbuf(out_file.rdbuf()); } @@ -955,8 +956,9 @@ Piro::PerformROLTransientAnalysis( auto algo = ROL::TypeU::AlgorithmFactory(rolParams.sublist("ROL Options")); std::streambuf *coutbuf; - if(rolParams.get("Redirect Tempus Output", true)) { - std::ofstream out_file(rolParams.get("Tempus Output Filename", "log_tempus.txt")); + std::ofstream out_file; + if(rolParams.get("", true)) { + out_file.open(rolParams.get("Tempus Output Filename", "log_tempus.txt")); coutbuf = std::cout.rdbuf(); std::cout.rdbuf(out_file.rdbuf()); } @@ -1044,8 +1046,9 @@ Piro::PerformROLTransientAnalysis( } std::streambuf *coutbuf; + std::ofstream out_file; if(rolParams.get("Redirect Tempus Output", true)) { - std::ofstream out_file(rolParams.get("Tempus Output Filename", "log_tempus.txt")); + out_file.open(rolParams.get("Tempus Output Filename", "log_tempus.txt")); coutbuf = std::cout.rdbuf(); std::cout.rdbuf(out_file.rdbuf()); } diff --git a/packages/piro/test/Main_AnalysisDriver_Tempus.cpp b/packages/piro/test/Main_AnalysisDriver_Tempus.cpp index 09ed216b0c95..a6f3ee96f593 100644 --- a/packages/piro/test/Main_AnalysisDriver_Tempus.cpp +++ b/packages/piro/test/Main_AnalysisDriver_Tempus.cpp @@ -244,7 +244,6 @@ int main(int argc, char *argv[]) { if (mockModel=="MassSpringDamperModel") { p_exact[0] = 1.; p_exact[1] = 0.5; - tol = 1e-3; } double l2_diff = std::sqrt(std::pow(p_view(0)-p_exact[0],2) + std::pow(p_view(1)-p_exact[1],2)); From e3dadeaf4e1e080bd7bd2271e0a651f8fa4df219 Mon Sep 17 00:00:00 2001 From: Maarten Arnst Date: Mon, 9 Sep 2024 11:19:15 +0200 Subject: [PATCH 14/49] Refactor create_mirror for View of MP Vector --- .../KokkosExp_View_MP_Vector_Contiguous.hpp | 206 +++++++----------- .../vector/Kokkos_View_MP_Vector_Fwd.hpp | 114 +++++----- 2 files changed, 134 insertions(+), 186 deletions(-) diff --git a/packages/stokhos/src/sacado/kokkos/vector/KokkosExp_View_MP_Vector_Contiguous.hpp b/packages/stokhos/src/sacado/kokkos/vector/KokkosExp_View_MP_Vector_Contiguous.hpp index 6e949e3808fa..552c84ec1649 100644 --- a/packages/stokhos/src/sacado/kokkos/vector/KokkosExp_View_MP_Vector_Contiguous.hpp +++ b/packages/stokhos/src/sacado/kokkos/vector/KokkosExp_View_MP_Vector_Contiguous.hpp @@ -92,150 +92,106 @@ struct FlatArrayType< View, typedef View type; }; -template< class T , class ... P > -inline -typename std::enable_if< - std::is_same< typename ViewTraits::specialize , - Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value && - !std::is_same< typename Kokkos::ViewTraits::array_layout, - Kokkos::LayoutStride >::value, - typename Kokkos::View::HostMirror>::type -create_mirror(const Kokkos::View & src) +template +inline auto create_mirror( + const Impl::ViewCtorProp& arg_prop, + const View& src, + typename std::enable_if_t< + std::is_same_v::specialize, + Experimental::Impl::ViewMPVectorContiguous>>* +) { - typedef View src_type ; - typedef typename src_type::HostMirror dst_type ; + static_assert(std::is_same_v::array_layout, LayoutLeft> || + std::is_same_v::array_layout, LayoutRight> || + std::is_same_v::array_layout, LayoutStride>); - typename src_type::array_layout layout = src.layout(); - layout.dimension[src_type::rank] = Kokkos::dimension_scalar(src); + using src_type = View; - return dst_type(std::string(src.label()).append("_mirror"), layout); -} + auto layout = [&] () { + if constexpr ( ! std::is_same_v::array_layout, LayoutStride>) { + return src.layout(); + } else { + LayoutStride layout; -template< class T , class ... P > -inline -typename std::enable_if< - std::is_same< typename ViewTraits::specialize , - Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value && - std::is_same< typename Kokkos::ViewTraits::array_layout, - Kokkos::LayoutStride >::value, - typename Kokkos::View::HostMirror>::type -create_mirror(const Kokkos::View & src) -{ - typedef View src_type ; - typedef typename src_type::HostMirror dst_type ; - - Kokkos::LayoutStride layout ; - - layout.dimension[0] = src.extent(0); - layout.dimension[1] = src.extent(1); - layout.dimension[2] = src.extent(2); - layout.dimension[3] = src.extent(3); - layout.dimension[4] = src.extent(4); - layout.dimension[5] = src.extent(5); - layout.dimension[6] = src.extent(6); - layout.dimension[7] = src.extent(7); - - layout.stride[0] = src.stride_0(); - layout.stride[1] = src.stride_1(); - layout.stride[2] = src.stride_2(); - layout.stride[3] = src.stride_3(); - layout.stride[4] = src.stride_4(); - layout.stride[5] = src.stride_5(); - layout.stride[6] = src.stride_6(); - layout.stride[7] = src.stride_7(); + for (int idx = 0; idx <= 7; ++idx) { + layout.dimension[idx] = src.extent(idx); + layout.stride [idx] = src.stride(idx); + } - layout.dimension[src_type::rank] = Kokkos::dimension_scalar(src); + return layout; + } + }(); + + layout.dimension[src_type::rank] = dimension_scalar(src); + + const auto prop_copy = Impl::with_properties_if_unset( + arg_prop, std::string(src.label()).append("_mirror")); - return dst_type(std::string(src.label()).append("_mirror"), layout); + if constexpr (Impl::ViewCtorProp::has_memory_space){ + return typename Impl::MirrorType::memory_space, T, P ...>::view_type(prop_copy, layout); + } else { + return typename View::HostMirror(prop_copy, layout); + } } -template -typename std::enable_if< - std::is_same< typename ViewTraits::specialize , - Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value, - typename Impl::MirrorType::view_type>::type -create_mirror(const Space& , const Kokkos::View & src) +template +inline auto create_mirror( + const View& src, + typename std::enable_if_t< + std::is_same_v::specialize, + Experimental::Impl::ViewMPVectorContiguous>>* +) { - typedef View src_type ; - typename src_type::array_layout layout = src.layout(); - layout.dimension[src_type::rank] = Kokkos::dimension_scalar(src); - return typename Impl::MirrorType::view_type(src.label(),layout); + return create_mirror(view_alloc(), src); } -template< class T , class ... P > -inline -typename std::enable_if< - std::is_same< typename ViewTraits::specialize , - Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value && - !std::is_same< typename Kokkos::ViewTraits::array_layout, - Kokkos::LayoutStride >::value, - typename Kokkos::View::HostMirror>::type -create_mirror(Kokkos::Impl::WithoutInitializing_t wi, - const Kokkos::View & src) +template +inline auto create_mirror( + const Space& space, + const View& src, + typename std::enable_if_t< + std::is_same_v::specialize, + Experimental::Impl::ViewMPVectorContiguous>>* +) { - typedef View src_type ; - typedef typename src_type::HostMirror dst_type ; - - typename src_type::array_layout layout = src.layout(); - layout.dimension[src_type::rank] = Kokkos::dimension_scalar(src); - - return dst_type( - Kokkos::view_alloc(std::string(src.label()).append("_mirror"), wi), layout); + return create_mirror(view_alloc(space), src); } -template< class T , class ... P > -inline -typename std::enable_if< - std::is_same< typename ViewTraits::specialize , - Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value && - std::is_same< typename Kokkos::ViewTraits::array_layout, - Kokkos::LayoutStride >::value, - typename Kokkos::View::HostMirror>::type -create_mirror(Kokkos::Impl::WithoutInitializing_t wi, - const Kokkos::View & src) +template +inline auto create_mirror( + Impl::WithoutInitializing_t wi, + const View& src, + typename std::enable_if_t< + std::is_same_v::specialize, + Experimental::Impl::ViewMPVectorContiguous>>* +) { - typedef View src_type ; - typedef typename src_type::HostMirror dst_type ; - - Kokkos::LayoutStride layout ; - - layout.dimension[0] = src.extent(0); - layout.dimension[1] = src.extent(1); - layout.dimension[2] = src.extent(2); - layout.dimension[3] = src.extent(3); - layout.dimension[4] = src.extent(4); - layout.dimension[5] = src.extent(5); - layout.dimension[6] = src.extent(6); - layout.dimension[7] = src.extent(7); - - layout.stride[0] = src.stride_0(); - layout.stride[1] = src.stride_1(); - layout.stride[2] = src.stride_2(); - layout.stride[3] = src.stride_3(); - layout.stride[4] = src.stride_4(); - layout.stride[5] = src.stride_5(); - layout.stride[6] = src.stride_6(); - layout.stride[7] = src.stride_7(); - - layout.dimension[src_type::rank] = Kokkos::dimension_scalar(src); + return create_mirror(view_alloc(wi), src); +} - return dst_type( - Kokkos::view_alloc(std::string(src.label()).append("_mirror"), wi), layout); +template +inline auto create_mirror( + Impl::WithoutInitializing_t wi, + const Space& space, + const View& src, + typename std::enable_if_t< + std::is_same_v::specialize, + Experimental::Impl::ViewMPVectorContiguous>>* +) +{ + return create_mirror(view_alloc(wi, space), src); } -template -typename std::enable_if< - std::is_same< typename ViewTraits::specialize , - Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value, - typename Impl::MirrorType::view_type>::type -create_mirror(Kokkos::Impl::WithoutInitializing_t wi, - const Space&, const Kokkos::View & src) +template +inline auto create_mirror_view( + const Impl::ViewCtorProp& arg_prop, + const Kokkos::View& src, + typename std::enable_if_t< + std::is_same_v::specialize, + Experimental::Impl::ViewMPVectorContiguous>>* +) { - typedef View src_type ; - typename src_type::array_layout layout = src.layout(); - layout.dimension[src_type::rank] = Kokkos::dimension_scalar(src); - return typename Impl::MirrorType::view_type( - Kokkos::view_alloc(src.label(), wi), layout); + return Impl::create_mirror_view(src, arg_prop); } template diff --git a/packages/stokhos/src/sacado/kokkos/vector/Kokkos_View_MP_Vector_Fwd.hpp b/packages/stokhos/src/sacado/kokkos/vector/Kokkos_View_MP_Vector_Fwd.hpp index 2071f7ef9a8e..f6a465e2b42d 100644 --- a/packages/stokhos/src/sacado/kokkos/vector/Kokkos_View_MP_Vector_Fwd.hpp +++ b/packages/stokhos/src/sacado/kokkos/vector/Kokkos_View_MP_Vector_Fwd.hpp @@ -60,67 +60,59 @@ namespace Kokkos { // Declare overloads of create_mirror() so they are in scope // Kokkos_Core.hpp is included below -template< class T , class ... P > -inline -typename std::enable_if< - std::is_same< typename ViewTraits::specialize , - Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value && - !std::is_same< typename Kokkos::ViewTraits::array_layout, - Kokkos::LayoutStride >::value, - typename Kokkos::View::HostMirror>::type -create_mirror(const Kokkos::View & src); - -template< class T , class ... P > -inline -typename std::enable_if< - std::is_same< typename ViewTraits::specialize , - Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value && - std::is_same< typename Kokkos::ViewTraits::array_layout, - Kokkos::LayoutStride >::value, - typename Kokkos::View::HostMirror>::type -create_mirror(const Kokkos::View & src); - -template::value>> -typename std::enable_if< - std::is_same< typename ViewTraits::specialize , - Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value, - typename Impl::MirrorType::view_type>::type -create_mirror(const Space&, - const Kokkos::View & src); - -template< class T , class ... P > -inline -typename std::enable_if< - std::is_same< typename ViewTraits::specialize , - Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value && - !std::is_same< typename Kokkos::ViewTraits::array_layout, - Kokkos::LayoutStride >::value, - typename Kokkos::View::HostMirror>::type -create_mirror(Kokkos::Impl::WithoutInitializing_t wi, - const Kokkos::View & src); - -template< class T , class ... P > -inline -typename std::enable_if< - std::is_same< typename ViewTraits::specialize , - Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value && - std::is_same< typename Kokkos::ViewTraits::array_layout, - Kokkos::LayoutStride >::value, - typename Kokkos::View::HostMirror>::type -create_mirror(Kokkos::Impl::WithoutInitializing_t wi, - const Kokkos::View & src); - -template::value>> -typename std::enable_if< - std::is_same< typename ViewTraits::specialize , - Kokkos::Experimental::Impl::ViewMPVectorContiguous >::value, - typename Impl::MirrorType::view_type>::type - create_mirror( - Kokkos::Impl::WithoutInitializing_t wi, - const Space&, - const Kokkos::View & src); +template +inline auto create_mirror( + const Impl::ViewCtorProp& arg_prop, + const View& src, + typename std::enable_if_t< + std::is_same_v::specialize, + Experimental::Impl::ViewMPVectorContiguous>>* = nullptr +); + +template +inline auto create_mirror( + const View& src, + typename std::enable_if_t< + std::is_same_v::specialize, + Experimental::Impl::ViewMPVectorContiguous>>* = nullptr +); + +template ::value>> +inline auto create_mirror( + const Space& space, + const View& src, + typename std::enable_if_t< + std::is_same_v::specialize, + Experimental::Impl::ViewMPVectorContiguous>>* = nullptr +); + +template +inline auto create_mirror( + Impl::WithoutInitializing_t wi, + const View& src, + typename std::enable_if_t< + std::is_same_v::specialize, + Experimental::Impl::ViewMPVectorContiguous>>* = nullptr +); + +template ::value>> +inline auto create_mirror( + Impl::WithoutInitializing_t wi, + const Space& space, + const View& src, + typename std::enable_if_t< + std::is_same_v::specialize, + Experimental::Impl::ViewMPVectorContiguous>>* = nullptr +); + +template +inline auto create_mirror_view( + const Impl::ViewCtorProp& arg_prop, + const Kokkos::View& src, + typename std::enable_if_t< + std::is_same_v::specialize, + Experimental::Impl::ViewMPVectorContiguous>>* = nullptr +); template typename Impl::MirrorViewType::view_type From 3b416e80dfae46883b43356ac878d60601e722c0 Mon Sep 17 00:00:00 2001 From: Roger Pawlowski Date: Mon, 9 Sep 2024 08:59:50 -0600 Subject: [PATCH 15/49] Phalanx: fix for gcc 15 --- .../phalanx/src/Phalanx_TemplateIterator.hpp | 4 +-- .../TemplateManager/TemplateManagerTest.cpp | 26 ++++++++++++++++++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/packages/phalanx/src/Phalanx_TemplateIterator.hpp b/packages/phalanx/src/Phalanx_TemplateIterator.hpp index adf0e83c2a29..fe0a163c8c8d 100644 --- a/packages/phalanx/src/Phalanx_TemplateIterator.hpp +++ b/packages/phalanx/src/Phalanx_TemplateIterator.hpp @@ -50,7 +50,7 @@ namespace PHX { //! Equal operator bool operator==(const TemplateIterator& t) const { - return object_iterator == t.objectIterator; + return object_iterator == t.object_iterator; } //! Not equal operator @@ -128,7 +128,7 @@ namespace PHX { //! Equal operator bool operator==(const ConstTemplateIterator& t) const { - return object_iterator == t.objectIterator; + return object_iterator == t.object_iterator; } //! Not equal operator diff --git a/packages/phalanx/test/TemplateManager/TemplateManagerTest.cpp b/packages/phalanx/test/TemplateManager/TemplateManagerTest.cpp index 3a0e5389105d..6024b3fda4b8 100644 --- a/packages/phalanx/test/TemplateManager/TemplateManagerTest.cpp +++ b/packages/phalanx/test/TemplateManager/TemplateManagerTest.cpp @@ -1,6 +1,6 @@ // @HEADER // ***************************************************************************** -// Phalanx: A Partial Differential Equation Field Evaluation +// Phalanx: A Partial Differential Equation Field Evaluation // Kernel for Flexible Management of Complex Dependency Chains // // Copyright 2008 NTESS and the Phalanx contributors. @@ -58,3 +58,27 @@ TEUCHOS_UNIT_TEST(template_manager_test, basic) auto r2 = tm.getAsObject(); TEST_ASSERT(r2.is_null()); } + +TEUCHOS_UNIT_TEST(template_manager_test, iterator_ops) +{ + using namespace PHX; + DummyTemplateManager tm; + + auto start = tm.begin(); + auto start_again = tm.begin(); + auto end = tm.end(); + + TEST_ASSERT(start == start_again); + TEST_ASSERT(start != end); + + ++start; + TEST_ASSERT(start != start_again); + + start_again++; + TEST_ASSERT(start == start_again); + + ++start; + start_again++; + TEST_ASSERT(start == end); + TEST_ASSERT(start_again == end); +} From 14f8059b3b451a82eb1bef99df4c4208a58db144 Mon Sep 17 00:00:00 2001 From: Carl Pearson Date: Wed, 4 Sep 2024 10:56:45 -0600 Subject: [PATCH 16/49] Tpetra MatrixMatrix: sort for cuSparse --- .../core/ext/TpetraExt_MatrixMatrix_Cuda.hpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/packages/tpetra/core/ext/TpetraExt_MatrixMatrix_Cuda.hpp b/packages/tpetra/core/ext/TpetraExt_MatrixMatrix_Cuda.hpp index 702cc6b87ca0..2615b0562a19 100644 --- a/packages/tpetra/core/ext/TpetraExt_MatrixMatrix_Cuda.hpp +++ b/packages/tpetra/core/ext/TpetraExt_MatrixMatrix_Cuda.hpp @@ -170,7 +170,20 @@ void KernelWrappersgetLocalNumElements()); + KCRS Bmerged = Tpetra::MMdetails::merge_matrices(Aview,Bview,Acol2Brow,Acol2Irow,Bcol2Ccol,Icol2Ccol,C.getColMap()->getLocalNumElements()); + + + // if Kokkos Kernels is going to use the cuSparse TPL for SpGEMM, this matrix + // needs to be sorted + // Try to mirror the Kokkos Kernels internal SpGEMM TPL use logic + // inspired by https://github.com/trilinos/Trilinos/pull/11709 +#if defined(KOKKOS_ENABLE_CUDA) \ + && defined(KOKKOSKERNELS_ENABLE_TPL_CUSPARSE) \ + && ((CUDA_VERSION < 11000) || (CUDA_VERSION >= 11040)) + if constexpr (std::is_same_v) { + KokkosSparse::sort_crs_matrix(Bmerged); + } +#endif #ifdef HAVE_TPETRA_MMM_TIMINGS MM = Teuchos::null; MM = rcp(new TimeMonitor (*TimeMonitor::getNewTimer(prefix_mmm + std::string("MMM Newmatrix CudaCore")))); From 3316e4971f95902f6d27c2b80ea6c3ccf33a3514 Mon Sep 17 00:00:00 2001 From: Carl Pearson Date: Mon, 9 Sep 2024 08:59:20 -0600 Subject: [PATCH 17/49] tpetra: check if local matrix is sorted before spgemm --- packages/tpetra/core/ext/TpetraExt_MatrixMatrix_Cuda.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/tpetra/core/ext/TpetraExt_MatrixMatrix_Cuda.hpp b/packages/tpetra/core/ext/TpetraExt_MatrixMatrix_Cuda.hpp index 2615b0562a19..0fa8e2211f93 100644 --- a/packages/tpetra/core/ext/TpetraExt_MatrixMatrix_Cuda.hpp +++ b/packages/tpetra/core/ext/TpetraExt_MatrixMatrix_Cuda.hpp @@ -177,11 +177,14 @@ void KernelWrappers= 11040)) if constexpr (std::is_same_v) { - KokkosSparse::sort_crs_matrix(Bmerged); + if (!KokkosSparse::isCrsGraphSorted(Bmerged.graph.row_map, Bmerged.graph.entries)) { + KokkosSparse::sort_crs_matrix(Bmerged); + } } #endif From e38553ee79845dba220b0341998af3cd03f04c59 Mon Sep 17 00:00:00 2001 From: "Samuel E. Browne" Date: Mon, 9 Sep 2024 11:18:45 -0600 Subject: [PATCH 18/49] Change logic to have promoted and upcoming warnings Also add ability to pass extra warnings for experimentation. Signed-off-by: Samuel E. Browne --- cmake/WarningsErrorsPolicy.cmake | 31 +++++++++++++------ packages/framework/ini-files/config-specs.ini | 2 +- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/cmake/WarningsErrorsPolicy.cmake b/cmake/WarningsErrorsPolicy.cmake index 0720cc69bb99..3fd5fc113823 100644 --- a/cmake/WarningsErrorsPolicy.cmake +++ b/cmake/WarningsErrorsPolicy.cmake @@ -1,6 +1,3 @@ -set(warnings shadow parentheses sign-compare unused-variable) - - macro(disable_warnings_for_deprecated_packages) message(STATUS "Disabling all warnings/errors for deprecated packages") foreach(package deprecated_packages) @@ -9,16 +6,32 @@ macro(disable_warnings_for_deprecated_packages) endmacro() -if("${Trilinos_WARNINGS}" STREQUAL "WARN") +macro(enable_warnings warnings) message(STATUS "Trilinos warnings enabled: ${warnings}") foreach(warning ${warnings}) set(CMAKE_CXX_FLAGS "-W${warning} -Wno-error=${warning} ${CMAKE_CXX_FLAGS}") endforeach() - disable_warnings_for_deprecated_packages() -elseif("${Trilinos_WARNINGS}" STREQUAL "ERROR") - message(STATUS "Trilinos warnings-as-errors enabled: ${warnings}") - foreach(warning ${warnings}) - set(CMAKE_CXX_FLAGS "-W${warning} -Wno-error=${warning} ${CMAKE_CXX_FLAGS}") +endmacro() + + +macro(enable_errors errors) + message(STATUS "Trilinos warnings-as-errors enabled: ${errors}") + foreach(error ${errors}) + set(CMAKE_CXX_FLAGS "-Werror=${error} ${CMAKE_CXX_FLAGS}") endforeach() +endmacro() + + +set(upcoming_warnings shadow ${Trilinos_ADDITIONAL_WARNINGS}) +set(promoted_warnings parentheses sign-compare unused-variable) + + +if("${Trilinos_WARNINGS_MODE}" STREQUAL "WARN") + enable_warnings("${upcoming_warnings}") + enable_errors("${promoted_warnings}") + disable_warnings_for_deprecated_packages() +elseif("${Trilinos_WARNINGS_MODE}" STREQUAL "ERROR") + enable_errors("${upcoming_warnings}") + enable_errors("${promoted_warnings}") disable_warnings_for_deprecated_packages() endif() diff --git a/packages/framework/ini-files/config-specs.ini b/packages/framework/ini-files/config-specs.ini index 72e9217eb3a0..03949422566a 100644 --- a/packages/framework/ini-files/config-specs.ini +++ b/packages/framework/ini-files/config-specs.ini @@ -1180,7 +1180,7 @@ opt-set-cmake-var TPL_LAPACK_LIBRARIES STRING FORCE : -L${LAPACK_ROOT|ENV}/ [COMPILER|GNU] opt-set-cmake-var MPI_EXEC FILEPATH : mpirun -opt-set-cmake-var Trilinos_WARNINGS STRING : WARN +opt-set-cmake-var Trilinos_WARNINGS_MODE STRING : WARN [COMPILER|INTEL] opt-set-cmake-var MPI_EXEC FILEPATH : mpirun From 2ae26f68d239fd86d8d74e5ba9f91412bcbfaf58 Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Mon, 9 Sep 2024 16:22:06 -0600 Subject: [PATCH 19/49] IOSS: Fix shadow variable in region --- packages/seacas/libraries/ioss/src/Ioss_Region.C | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/seacas/libraries/ioss/src/Ioss_Region.C b/packages/seacas/libraries/ioss/src/Ioss_Region.C index 725d07e9cb12..9c9c60607f9a 100644 --- a/packages/seacas/libraries/ioss/src/Ioss_Region.C +++ b/packages/seacas/libraries/ioss/src/Ioss_Region.C @@ -3040,17 +3040,17 @@ namespace Ioss { void Region::update_dynamic_topology() { - auto topologyObserver = get_mesh_modification_observer(); + auto topology_observer = get_mesh_modification_observer(); - bool has_output_observer = topologyObserver && !get_database()->is_input(); - if (has_output_observer && topologyObserver->is_topology_modified()) { - if(topologyObserver->get_control_option() != FileControlOption::CONTROL_NONE) { + bool has_output_observer = topology_observer && !get_database()->is_input(); + if (has_output_observer && topology_observer->is_topology_modified()) { + if(topology_observer->get_control_option() != FileControlOption::CONTROL_NONE) { int steps = get_property("state_count").get_int(); start_new_output_database_entry(steps); - topologyObserver->define_model(); - topologyObserver->write_model(); - topologyObserver->define_transient(); + topology_observer->define_model(); + topology_observer->write_model(); + topology_observer->define_transient(); } topologyObserver->reset_topology_modification(); } From 69ad144b11ffaec8578d366c272a29d3a324faf0 Mon Sep 17 00:00:00 2001 From: Anderson Chauphan Date: Mon, 9 Sep 2024 17:38:47 -0600 Subject: [PATCH 20/49] Added config specs for Python 3.8 container Added configuration specifications for a barebones Python 3.8 container to support Framework unit tests. Signed-off-by: Anderson Chauphan --- packages/framework/ini-files/config-specs.ini | 65 +++++++++++++++++++ .../framework/ini-files/environment-specs.ini | 2 + .../framework/ini-files/supported-envs.ini | 1 + 3 files changed, 68 insertions(+) diff --git a/packages/framework/ini-files/config-specs.ini b/packages/framework/ini-files/config-specs.ini index e6f99810e080..af62d53a0a75 100644 --- a/packages/framework/ini-files/config-specs.ini +++ b/packages/framework/ini-files/config-specs.ini @@ -2167,3 +2167,68 @@ use SEMS_COMMON_CUDA_11 opt-set-cmake-var Trilinos_ENABLE_TESTS BOOL FORCE : OFF opt-set-cmake-var Kokkos_ENABLE_TESTS BOOL FORCE : ON + + +[rhel8_python-3.8_debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_no-mpi_no-pt_no-rdc_no-uvm_deprecated-on_pr-framework] +use COMMON + +use COMPILER|GNU +use NODE-TYPE|SERIAL +use BUILD-TYPE|DEBUG +use LIB-TYPE|SHARED +use KOKKOS-ARCH|NO-KOKKOS-ARCH +use USE-ASAN|NO +use USE-FPIC|NO +use USE-MPI|NO +use USE-PT|NO +use USE-COMPLEX|NO +use USE-RDC|NO +use USE-UVM|NO +use USE-DEPRECATED|YES + +use PACKAGE-ENABLES|PR-FRAMEWORK + +# Use the below option only when submitting to the dashboard +#opt-set-cmake-var CTEST_USE_LAUNCHERS BOOL FORCE : ON + +opt-set-cmake-var TFW_Python3_Testing BOOL FORCE : ON +opt-set-cmake-var TFW_Python_Testing BOOL FORCE : ON + +opt-set-cmake-var PYTHON_PIP_EXECUTABLE STRING FORCE : pip3 +opt-set-cmake-var PYTHON_EXECUTABLE_SEARCH_PATHS STRING FORCE : ${PYTHON_EXECUTABLE_SEARCH_PATHS|ENV} + +# Note: there is no way to capture the below cmake logic in our ini files. +# Instead, we just set the PYTHON_EXECUTABLE to the result of +# 'envvar-find-in-path PYTHON_EXECUTABLE : python3' from environment-specs.ini + +# find_program(PYTHON_EXECUTABLE +# NAMES python3 python +# PATHS ${PYTHON_EXECUTABLE_SEARCH_PATHS} +# PATH_SUFFIXES bin +# DOC "Set by default for PR testing" +# NO_DEFAULT_PATH +# ) +# if(DEFINED PYTHON_EXECUTABLE_NOTFOUND) +# message(FATAL_ERROR "Unable to locate Python in ${PYTHON_EXECUTABLE_SEARCH_PATHS}") +# else() +# message(STATUS "PYTHON FOUND: ${PYTHON_EXECUTABLE}") +# endif() +opt-set-cmake-var PYTHON_EXECUTABLE STRING FORCE : ${PYTHON_EXECUTABLE|ENV} + + +opt-set-cmake-var TPL_ENABLE_Boost BOOL FORCE : OFF +opt-set-cmake-var TPL_ENABLE_BoostLib BOOL FORCE : OFF +opt-set-cmake-var TPL_ENABLE_ParMETIS BOOL FORCE : OFF +opt-set-cmake-var TPL_ENABLE_Zlib BOOL FORCE : OFF +opt-set-cmake-var TPL_ENABLE_HDF5 BOOL FORCE : OFF +opt-set-cmake-var TPL_ENABLE_Netcdf BOOL FORCE : OFF +opt-set-cmake-var TPL_ENABLE_SuperLU BOOL FORCE : OFF +opt-set-cmake-var TPL_ENABLE_Scotch BOOL FORCE : OFF + +# No build stats for Python-only PR (#7376) +opt-set-cmake-var Trilinos_ENABLE_BUILD_STATS BOOL FORCE : OFF + + + + + diff --git a/packages/framework/ini-files/environment-specs.ini b/packages/framework/ini-files/environment-specs.ini index 4f91beb46394..9876d09ff58f 100644 --- a/packages/framework/ini-files/environment-specs.ini +++ b/packages/framework/ini-files/environment-specs.ini @@ -166,6 +166,8 @@ envvar-set OMPI_CXX: ${TRILINOS_DIR}/packages/kokkos/bin/nvcc_wrapper [rhel8_aue-gcc-openmpi] +[rhel8_python-3.8] + [rhel8_oneapi-intelmpi] use MPI-COMPILER-VARS envvar-find-in-path I_MPI_CXX : icpx diff --git a/packages/framework/ini-files/supported-envs.ini b/packages/framework/ini-files/supported-envs.ini index 09806455ec2e..aacf2f12acad 100644 --- a/packages/framework/ini-files/supported-envs.ini +++ b/packages/framework/ini-files/supported-envs.ini @@ -174,6 +174,7 @@ gnu [rhel8] aue-gnu-12.1.0-anaconda3-serial +python-3.8 oneapi-intelmpi cuda-gcc-openmpi gcc-openmpi From 991575620eb5ace769b52fae84dc06a247a78f5d Mon Sep 17 00:00:00 2001 From: "Samuel E. Browne" Date: Mon, 9 Sep 2024 20:56:25 -0600 Subject: [PATCH 21/49] Move configure_args handling into property Signed-off-by: Samuel E. Browne --- .../TrilinosPRConfigurationBase.py | 14 +++++++++++++- .../TrilinosPRConfigurationStandard.py | 11 ----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationBase.py b/packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationBase.py index 99b30697985b..0667670182c5 100644 --- a/packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationBase.py +++ b/packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationBase.py @@ -18,6 +18,7 @@ from .sysinfo import SysInfo from LoadEnv.load_env import LoadEnv import setenvironment +from .sysinfo import gpu_utils @@ -74,6 +75,7 @@ def __init__(self, args): self._concurrency_build = None self._concurrency_test = None self._debug_level = 1 + self._arg_extra_configure_args = None # -------------------- @@ -93,7 +95,17 @@ def arg_extra_configure_args(self): Returns: self.args.extra_configure_args """ - return self.args.extra_configure_args + if not self._arg_extra_configure_args: + if gpu_utils.has_nvidia_gpus(): + self.message("-- REMARK: I see that I am running on a machine that has NVidia GPUs; I will feed TriBITS some data enabling GPU resource management") + slots_per_gpu = 2 + gpu_indices = gpu_utils.list_nvidia_gpus() + self.message(f"-- REMARK: Using {slots_per_gpu} slots per GPU") + self.message(f"-- REMARK: Using GPUs {gpu_indices}") + self._arg_extra_configure_args = f"-DTrilinos_AUTOGENERATE_TEST_RESOURCE_FILE:BOOL=ON;-DTrilinos_CUDA_NUM_GPUS:STRING={len(gpu_indices)};-DTrilinos_CUDA_SLOTS_PER_GPU:STRING={slots_per_gpu}" + (";" + self.args.extra_configure_args if self.args.extra_configure_args else "") + else: + self._arg_extra_configure_args = self.args.extra_configure_args + return self._arg_extra_configure_args @property def arg_ctest_driver(self): diff --git a/packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationStandard.py b/packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationStandard.py index 2970e6a53715..9363678eb553 100644 --- a/packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationStandard.py +++ b/packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationStandard.py @@ -10,7 +10,6 @@ from . import TrilinosPRConfigurationBase from gen_config import GenConfig from pathlib import Path -from .sysinfo import gpu_utils class TrilinosPRConfigurationStandard(TrilinosPRConfigurationBase): @@ -79,19 +78,9 @@ def execute_test(self): "-DUSE_EXPLICIT_TRILINOS_CACHEFILE:BOOL=" + "ON" if self.arg_use_explicit_cachefile else "OFF", ] - - if gpu_utils.has_nvidia_gpus(): - self.message("-- REMARK: I see that I am running on a machine that has NVidia GPUs; I will feed TriBITS some data enabling GPU resource management") - slots_per_gpu = 2 - gpu_indices = gpu_utils.list_nvidia_gpus() - self.message(f"-- REMARK: Using {slots_per_gpu} slots per GPU") - self.message(f"-- REMARK: Using GPUs {gpu_indices}") - self.arg_extra_configure_args = f"-DTrilinos_AUTOGENERATE_TEST_RESOURCE_FILE:BOOL=ON;-DTrilinos_CUDA_NUM_GPUS:STRING={len(gpu_indices)};-DTrilinos_CUDA_SLOTS_PER_GPU:STRING={slots_per_gpu}" + (";" + self.arg_extra_configure_args if self.arg_extra_configure_args else "") - if self.arg_extra_configure_args: cmd.append(f"-DEXTRA_CONFIGURE_ARGS:STRING={self.arg_extra_configure_args}") - self.message( "--- ctest version:") if not self.args.dry_run: try: From dd9916259627b8de5654345228e93c6e2872ff88 Mon Sep 17 00:00:00 2001 From: "Samuel E. Browne" Date: Mon, 9 Sep 2024 23:04:07 -0600 Subject: [PATCH 22/49] Remove warnings in favor of build-system policy Moved these three warnings (sign-compare, parentheses, unused-variable) into WarningsErrorsPolicy.cmake. Signed-off-by: Samuel E. Browne --- packages/framework/ini-files/config-specs.ini | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/framework/ini-files/config-specs.ini b/packages/framework/ini-files/config-specs.ini index 03949422566a..077149810ced 100644 --- a/packages/framework/ini-files/config-specs.ini +++ b/packages/framework/ini-files/config-specs.ini @@ -1230,7 +1230,7 @@ opt-set-cmake-var SuperLU_INCLUDE_DIRS STRING FORCE : ${SUPERLU_INC|ENV} opt-set-cmake-var SuperLU_LIBRARY_DIRS STRING FORCE : ${SUPERLU_LIB|ENV} #CXX Settings -opt-set-cmake-var CMAKE_CXX_FLAGS STRING : -fPIC -Wall -Warray-bounds -Wchar-subscripts -Wcomment -Wenum-compare -Wformat -Wuninitialized -Wmaybe-uninitialized -Wmain -Wnarrowing -Wnonnull -Wparentheses -Wreorder -Wreturn-type -Wsign-compare -Wsequence-point -Wtrigraphs -Wunused-function -Wunused-but-set-variable -Wunused-variable -Wwrite-strings +opt-set-cmake-var CMAKE_CXX_FLAGS STRING : -fPIC -Wall -Warray-bounds -Wchar-subscripts -Wcomment -Wenum-compare -Wformat -Wuninitialized -Wmaybe-uninitialized -Wmain -Wnarrowing -Wnonnull -Wreorder -Wreturn-type -Wsequence-point -Wtrigraphs -Wunused-function -Wunused-but-set-variable -Wwrite-strings #Package Options opt-set-cmake-var EpetraExt_ENABLE_HDF5 BOOL FORCE : OFF @@ -1484,7 +1484,7 @@ opt-set-cmake-var SuperLU_INCLUDE_DIRS STRING FORCE : ${SUPERLU_INC|ENV} opt-set-cmake-var SuperLU_LIBRARY_DIRS STRING FORCE : ${SUPERLU_LIB|ENV} #CXX Settings -opt-set-cmake-var CMAKE_CXX_FLAGS STRING : -fPIC -Wall -Warray-bounds -Wchar-subscripts -Wcomment -Wenum-compare -Wformat -Wuninitialized -Wmaybe-uninitialized -Wmain -Wnarrowing -Wnonnull -Wparentheses -Wreorder -Wreturn-type -Wsign-compare -Wsequence-point -Wtrigraphs -Wunused-function -Wunused-but-set-variable -Wunused-variable -Wwrite-strings +opt-set-cmake-var CMAKE_CXX_FLAGS STRING : -fPIC -Wall -Warray-bounds -Wchar-subscripts -Wcomment -Wenum-compare -Wformat -Wuninitialized -Wmaybe-uninitialized -Wmain -Wnarrowing -Wnonnull -Wreorder -Wreturn-type -Wsequence-point -Wtrigraphs -Wunused-function -Wunused-but-set-variable -Wwrite-strings #Package Options opt-set-cmake-var EpetraExt_ENABLE_HDF5 BOOL FORCE : OFF @@ -1626,7 +1626,7 @@ opt-set-cmake-var SuperLU_INCLUDE_DIRS STRING FORCE : ${SUPERLU_INC|ENV} opt-set-cmake-var SuperLU_LIBRARY_DIRS STRING FORCE : ${SUPERLU_LIB|ENV} #CXX Settings -opt-set-cmake-var CMAKE_CXX_FLAGS STRING : -fPIC -Wall -Warray-bounds -Wchar-subscripts -Wcomment -Wenum-compare -Wformat -Wuninitialized -Wmaybe-uninitialized -Wmain -Wnarrowing -Wnonnull -Wparentheses -Wreorder -Wreturn-type -Wsign-compare -Wsequence-point -Wtrigraphs -Wunused-function -Wunused-but-set-variable -Wunused-variable -Wwrite-strings +opt-set-cmake-var CMAKE_CXX_FLAGS STRING : -fPIC -Wall -Warray-bounds -Wchar-subscripts -Wcomment -Wenum-compare -Wformat -Wuninitialized -Wmaybe-uninitialized -Wmain -Wnarrowing -Wnonnull -Wreorder -Wreturn-type -Wsequence-point -Wtrigraphs -Wunused-function -Wunused-but-set-variable -Wwrite-strings #Package Options opt-set-cmake-var EpetraExt_ENABLE_HDF5 BOOL FORCE : OFF @@ -1697,7 +1697,7 @@ opt-set-cmake-var TPL_ENABLE_Scotch BOOL FORCE : OFF opt-set-cmake-var TPL_Netcdf_LIBRARIES STRING FORCE : ${NETCDF_C_LIB|ENV}/libnetcdf.so opt-set-cmake-var Trilinos_ENABLE_Fortran OFF BOOL : OFF -opt-set-cmake-var CMAKE_CXX_FLAGS STRING : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-deprecated-declarations -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-nonnull-compare -Wno-address -Wno-inline -Wno-unused-label -Werror=parentheses -Werror=sign-compare -Werror=unused-variable +opt-set-cmake-var CMAKE_CXX_FLAGS STRING : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-deprecated-declarations -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-nonnull-compare -Wno-address -Wno-inline -Wno-unused-label [rhel8_sems-gnu-8.5.0-serial_release-debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_no-mpi_no-pt_no-rdc_no-uvm_deprecated-on_all] use rhel8_sems-gnu-8.5.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 @@ -1729,7 +1729,7 @@ use COMMON_SPACK_TPLS opt-set-cmake-var MPI_EXEC_PRE_NUMPROCS_FLAGS STRING : --bind-to;none --mca btl vader,self opt-set-cmake-var CMAKE_CXX_EXTENSIONS BOOL : OFF opt-set-cmake-var Teko_DISABLE_LSCSTABALIZED_TPETRA_ALPAH_INV_D BOOL : ON -opt-set-cmake-var CMAKE_CXX_FLAGS STRING : -fno-strict-aliasing -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-deprecated-declarations -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-inline -Wno-nonnull-compare -Wno-address -Werror=sign-compare -Werror=unused-variable -Werror=parentheses +opt-set-cmake-var CMAKE_CXX_FLAGS STRING : -fno-strict-aliasing -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-deprecated-declarations -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-inline -Wno-nonnull-compare -Wno-address # TPL_BLAS_LIBRARIES is redefined here with libm for SuperLU to properly link opt-set-cmake-var TPL_BLAS_LIBRARIES STRING FORCE : -L${BLAS_ROOT|ENV}/lib;-lblas;-lgfortran;-lgomp;-lm @@ -1770,7 +1770,7 @@ opt-set-cmake-var ROL_example_PDE-OPT_helmholtz_example_02_MPI_1_DISABLE BOOL opt-set-cmake-var Pliris_vector_random_MPI_3_DISABLE BOOL : ON opt-set-cmake-var Pliris_vector_random_MPI_4_DISABLE BOOL : ON -opt-set-cmake-var CMAKE_CXX_FLAGS STRING FORCE : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-deprecated-declarations -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-nonnull-compare -Wno-address -Wno-inline -Werror=sign-compare -Werror=unused-variable -Werror=parentheses +opt-set-cmake-var CMAKE_CXX_FLAGS STRING FORCE : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-deprecated-declarations -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-nonnull-compare -Wno-address -Wno-inline # Test failures as of 11-28-22 opt-set-cmake-var ROL_example_PDE-OPT_navier-stokes_example_01_MPI_4_DISABLE BOOL : ON @@ -1918,7 +1918,7 @@ use PACKAGE-ENABLES|NO-PACKAGE-ENABLES use COMMON_SPACK_TPLS -opt-set-cmake-var CMAKE_CXX_FLAGS STRING : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-parentheses -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-deprecated-declarations -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-nonnull-compare -Wno-address -Wno-inline -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-label +opt-set-cmake-var CMAKE_CXX_FLAGS STRING : -Wall -Wno-clobbered -Wno-vla -Wno-pragmas -Wno-unknown-pragmas -Wno-unused-local-typedefs -Wno-literal-suffix -Wno-deprecated-declarations -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-nonnull-compare -Wno-address -Wno-inline -Wno-unused-but-set-variable -Wno-unused-label opt-set-cmake-var TPL_BLAS_LIBRARY_DIRS STRING FORCE : ${OPENBLAS_ROOT|ENV}/lib opt-set-cmake-var TPL_BLAS_LIBRARIES STRING FORCE : ${OPENBLAS_ROOT|ENV}/lib/libopenblas.a;-L${OPENBLAS_ROOT|ENV}/lib;-lgfortran;-lgomp;-lm From 59bf3082cc3db9f7041f46a02a8f1d8b1ed89653 Mon Sep 17 00:00:00 2001 From: Maarten Arnst Date: Tue, 10 Sep 2024 12:10:45 +0200 Subject: [PATCH 23/49] Fix for templated set method of Teuchos ParameterList when value is set using user defined conversion function --- .../src/Teuchos_ParameterList.hpp | 8 ++++---- .../ParameterList/ParameterList_UnitTests.cpp | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/packages/teuchos/parameterlist/src/Teuchos_ParameterList.hpp b/packages/teuchos/parameterlist/src/Teuchos_ParameterList.hpp index 34f6115c957d..899b59f2c7a8 100644 --- a/packages/teuchos/parameterlist/src/Teuchos_ParameterList.hpp +++ b/packages/teuchos/parameterlist/src/Teuchos_ParameterList.hpp @@ -260,9 +260,9 @@ class TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT ParameterList { \note This fallback is necessary to support legacy use cases that specify the type of the parameter at the call site, and the type is hence not deduced. */ - template && std::is_same_v>>> + template>>> ParameterList& set (std::string const& name, - S&& value, + const S& value, std::string const& docString = "", RCP const& validator = null); @@ -965,11 +965,11 @@ ParameterList& ParameterList::set( template inline ParameterList& ParameterList::set( - std::string const& name_in, S&& value_in, std::string const& docString_in, + std::string const& name_in, const S& value_in, std::string const& docString_in, RCP const& validator_in ) { - return set(name_in, std::forward(value_in), docString_in, validator_in); + return set(name_in, static_cast(value_in), docString_in, validator_in); } inline diff --git a/packages/teuchos/parameterlist/test/ParameterList/ParameterList_UnitTests.cpp b/packages/teuchos/parameterlist/test/ParameterList/ParameterList_UnitTests.cpp index 87c9351cf84d..d33293e7218e 100644 --- a/packages/teuchos/parameterlist/test/ParameterList/ParameterList_UnitTests.cpp +++ b/packages/teuchos/parameterlist/test/ParameterList/ParameterList_UnitTests.cpp @@ -484,6 +484,24 @@ TEUCHOS_UNIT_TEST( ParameterList, set_string_specified_template_argument) TEST_EQUALITY_CONST(pl.get("my string 5"), "my text 5"); } +struct MyWrappedInt +{ + operator const int&() const { return value; } + + int value; +}; + +TEUCHOS_UNIT_TEST( ParameterList, set_int_user_defined_conversion_function) +{ + // Check the templated set method and its overload when the template argument is specified + // and the parameter is set via a user defined conversion function. + ParameterList pl; + + ECHO(MyWrappedInt my_wrapped_int{42}); + ECHO(pl.set("my int", my_wrapped_int)); + TEST_EQUALITY_CONST(pl.get("my int"), my_wrapped_int.value); +} + TEUCHOS_UNIT_TEST( ParameterList, get_nonexisting_param ) { ParameterList pl; From 8e5c2f487cf842ced0f0202b3adfa3506a268c03 Mon Sep 17 00:00:00 2001 From: "Samuel E. Browne" Date: Wed, 28 Aug 2024 14:16:07 -0600 Subject: [PATCH 24/49] Add config for CXX20 in a GCC container Signed-off-by: Samuel E. Browne --- packages/framework/ini-files/config-specs.ini | 7 +++++++ packages/framework/ini-files/environment-specs.ini | 2 ++ packages/framework/ini-files/supported-envs.ini | 1 + 3 files changed, 10 insertions(+) diff --git a/packages/framework/ini-files/config-specs.ini b/packages/framework/ini-files/config-specs.ini index e6f99810e080..72332a30951c 100644 --- a/packages/framework/ini-files/config-specs.ini +++ b/packages/framework/ini-files/config-specs.ini @@ -2039,6 +2039,13 @@ use PACKAGE-ENABLES|ALL opt-set-cmake-var Trilinos_ENABLE_TrilinosFrameworkTests BOOL FORCE : OFF opt-set-cmake-var Trilinos_ENABLE_TrilinosBuildStats BOOL FORCE : OFF +[rhel8_cxx-20-gcc-openmpi_debug_shared_no-kokkos-arch_no-asan_complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_all] +use rhel8_gcc-openmpi_debug_shared_no-kokkos-arch_no-asan_complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_no-package-enables +use PACKAGE-ENABLES|ALL +opt-set-cmake-var Trilinos_ENABLE_TrilinosFrameworkTests BOOL FORCE : OFF +opt-set-cmake-var Trilinos_ENABLE_TrilinosBuildStats BOOL FORCE : OFF +opt-set-cmake-var CMAKE_CXX_STANDARD STRING FORCE : 20 + [rhel8_gcc-serial_release-debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_no-mpi_no-pt_no-rdc_no-uvm_deprecated-on_all] use rhel8_gcc-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 use PACKAGE-ENABLES|ALL diff --git a/packages/framework/ini-files/environment-specs.ini b/packages/framework/ini-files/environment-specs.ini index 4f91beb46394..49b8295b0dff 100644 --- a/packages/framework/ini-files/environment-specs.ini +++ b/packages/framework/ini-files/environment-specs.ini @@ -162,6 +162,8 @@ envvar-set OMPI_CXX: ${TRILINOS_DIR}/packages/kokkos/bin/nvcc_wrapper [rhel8_gcc-openmpi] +[rhel8_cxx-20-gcc-openmpi] + [rhel8_gcc-serial] [rhel8_aue-gcc-openmpi] diff --git a/packages/framework/ini-files/supported-envs.ini b/packages/framework/ini-files/supported-envs.ini index 09806455ec2e..efc0116ab817 100644 --- a/packages/framework/ini-files/supported-envs.ini +++ b/packages/framework/ini-files/supported-envs.ini @@ -187,6 +187,7 @@ sems-gnu-8.5.0-openmpi-4.1.6-serial cxx-20-sems-gnu-8.5.0-openmpi-4.1.6-serial sems-gnu-8.5.0-openmpi-4.1.6-openmp sems-intel-2021.3-sems-openmpi-4.1.6 +cxx-20-gcc-openmpi [ats2] cuda-11.2.152-gnu-8.3.1-spmpi-rolling From daf9f910c639d1fde6775fe85a4e8eb75abda7e6 Mon Sep 17 00:00:00 2001 From: "Samuel E. Browne" Date: Wed, 11 Sep 2024 10:26:17 -0600 Subject: [PATCH 25/49] Add 'real' option parsing to PR script I'm about to need the ability to parse an option value, so switching to getopt seems to make sense. Signed-off-by: Samuel E. Browne --- .../pr_tools/PullRequestLinuxDriver.sh | 80 ++++++++++++++++--- 1 file changed, 70 insertions(+), 10 deletions(-) diff --git a/packages/framework/pr_tools/PullRequestLinuxDriver.sh b/packages/framework/pr_tools/PullRequestLinuxDriver.sh index cecf35f9b989..ea4d59ddc5eb 100755 --- a/packages/framework/pr_tools/PullRequestLinuxDriver.sh +++ b/packages/framework/pr_tools/PullRequestLinuxDriver.sh @@ -2,15 +2,7 @@ SCRIPTFILE=$(realpath ${WORKSPACE:?}/Trilinos/packages/framework/pr_tools/PullRequestLinuxDriver.sh) SCRIPTPATH=$(dirname $SCRIPTFILE) source ${SCRIPTPATH:?}/common.bash -# set -x # echo commands -# Fetch arguments -on_weaver=$(echo "$@" | grep '\-\-on_weaver' &> /dev/null && echo "1") -on_ats2=$(echo "$@" | grep '\-\-on_ats2' &> /dev/null && echo "1") -on_kokkos_develop=$(echo "$@" | grep '\-\-kokkos\-develop' &> /dev/null && echo "1") -on_rhel8=$(echo "$@" | grep '\-\-on_rhel8' &> /dev/null && echo "1") - -bootstrap=$(echo "$@" | grep '\-\-\no\-bootstrap' &> /dev/null && echo "0" || echo "1") # Configure ccache via environment variables function configure_ccache() { @@ -26,6 +18,7 @@ function configure_ccache() { message_std "PRDriver> " "$(ccache --show-stats --verbose)" } + # Load the right version of Git / Python based on a regex # match to the Jenkins job name. function bootstrap_modules() { @@ -76,8 +69,75 @@ function bootstrap_modules() { print_banner "Bootstrap environment modules complete" } + print_banner "PullRequestLinuxDriver.sh" +# Argument defaults +on_weaver=0 +on_ats2=0 +on_kokkos_develop=0 +on_rhel8=0 +bootstrap=1 + +original_args=$@ + +# Do POSIXLY_CORRECT option handling. +ARGS=$(getopt -n PullRequestLinuxDriver.sh \ + --options '+x' \ + --longoptions on-rhel8,on_rhel8 \ + --longoptions on-weaver,on_weaver \ + --longoptions on-ats2,on_ats2 \ + --longoptions kokkos-develop \ + --longoptions no-bootstrap -- "${@}") || exit $? + +eval set -- "${ARGS}" + +while [ "$#" -gt 0 ] +do + case "${1}" in + (--on_weaver|--on-weaver) + on_weaver=1 + shift + ;; + (--on_rhel8|--on-rhel8) + on_rhel8=1 + shift + ;; + (--on_ats2|--on-ats2) + on_ats2=1 + shift + ;; + (--kokkos-develop) + on_kokkos_develop=1 + shift + ;; + (--no-bootstrap) + bootstrap=0 + shift + ;; + (-h|--help) + # When help is requested echo it to stdout. + echo -e "$USAGE" + exit 0 + ;; + (-x) + set -x + shift + ;; + (--) # This is an explicit directive to stop processing options. + shift + break + ;; + (-*) # Catch options which are defined but not implemented. + echo >&2 "${toolName}: ${1}: Unimplemented option passed." + exit 1 + ;; + (*) # The first parameter terminates option processing. + break + ;; + esac +done + # Set up Sandia PROXY environment vars envvar_set_or_create https_proxy 'http://proxy.sandia.gov:80' envvar_set_or_create http_proxy 'http://proxy.sandia.gov:80' @@ -161,7 +221,7 @@ else message_std "PRDriver> " "" message_std "PRDriver> " "Driver or Merge script change detected. Re-launching PR Driver" message_std "PRDriver> " "" - ${REPO_ROOT:?}/packages/framework/pr_tools/PullRequestLinuxDriver.sh + ${REPO_ROOT:?}/packages/framework/pr_tools/PullRequestLinuxDriver.sh $original_args exit $? fi @@ -221,7 +281,7 @@ fi if [[ ${GENCONFIG_BUILD_NAME} == *"gnu"* ]] then test_cmd_options+=( "--use-explicit-cachefile ") -fi +fi # Execute the TEST operation test_cmd="${PYTHON_EXE:?} ${REPO_ROOT:?}/packages/framework/pr_tools/PullRequestLinuxDriverTest.py ${test_cmd_options[@]}" From 1675f76478fd95a77663c3aba11ba9ee1b7179d4 Mon Sep 17 00:00:00 2001 From: "Samuel E. Browne" Date: Wed, 11 Sep 2024 10:45:42 -0600 Subject: [PATCH 26/49] Add ability to handle --extra-configure-args Signed-off-by: Samuel E. Browne --- .../framework/pr_tools/PullRequestLinuxDriver.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/framework/pr_tools/PullRequestLinuxDriver.sh b/packages/framework/pr_tools/PullRequestLinuxDriver.sh index ea4d59ddc5eb..2c3b8f531608 100755 --- a/packages/framework/pr_tools/PullRequestLinuxDriver.sh +++ b/packages/framework/pr_tools/PullRequestLinuxDriver.sh @@ -88,6 +88,7 @@ ARGS=$(getopt -n PullRequestLinuxDriver.sh \ --longoptions on-weaver,on_weaver \ --longoptions on-ats2,on_ats2 \ --longoptions kokkos-develop \ + --longoptions extra-configure-args: \ --longoptions no-bootstrap -- "${@}") || exit $? eval set -- "${ARGS}" @@ -115,6 +116,10 @@ do bootstrap=0 shift ;; + (--extra-configure-args) + extra_configure_args=$2 + shift 2 + ;; (-h|--help) # When help is requested echo it to stdout. echo -e "$USAGE" @@ -166,8 +171,9 @@ sig_script_old=$(get_md5sum ${REPO_ROOT:?}/packages/framework/pr_tools/PullReque sig_merge_old=$(get_md5sum ${REPO_ROOT:?}/packages/framework/pr_tools/PullRequestLinuxDriverMerge.py) if [[ ${on_kokkos_develop} == "1" ]]; then - message_std "PRDriver> --kokkos-develop is set - setting kokkos and kokkos-kernels packages to current develop" + message_std "PRDriver> --kokkos-develop is set - setting kokkos and kokkos-kernels packages to current develop and pointing at them" "${SCRIPTPATH}"/SetKokkosDevelop.sh + extra_configure_args="\"-DKokkos_SOURCE_DIR_OVERRIDE:string=kokkos;-DKokkosKernels_SOURCE_DIR_OVERRIDE:string=kokkos-kernels\"${extra_configure_args:+;${extra_configure_args}}" else print_banner "Merge Source into Target" message_std "PRDriver> " "TRILINOS_SOURCE_SHA: ${TRILINOS_SOURCE_SHA:?}" @@ -273,9 +279,9 @@ test_cmd_options=( --dashboard-build-name=${DASHBOARD_BUILD_NAME} ) -if [[ ${on_kokkos_develop} == "1" ]] +if [[ ${extra_configure_args} ]] then - test_cmd_options+=( "--extra-configure-args=\"-DKokkos_SOURCE_DIR_OVERRIDE:string=kokkos;-DKokkosKernels_SOURCE_DIR_OVERRIDE:string=kokkos-kernels\" ") + test_cmd_options+=( "--extra-configure-args=\"${extra_configure_args}\"") fi if [[ ${GENCONFIG_BUILD_NAME} == *"gnu"* ]] From 5ba4f16aa2c991d1b84530638c8cd9c704862784 Mon Sep 17 00:00:00 2001 From: "Samuel E. Browne" Date: Wed, 11 Sep 2024 10:46:47 -0600 Subject: [PATCH 27/49] Remove dead code and clean whitespace Signed-off-by: Samuel E. Browne --- .../pr_tools/PullRequestLinuxDriver.sh | 22 ------------------- 1 file changed, 22 deletions(-) diff --git a/packages/framework/pr_tools/PullRequestLinuxDriver.sh b/packages/framework/pr_tools/PullRequestLinuxDriver.sh index 2c3b8f531608..29a56d70ba73 100755 --- a/packages/framework/pr_tools/PullRequestLinuxDriver.sh +++ b/packages/framework/pr_tools/PullRequestLinuxDriver.sh @@ -147,9 +147,6 @@ done envvar_set_or_create https_proxy 'http://proxy.sandia.gov:80' envvar_set_or_create http_proxy 'http://proxy.sandia.gov:80' envvar_set_or_create no_proxy 'localhost,.sandia.gov,localnets,127.0.0.1,169.254.0.0/16,forge.sandia.gov' -#export https_proxy=http://proxy.sandia.gov:80 -#export http_proxy=http://proxy.sandia.gov:80 -#export no_proxy='localhost,.sandia.gov,localnets,127.0.0.1,169.254.0.0/16,forge.sandia.gov' # bootstrap the python and git modules for this system if [[ ${bootstrap} == "1" ]]; then @@ -195,18 +192,12 @@ else message_std "PRDriver> " "Execute Merge Command: ${merge_cmd:?}" message_std "PRDriver> " "" execute_command_checked "${merge_cmd:?}" - #err=$? - #if [ $err != 0 ]; then - # print_banner "An error occurred during merge" - # exit $err - #fi print_banner "Merge completed" print_banner "Check for PR Driver Script Modifications" # Get the md5 checksum of this script: - #sig_script_new=$(get_md5sum ${REPO_ROOT:?}/packages/framework/pr_tools/PullRequestLinuxDriver.sh) sig_script_new=$(get_md5sum ${SCRIPTFILE:?}) message_std "PRDriver> " "" message_std "PRDriver> " "Script File: ${SCRIPTFILE:?}" @@ -214,7 +205,6 @@ else message_std "PRDriver> " "New md5sum : ${sig_script_new:?}" # Get the md5 checksum of the Merge script - #sig_merge_new=$(get_md5sum ${REPO_ROOT:?}/packages/framework/pr_tools/PullRequestLinuxDriverMerge.py) export MERGE_SCRIPT=${SCRIPTPATH:?}/PullRequestLinuxDriverMerge.py sig_merge_new=$(get_md5sum ${MERGE_SCRIPT:?}) message_std "PRDriver> " "" @@ -242,18 +232,10 @@ if [[ "${JOB_BASE_NAME:?}" == "Trilinos_pullrequest_gcc_8.3.0_installation_testi mode="installation" fi - envvar_set_or_create TRILINOS_BUILD_DIR ${WORKSPACE}/pull_request_test -#message_std "PRDriver> " "Create build directory if it does not exist." -#message_std "PRDriver> " "Build Dir: ${TRILINOS_BUILD_DIR:?}" -#mkdir -p ${TRILINOS_BUILD_DIR:?} - - - print_banner "Launch the Test Driver" - # Prepare the command for the TEST operation test_cmd_options=( --source-repo-url=${TRILINOS_SOURCE_REPO:?} @@ -289,7 +271,6 @@ then test_cmd_options+=( "--use-explicit-cachefile ") fi -# Execute the TEST operation test_cmd="${PYTHON_EXE:?} ${REPO_ROOT:?}/packages/framework/pr_tools/PullRequestLinuxDriverTest.py ${test_cmd_options[@]}" # Call the script to launch the tests @@ -297,6 +278,3 @@ print_banner "Execute Test Command" message_std "PRDriver> " "cd $(pwd)" message_std "PRDriver> " "${test_cmd:?} --pullrequest-cdash-track='${PULLREQUEST_CDASH_TRACK:?}'" execute_command_checked "${test_cmd:?} --pullrequest-cdash-track='${PULLREQUEST_CDASH_TRACK:?}'" - -#${test_cmd} --pullrequest-cdash-track="${PULLREQUEST_CDASH_TRACK:?}" -#exit $? From 9456b9ead4424a343246f255cbe1283c1bba7423 Mon Sep 17 00:00:00 2001 From: Roger Pawlowski Date: Wed, 11 Sep 2024 11:35:26 -0700 Subject: [PATCH 28/49] Panzer: fix basis values for hip unified memory --- .../disc-fe/src/Panzer_BasisValues2_impl.hpp | 144 ++++++++++++------ 1 file changed, 99 insertions(+), 45 deletions(-) diff --git a/packages/panzer/disc-fe/src/Panzer_BasisValues2_impl.hpp b/packages/panzer/disc-fe/src/Panzer_BasisValues2_impl.hpp index 02edf8576ddb..b036a7f7fba2 100644 --- a/packages/panzer/disc-fe/src/Panzer_BasisValues2_impl.hpp +++ b/packages/panzer/disc-fe/src/Panzer_BasisValues2_impl.hpp @@ -1114,14 +1114,23 @@ getBasisValues(const bool weighted, // it serially on host until the function supports multiple // reference cells to avoid a kernel launch per cell. - // UVM mirror views can't be used with intrepid basis. Let's do an inefficient copy if using UVM. + // Mirror views on host can't be used with intrepid basis + // getValues() call when UVM or UNIFIED_MEMORY is + // enabled. getHostBasis() returns a "HostSpace" basis object + // while create_mirror_view creates views in UVMSpace or + // HIPSpace. These are not "assignable" in kokkos. We do an + // inefficient copy if UVM or UNIFIED_MEMORY is enabled. +#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_IMPL_HIP_UNIFIED_MEMORY) #ifdef KOKKOS_ENABLE_CUDA if constexpr (std::is_same::value) { +#else + if constexpr (std::is_same::value) { +#endif auto cubature_points_ref_host = Kokkos::create_mirror(Kokkos::HostSpace{},cubature_points_ref_.get_view()); Kokkos::deep_copy(cubature_points_ref_host,cubature_points_ref_.get_view()); auto tmp_basis_scalar_host = Kokkos::create_mirror(Kokkos::HostSpace{},tmp_basis_scalar.get_view()); auto intrepid_basis_host = intrepid_basis->getHostBasis(); - + for(int cell=0; cell cell_range(0,num_evaluate_cells_); auto s_aux = Kokkos::subview(tmp_basis_scalar.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL()); auto s_ref = Kokkos::subview(tmp_basis_scalar_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL()); - + using fst=Intrepid2::FunctionSpaceTools; if(element_space == PureBasis::HVOL){ auto s_cjd = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL()); @@ -1146,7 +1155,7 @@ getBasisValues(const bool weighted, Kokkos::deep_copy(cubature_points_ref_host,cubature_points_ref_.get_view()); auto tmp_basis_scalar_host = Kokkos::create_mirror_view(tmp_basis_scalar.get_view()); auto intrepid_basis_host = intrepid_basis->getHostBasis(); - + for(int cell=0; cell::value) { +#else + if constexpr (std::is_same::value) { +#endif auto cubature_points_ref_host = Kokkos::create_mirror(Kokkos::HostSpace{},cubature_points_ref_.get_view()); Kokkos::deep_copy(cubature_points_ref_host,cubature_points_ref_.get_view()); auto tmp_basis_vector_host = Kokkos::create_mirror(Kokkos::HostSpace{},tmp_basis_vector.get_view()); - + auto intrepid_basis_host = intrepid_basis->getHostBasis(); for(int cell=0; cell("tmp_basis_vector_ref",num_cells,num_card,num_points,num_dim); Kokkos::deep_copy(tmp_basis_vector_ref.get_view(),tmp_basis_vector_host); - + const std::pair cell_range(0,num_evaluate_cells_); auto s_aux = Kokkos::subview(tmp_basis_vector.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL()); auto s_ref = Kokkos::subview(tmp_basis_vector_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL()); - + using fst=Intrepid2::FunctionSpaceTools; if(element_space == PureBasis::HCURL){ auto s_jac_inv = Kokkos::subview(cubature_jacobian_inverse_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL()); @@ -1311,7 +1329,7 @@ getVectorBasisValues(const bool weighted, auto cubature_points_ref_host = Kokkos::create_mirror_view(cubature_points_ref_.get_view()); Kokkos::deep_copy(cubature_points_ref_host,cubature_points_ref_.get_view()); auto tmp_basis_vector_host = Kokkos::create_mirror_view(tmp_basis_vector.get_view()); - + auto intrepid_basis_host = intrepid_basis->getHostBasis(); for(int cell=0; cell("tmp_basis_vector_ref",num_cells,num_card,num_points,num_dim); Kokkos::deep_copy(tmp_basis_vector_ref.get_view(),tmp_basis_vector_host); - + const std::pair cell_range(0,num_evaluate_cells_); auto s_aux = Kokkos::subview(tmp_basis_vector.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL()); auto s_ref = Kokkos::subview(tmp_basis_vector_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL()); - + using fst=Intrepid2::FunctionSpaceTools; if(element_space == PureBasis::HCURL){ auto s_jac_inv = Kokkos::subview(cubature_jacobian_inverse_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL()); @@ -1334,7 +1352,7 @@ getVectorBasisValues(const bool weighted, auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL()); fst::HDIVtransformVALUE(s_aux,s_jac, s_jac_det, s_ref); } -#ifdef KOKKOS_ENABLE_CUDA +#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_IMPL_HIP_UNIFIED_MEMORY) } #endif PHX::Device().fence(); @@ -1432,13 +1450,22 @@ getGradBasisValues(const bool weighted, // it serially on host until the function supports multiple // reference cells to avoid a kernel launch per cell. - // UVM mirror views can't be used with intrepid basis. Let's do an inefficient copy if using UVM. + // Mirror views on host can't be used with intrepid basis + // getValues() call when UVM or UNIFIED_MEMORY is + // enabled. getHostBasis() returns a "HostSpace" basis object + // while create_mirror_view creates views in UVMSpace or + // HIPSpace. These are not "assignable" in kokkos. We do an + // inefficient copy if UVM or UNIFIED_MEMORY is enabled. +#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_IMPL_HIP_UNIFIED_MEMORY) #ifdef KOKKOS_ENABLE_CUDA if constexpr (std::is_same::value) { +#else + if constexpr (std::is_same::value) { +#endif auto cubature_points_ref_host = Kokkos::create_mirror(Kokkos::HostSpace{},cubature_points_ref_.get_view()); Kokkos::deep_copy(cubature_points_ref_host,cubature_points_ref_.get_view()); auto tmp_grad_basis_host = Kokkos::create_mirror(Kokkos::HostSpace{},tmp_grad_basis.get_view()); - + auto intrepid_basis_host = intrepid_basis->getHostBasis(); for(int cell=0; cell("tmp_grad_basis_ref",num_cells,num_card,num_points,num_dim); Kokkos::deep_copy(tmp_grad_basis_ref.get_view(),tmp_grad_basis_host); - + const std::pair cell_range(0,num_evaluate_cells_); auto s_aux = Kokkos::subview(tmp_grad_basis.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL()); auto s_jac_inv = Kokkos::subview(cubature_jacobian_inverse_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL()); auto s_ref = Kokkos::subview(tmp_grad_basis_ref.get_view(),cell_range,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL()); - + // Apply transformation using fst=Intrepid2::FunctionSpaceTools; fst::HGRADtransformGRAD(s_aux, s_jac_inv, s_ref); @@ -1461,7 +1488,7 @@ getGradBasisValues(const bool weighted, auto cubature_points_ref_host = Kokkos::create_mirror_view(cubature_points_ref_.get_view()); Kokkos::deep_copy(cubature_points_ref_host,cubature_points_ref_.get_view()); auto tmp_grad_basis_host = Kokkos::create_mirror_view(tmp_grad_basis.get_view()); - + auto intrepid_basis_host = intrepid_basis->getHostBasis(); for(int cell=0; cell("tmp_grad_basis_ref",num_cells,num_card,num_points,num_dim); Kokkos::deep_copy(tmp_grad_basis_ref.get_view(),tmp_grad_basis_host); - + const std::pair cell_range(0,num_evaluate_cells_); auto s_aux = Kokkos::subview(tmp_grad_basis.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL()); auto s_jac_inv = Kokkos::subview(cubature_jacobian_inverse_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL()); auto s_ref = Kokkos::subview(tmp_grad_basis_ref.get_view(),cell_range,Kokkos::ALL(),Kokkos::ALL(),Kokkos::ALL()); - + // Apply transformation using fst=Intrepid2::FunctionSpaceTools; fst::HGRADtransformGRAD(s_aux, s_jac_inv, s_ref); -#ifdef KOKKOS_ENABLE_CUDA +#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_IMPL_HIP_UNIFIED_MEMORY) } #endif PHX::Device().fence(); @@ -1578,13 +1605,22 @@ getCurl2DVectorBasis(const bool weighted, // it serially on host until the function supports multiple // reference cells to avoid a kernel launch per cell. - // UVM mirror views can't be used with intrepid basis. Let's do an inefficient copy if using UVM. + // Mirror views on host can't be used with intrepid basis + // getValues() call when UVM or UNIFIED_MEMORY is + // enabled. getHostBasis() returns a "HostSpace" basis object + // while create_mirror_view creates views in UVMSpace or + // HIPSpace. These are not "assignable" in kokkos. We do an + // inefficient copy if UVM or UNIFIED_MEMORY is enabled. +#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_IMPL_HIP_UNIFIED_MEMORY) #ifdef KOKKOS_ENABLE_CUDA if constexpr (std::is_same::value) { +#else + if constexpr (std::is_same::value) { +#endif auto cubature_points_ref_host = Kokkos::create_mirror(Kokkos::HostSpace{},cubature_points_ref_.get_view()); Kokkos::deep_copy(cubature_points_ref_host,cubature_points_ref_.get_view()); auto tmp_curl_basis_scalar_host = Kokkos::create_mirror(Kokkos::HostSpace{},tmp_curl_basis_scalar.get_view()); - + auto intrepid_basis_host = intrepid_basis->getHostBasis(); for(int cell=0; cell("tmp_curl_basis_scalar_ref",num_cells,num_card,num_points); Kokkos::deep_copy(tmp_curl_basis_scalar_ref.get_view(),tmp_curl_basis_scalar_host); - + const std::pair cell_range(0,num_evaluate_cells_); auto s_aux = Kokkos::subview(tmp_curl_basis_scalar.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL()); auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL()); auto s_ref = Kokkos::subview(tmp_curl_basis_scalar_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL()); - + // note only volume deformation is needed! // this relates directly to this being in // the divergence space in 2D! @@ -1609,7 +1645,7 @@ getCurl2DVectorBasis(const bool weighted, auto cubature_points_ref_host = Kokkos::create_mirror_view(cubature_points_ref_.get_view()); Kokkos::deep_copy(cubature_points_ref_host,cubature_points_ref_.get_view()); auto tmp_curl_basis_scalar_host = Kokkos::create_mirror_view(tmp_curl_basis_scalar.get_view()); - + auto intrepid_basis_host = intrepid_basis->getHostBasis(); for(int cell=0; cell("tmp_curl_basis_scalar_ref",num_cells,num_card,num_points); Kokkos::deep_copy(tmp_curl_basis_scalar_ref.get_view(),tmp_curl_basis_scalar_host); - + const std::pair cell_range(0,num_evaluate_cells_); auto s_aux = Kokkos::subview(tmp_curl_basis_scalar.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL()); auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL()); auto s_ref = Kokkos::subview(tmp_curl_basis_scalar_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL()); - + // note only volume deformation is needed! // this relates directly to this being in // the divergence space in 2D! using fst=Intrepid2::FunctionSpaceTools; fst::HDIVtransformDIV(s_aux,s_jac_det,s_ref); -#ifdef KOKKOS_ENABLE_CUDA +#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_IMPL_HIP_UNIFIED_MEMORY) } #endif PHX::Device().fence(); @@ -1725,13 +1761,22 @@ getCurlVectorBasis(const bool weighted, // it serially on host until the function supports multiple // reference cells to avoid a kernel launch per cell. - // UVM mirror views can't be used with intrepid basis. Let's do an inefficient copy if using UVM. + // Mirror views on host can't be used with intrepid basis + // getValues() call when UVM or UNIFIED_MEMORY is + // enabled. getHostBasis() returns a "HostSpace" basis object + // while create_mirror_view creates views in UVMSpace or + // HIPSpace. These are not "assignable" in kokkos. We do an + // inefficient copy if UVM or UNIFIED_MEMORY is enabled. +#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_IMPL_HIP_UNIFIED_MEMORY) #ifdef KOKKOS_ENABLE_CUDA if constexpr (std::is_same::value) { +#else + if constexpr (std::is_same::value) { +#endif auto cubature_points_ref_host = Kokkos::create_mirror(Kokkos::HostSpace{},cubature_points_ref_.get_view()); Kokkos::deep_copy(cubature_points_ref_host,cubature_points_ref_.get_view()); auto tmp_curl_basis_vector_host = Kokkos::create_mirror(Kokkos::HostSpace{},tmp_curl_basis_vector.get_view()); - + auto intrepid_basis_host = intrepid_basis->getHostBasis(); for(int cell=0; cell("tmp_curl_basis_scalar_ref",num_cells,num_card,num_points,num_dim); Kokkos::deep_copy(tmp_curl_basis_vector_ref.get_view(),tmp_curl_basis_vector_host); - + const std::pair cell_range(0,num_evaluate_cells_); auto s_aux = Kokkos::subview(tmp_curl_basis_vector.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL()); auto s_jac = Kokkos::subview(cubature_jacobian_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL()); auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL()); auto s_ref = Kokkos::subview(tmp_curl_basis_vector_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL()); - + using fst=Intrepid2::FunctionSpaceTools; fst::HCURLtransformCURL(s_aux, s_jac, s_jac_det, s_ref); } else { @@ -1754,7 +1799,7 @@ getCurlVectorBasis(const bool weighted, auto cubature_points_ref_host = Kokkos::create_mirror_view(cubature_points_ref_.get_view()); Kokkos::deep_copy(cubature_points_ref_host,cubature_points_ref_.get_view()); auto tmp_curl_basis_vector_host = Kokkos::create_mirror_view(tmp_curl_basis_vector.get_view()); - + auto intrepid_basis_host = intrepid_basis->getHostBasis(); for(int cell=0; cell("tmp_curl_basis_scalar_ref",num_cells,num_card,num_points,num_dim); Kokkos::deep_copy(tmp_curl_basis_vector_ref.get_view(),tmp_curl_basis_vector_host); - + const std::pair cell_range(0,num_evaluate_cells_); auto s_aux = Kokkos::subview(tmp_curl_basis_vector.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL()); auto s_jac = Kokkos::subview(cubature_jacobian_.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL()); auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL()); auto s_ref = Kokkos::subview(tmp_curl_basis_vector_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL()); - + using fst=Intrepid2::FunctionSpaceTools; fst::HCURLtransformCURL(s_aux, s_jac, s_jac_det, s_ref); -#ifdef KOKKOS_ENABLE_CUDA +#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_IMPL_HIP_UNIFIED_MEMORY) } #endif PHX::Device().fence(); @@ -1866,13 +1911,22 @@ getDivVectorBasis(const bool weighted, // it serially on host until the function supports multiple // reference cells to avoid a kernel launch per cell. - // UVM mirror views can't be used with intrepid basis. Let's do an inefficient copy if using UVM. + // Mirror views on host can't be used with intrepid basis + // getValues() call when UVM or UNIFIED_MEMORY is + // enabled. getHostBasis() returns a "HostSpace" basis object + // while create_mirror_view creates views in UVMSpace or + // HIPSpace. These are not "assignable" in kokkos. We do an + // inefficient copy if UVM or UNIFIED_MEMORY is enabled. +#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_IMPL_HIP_UNIFIED_MEMORY) #ifdef KOKKOS_ENABLE_CUDA if constexpr (std::is_same::value) { +#else + if constexpr (std::is_same::value) { +#endif auto cubature_points_ref_host = Kokkos::create_mirror(Kokkos::HostSpace{},cubature_points_ref_.get_view()); Kokkos::deep_copy(cubature_points_ref_host,cubature_points_ref_.get_view()); auto tmp_div_basis_host = Kokkos::create_mirror(Kokkos::HostSpace{},tmp_div_basis.get_view()); - + auto intrepid_basis_host = intrepid_basis->getHostBasis(); for(int cell=0; cell("tmp_div_basis_ref",num_cells,num_card,num_points); Kokkos::deep_copy(tmp_div_basis_ref.get_view(),tmp_div_basis_host); - + const std::pair cell_range(0,num_evaluate_cells_); auto s_aux = Kokkos::subview(tmp_div_basis.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL()); auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL()); auto s_ref = Kokkos::subview(tmp_div_basis_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL()); - + using fst=Intrepid2::FunctionSpaceTools; fst::HDIVtransformDIV(s_aux,s_jac_det,s_ref); } else { @@ -1894,7 +1948,7 @@ getDivVectorBasis(const bool weighted, auto cubature_points_ref_host = Kokkos::create_mirror_view(cubature_points_ref_.get_view()); Kokkos::deep_copy(cubature_points_ref_host,cubature_points_ref_.get_view()); auto tmp_div_basis_host = Kokkos::create_mirror_view(tmp_div_basis.get_view()); - + auto intrepid_basis_host = intrepid_basis->getHostBasis(); for(int cell=0; cell("tmp_div_basis_ref",num_cells,num_card,num_points); Kokkos::deep_copy(tmp_div_basis_ref.get_view(),tmp_div_basis_host); - + const std::pair cell_range(0,num_evaluate_cells_); auto s_aux = Kokkos::subview(tmp_div_basis.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL()); auto s_jac_det = Kokkos::subview(cubature_jacobian_determinant_.get_view(), cell_range, Kokkos::ALL()); auto s_ref = Kokkos::subview(tmp_div_basis_ref.get_view(), cell_range, Kokkos::ALL(), Kokkos::ALL()); - + using fst=Intrepid2::FunctionSpaceTools; fst::HDIVtransformDIV(s_aux,s_jac_det,s_ref); -#ifdef KOKKOS_ENABLE_CUDA +#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_IMPL_HIP_UNIFIED_MEMORY) } #endif PHX::Device().fence(); From 8d5a8d4ef77c41f09f68f5c8ac283d3c8530be4f Mon Sep 17 00:00:00 2001 From: "Samuel E. Browne" Date: Wed, 11 Sep 2024 13:35:08 -0600 Subject: [PATCH 29/49] Strip warning flags for deprecated packages We're using '-w', but still nice to make it more explicit that we're not adding warnings for those packages. Signed-off-by: Samuel E. Browne --- cmake/WarningsErrorsPolicy.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/WarningsErrorsPolicy.cmake b/cmake/WarningsErrorsPolicy.cmake index 3fd5fc113823..0dba4c4bf917 100644 --- a/cmake/WarningsErrorsPolicy.cmake +++ b/cmake/WarningsErrorsPolicy.cmake @@ -1,7 +1,7 @@ macro(disable_warnings_for_deprecated_packages) message(STATUS "Disabling all warnings/errors for deprecated packages") - foreach(package deprecated_packages) - set(${package}_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w") + foreach(package ${deprecated_packages}) + set(${package}_CXX_FLAGS "-w ${${package}_CXX_FLAGS}") endforeach() endmacro() From a8892738f1c6be499574b6beb3ebc65d0a272acc Mon Sep 17 00:00:00 2001 From: Anderson Chauphan Date: Wed, 11 Sep 2024 16:26:00 -0600 Subject: [PATCH 30/49] Removed unnecessary config lines from config Removed unnecessary config lines from Python-3.8 container configuration. Signed-off-by: Anderson Chauphan --- packages/framework/ini-files/config-specs.ini | 54 +------------------ .../framework/ini-files/environment-specs.ini | 1 + 2 files changed, 2 insertions(+), 53 deletions(-) diff --git a/packages/framework/ini-files/config-specs.ini b/packages/framework/ini-files/config-specs.ini index af62d53a0a75..91fa7a252910 100644 --- a/packages/framework/ini-files/config-specs.ini +++ b/packages/framework/ini-files/config-specs.ini @@ -858,6 +858,7 @@ opt-set-cmake-var Trilinos_ENABLE_ALL_PACKAGES BOOL : ON [PACKAGE-ENABLES|PR-FRAMEWORK] opt-set-cmake-var Trilinos_ENABLE_ALL_PACKAGES BOOL FORCE : OFF opt-set-cmake-var Trilinos_ENABLE_TrilinosFrameworkTests BOOL : ON +opt-set-cmake-var TrilinosFrameworkTests_ENABLE_TESTS BOOL : ON [PACKAGE-ENABLES|RDC-MINIMAL] opt-set-cmake-var Trilinos_ENABLE_Amesos BOOL : ON @@ -2170,65 +2171,12 @@ opt-set-cmake-var Kokkos_ENABLE_TESTS BOOL FORCE : ON [rhel8_python-3.8_debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_no-mpi_no-pt_no-rdc_no-uvm_deprecated-on_pr-framework] -use COMMON - -use COMPILER|GNU -use NODE-TYPE|SERIAL -use BUILD-TYPE|DEBUG -use LIB-TYPE|SHARED -use KOKKOS-ARCH|NO-KOKKOS-ARCH -use USE-ASAN|NO -use USE-FPIC|NO -use USE-MPI|NO -use USE-PT|NO -use USE-COMPLEX|NO -use USE-RDC|NO -use USE-UVM|NO -use USE-DEPRECATED|YES - use PACKAGE-ENABLES|PR-FRAMEWORK -# Use the below option only when submitting to the dashboard -#opt-set-cmake-var CTEST_USE_LAUNCHERS BOOL FORCE : ON - opt-set-cmake-var TFW_Python3_Testing BOOL FORCE : ON opt-set-cmake-var TFW_Python_Testing BOOL FORCE : ON opt-set-cmake-var PYTHON_PIP_EXECUTABLE STRING FORCE : pip3 -opt-set-cmake-var PYTHON_EXECUTABLE_SEARCH_PATHS STRING FORCE : ${PYTHON_EXECUTABLE_SEARCH_PATHS|ENV} - -# Note: there is no way to capture the below cmake logic in our ini files. -# Instead, we just set the PYTHON_EXECUTABLE to the result of -# 'envvar-find-in-path PYTHON_EXECUTABLE : python3' from environment-specs.ini - -# find_program(PYTHON_EXECUTABLE -# NAMES python3 python -# PATHS ${PYTHON_EXECUTABLE_SEARCH_PATHS} -# PATH_SUFFIXES bin -# DOC "Set by default for PR testing" -# NO_DEFAULT_PATH -# ) -# if(DEFINED PYTHON_EXECUTABLE_NOTFOUND) -# message(FATAL_ERROR "Unable to locate Python in ${PYTHON_EXECUTABLE_SEARCH_PATHS}") -# else() -# message(STATUS "PYTHON FOUND: ${PYTHON_EXECUTABLE}") -# endif() opt-set-cmake-var PYTHON_EXECUTABLE STRING FORCE : ${PYTHON_EXECUTABLE|ENV} - - -opt-set-cmake-var TPL_ENABLE_Boost BOOL FORCE : OFF -opt-set-cmake-var TPL_ENABLE_BoostLib BOOL FORCE : OFF -opt-set-cmake-var TPL_ENABLE_ParMETIS BOOL FORCE : OFF -opt-set-cmake-var TPL_ENABLE_Zlib BOOL FORCE : OFF -opt-set-cmake-var TPL_ENABLE_HDF5 BOOL FORCE : OFF -opt-set-cmake-var TPL_ENABLE_Netcdf BOOL FORCE : OFF -opt-set-cmake-var TPL_ENABLE_SuperLU BOOL FORCE : OFF -opt-set-cmake-var TPL_ENABLE_Scotch BOOL FORCE : OFF - -# No build stats for Python-only PR (#7376) opt-set-cmake-var Trilinos_ENABLE_BUILD_STATS BOOL FORCE : OFF - - - - diff --git a/packages/framework/ini-files/environment-specs.ini b/packages/framework/ini-files/environment-specs.ini index 9876d09ff58f..bc57aa649f43 100644 --- a/packages/framework/ini-files/environment-specs.ini +++ b/packages/framework/ini-files/environment-specs.ini @@ -167,6 +167,7 @@ envvar-set OMPI_CXX: ${TRILINOS_DIR}/packages/kokkos/bin/nvcc_wrapper [rhel8_aue-gcc-openmpi] [rhel8_python-3.8] +envvar-find-in-path PYTHON_EXECUTABLE : python3 [rhel8_oneapi-intelmpi] use MPI-COMPILER-VARS From bd830ff9bde55ad101c0a369f91e770f0806bfee Mon Sep 17 00:00:00 2001 From: Anderson Chauphan Date: Wed, 11 Sep 2024 16:51:27 -0600 Subject: [PATCH 31/49] Removed machine specific and broken argparse tests Removed machine specific environment specification used for unittesting of Framework PR scripts. These broke after moving to a containerized environment which do not use SEMS modules. Removed broken argparse tests that broke due to new a version. Signed-off-by: Anderson Chauphan --- .../unittests/environment-specs.ini | 9 -- .../test_PullRequestLinuxDriverTest.py | 132 ------------------ 2 files changed, 141 deletions(-) diff --git a/packages/framework/pr_tools/trilinosprhelpers/unittests/environment-specs.ini b/packages/framework/pr_tools/trilinosprhelpers/unittests/environment-specs.ini index 3541b037480f..2c77e91434ea 100644 --- a/packages/framework/pr_tools/trilinosprhelpers/unittests/environment-specs.ini +++ b/packages/framework/pr_tools/trilinosprhelpers/unittests/environment-specs.ini @@ -180,15 +180,6 @@ envvar-find-in-path OMPI_CXX : icpc envvar-find-in-path OMPI_CC : icc envvar-find-in-path OMPI_FC : ifort - -[SEMS_PRE] -use MODULE-PURGE -module-load sems-cmake -module-load sems-ninja - [rhel8_sems-gnu-openmpi] -use SEMS_PRE -module-load sems-gcc use MPI-COMPILER-VARS -module-load sems-openmpi use OMPI-GNU-VARS diff --git a/packages/framework/pr_tools/unittests/test_PullRequestLinuxDriverTest.py b/packages/framework/pr_tools/unittests/test_PullRequestLinuxDriverTest.py index 2d8ead2e8d4f..91e8e7068d71 100755 --- a/packages/framework/pr_tools/unittests/test_PullRequestLinuxDriverTest.py +++ b/packages/framework/pr_tools/unittests/test_PullRequestLinuxDriverTest.py @@ -115,116 +115,6 @@ def setUp(self): | - [O] workspace-dir : /dev/null/Trilinos_clone ''') - self.help_output = dedent('''\ - usage: programName [-h] [--source-repo-url SOURCE_REPO_URL] - [--target-repo-url TARGET_REPO_URL] --target-branch-name - TARGET_BRANCH_NAME - [--pullrequest-build-name PULLREQUEST_BUILD_NAME] - --genconfig-build-name GENCONFIG_BUILD_NAME - --pullrequest-number PULLREQUEST_NUMBER - [--jenkins-job-number JENKINS_JOB_NUMBER] - [--dashboard-build-name DASHBOARD_BUILD_NAME] - [--source-dir SOURCE_DIR] [--build-dir BUILD_DIR] - [--use-explicit-cachefile] [--ctest-driver CTEST_DRIVER] - [--ctest-drop-site CTEST_DROP_SITE] - [--pullrequest-cdash-track PULLREQUEST_CDASH_TRACK] - [--pullrequest-env-config-file PULLREQUEST_ENV_CONFIG_FILE] - [--pullrequest-gen-config-file PULLREQUEST_GEN_CONFIG_FILE] - [--workspace-dir WORKSPACE_DIR] - [--filename-packageenables FILENAME_PACKAGEENABLES] - [--filename-subprojects FILENAME_SUBPROJECTS] - [--test-mode TEST_MODE] - [--req-mem-per-core REQ_MEM_PER_CORE] - [--max-cores-allowed MAX_CORES_ALLOWED] - [--num-concurrent-tests NUM_CONCURRENT_TESTS] - [--enable-ccache] [--dry-run] - [--extra-configure-args EXTRA_CONFIGURE_ARGS] - - Parse the repo and build information - - options: - -h, --help show this help message and exit - - Required Arguments: - --source-repo-url SOURCE_REPO_URL - Repo with the new changes - --target-repo-url TARGET_REPO_URL - Repo to merge into - --target-branch-name TARGET_BRANCH_NAME - Branch to merge into - --pullrequest-build-name PULLREQUEST_BUILD_NAME - The Jenkins job base name - --genconfig-build-name GENCONFIG_BUILD_NAME - The job base name for the cmake configuration - --pullrequest-number PULLREQUEST_NUMBER - The github PR number - --jenkins-job-number JENKINS_JOB_NUMBER - The Jenkins build number - - Optional Arguments: - --dashboard-build-name DASHBOARD_BUILD_NAME - The build name posted by ctest to a dashboard - --source-dir SOURCE_DIR - Directory containing the source code to compile/test. - --build-dir BUILD_DIR - Path to the build directory. - --use-explicit-cachefile - Use -DTrilinos_CONFIGURE_OPTIONS_FILE instead of -C. - --ctest-driver CTEST_DRIVER - Location of the CTest driver script to load via `-S`. - --ctest-drop-site CTEST_DROP_SITE - URL of the cdash server to post to. - --pullrequest-cdash-track PULLREQUEST_CDASH_TRACK - The CDash Track to add results to. Default=Pull - Request - --pullrequest-env-config-file PULLREQUEST_ENV_CONFIG_FILE - The Trilinos PR driver configuration file containing - job mappings to environment specifications. Default=/d - ev/null/Trilinos_clone/pr_config/pullrequest.ini - --pullrequest-gen-config-file PULLREQUEST_GEN_CONFIG_FILE - The Trilinos PR driver configuration file containing - job mappings to cmake specifications. - Default=/dev/null/Trilinos_clone/../GenConfig/src/gen- - config.ini - --workspace-dir WORKSPACE_DIR - The local workspace directory that Jenkins set up. - Default=/dev/null/Trilinos_clone - --filename-packageenables FILENAME_PACKAGEENABLES - The packageEnables.cmake is usually generated by - TriBiTS infrastructure based on which packages contain - the changes between the source and target branches. - Default=../packageEnables.cmake - --filename-subprojects FILENAME_SUBPROJECTS - The subprojects_file is used by the testing - infrastructure. This parameter allows the default, - generated file, to be overridden. Generally this - should not be changed from the defaults.. - Default=../package_subproject_list.cmake - --test-mode TEST_MODE - PR testing mode. Use 'standard' for normal PR tests, - 'installation' for installation testing. Default = - standard - --req-mem-per-core REQ_MEM_PER_CORE - Minimum required memory per core (GB) to build - Trilinos.Default = 3.0 - --max-cores-allowed MAX_CORES_ALLOWED - Max cores allowed, if >= 0 we will use the # of - detected cores on the system. Default = 12 - --num-concurrent-tests NUM_CONCURRENT_TESTS - Set the number of concurrent tests allowd in CTest. - This is equivalent to `ctest -j `. If > 0 then this value is used, otherwise the - value is calculated based on number_of_available_cores - / max_test_parallelism Default = -1 - --enable-ccache Enable ccache object caching to improve build times. - Default = False - --dry-run Enable dry-run mode. Script will run but not execute - the build steps. Default = False - --extra-configure-args EXTRA_CONFIGURE_ARGS - Extra arguments that will be passed to CMake for - configuring Trilinos. - ''') - self.usage_output = dedent('''\ usage: programName [-h] [--source-repo-url SOURCE_REPO_URL] [--target-repo-url TARGET_REPO_URL] --target-branch-name TARGET_BRANCH_NAME @@ -296,28 +186,6 @@ def test_parse_args_uses_workspace_environ(self): return - def test_help(self): - """ - Compare the help message to the expected - """ - - with mock.patch.object(sys, 'argv', ['programName', '--help']), self.assertRaises(SystemExit), self.stdoutRedirect as m_stdout: - PullRequestLinuxDriverTest.parse_args() - - self.assertEqual(self.help_output, m_stdout.getvalue()) - return - - - def test_usage(self): - ''' - Compare the usage message to the expected - ''' - - with mock.patch.object(sys, 'argv', ['programName', '--usage']), self.assertRaises(SystemExit), self.stderrRedirect as m_stderr: - PullRequestLinuxDriverTest.parse_args() - - self.assertEqual(re.sub("\s+", " ", self.usage_output, flags=re.DOTALL), re.sub("\s+", " ", m_stderr.getvalue(), flags=re.DOTALL)) - return class Test_main(unittest.TestCase): From ab9996dd1d14606264631d59a02036e62eb69ac0 Mon Sep 17 00:00:00 2001 From: "Justin M. LaPre" Date: Thu, 29 Aug 2024 16:00:35 +0000 Subject: [PATCH 32/49] add summary to github action * write the URLs in ctest-cdash-setup and look for them inside the summary step * add links about containers * add generate_build_url4 to output all build logs * set PULLREQUESTNUM when calling ctest --- .github/workflows/AT2.yml | 51 +++++++++++++++++++ .../cmake/ctest-cdash-setup.cmake | 7 +++ .../SimpleTesting/cmake/ctest-functions.cmake | 15 ++++++ .../TrilinosPRConfigurationStandard.py | 2 + 4 files changed, 75 insertions(+) diff --git a/.github/workflows/AT2.yml b/.github/workflows/AT2.yml index 9f261f9b438f..f02eb8b30a48 100644 --- a/.github/workflows/AT2.yml +++ b/.github/workflows/AT2.yml @@ -103,6 +103,23 @@ jobs: --ctest-drop-site sems-cdash-son.sandia.gov/cdash \ --filename-subprojects ./package_subproject_list.cmake \ --filename-packageenables ./packageEnables.cmake + - name: Summary + if: ${{ !cancelled() }} + shell: bash -l {0} + working-directory: /home/Trilinos/build + run: | + echo "## Image" >> $GITHUB_STEP_SUMMARY + echo "image: ${AT2_IMAGE:-unknown}" >> $GITHUB_STEP_SUMMARY + echo "## CDash Links" >> $GITHUB_STEP_SUMMARY + echo "### Current Build" >> $GITHUB_STEP_SUMMARY + AT2_URL=$(> $GITHUB_STEP_SUMMARY + echo "### All Builds" >> $GITHUB_STEP_SUMMARY + AT2_ALL_BUILDS=$(> $GITHUB_STEP_SUMMARY + echo "## Helpful Links" >> $GITHUB_STEP_SUMMARY + echo "https://github.com/trilinos/Trilinos/wiki/Containers" >> $GITHUB_STEP_SUMMARY + echo "https://gitlab-ex.sandia.gov/trilinos-project/trilinos-containers/-/wikis/Containers-at-Sandia" >> $GITHUB_STEP_SUMMARY gcc830-serial-EXPERIMENTAL: needs: pre-checks @@ -177,6 +194,23 @@ jobs: --ctest-drop-site sems-cdash-son.sandia.gov/cdash \ --filename-subprojects ./package_subproject_list.cmake \ --filename-packageenables ./packageEnables.cmake + - name: Summary + if: ${{ !cancelled() }} + shell: bash -l {0} + working-directory: /home/Trilinos/build + run: | + echo "## Image" >> $GITHUB_STEP_SUMMARY + echo "image: ${AT2_IMAGE:-unknown}" >> $GITHUB_STEP_SUMMARY + echo "## CDash Links" >> $GITHUB_STEP_SUMMARY + echo "### Current Build" >> $GITHUB_STEP_SUMMARY + AT2_URL=$(> $GITHUB_STEP_SUMMARY + echo "### All Builds" >> $GITHUB_STEP_SUMMARY + AT2_ALL_BUILDS=$(> $GITHUB_STEP_SUMMARY + echo "## Helpful Links" >> $GITHUB_STEP_SUMMARY + echo "https://github.com/trilinos/Trilinos/wiki/Containers" >> $GITHUB_STEP_SUMMARY + echo "https://gitlab-ex.sandia.gov/trilinos-project/trilinos-containers/-/wikis/Containers-at-Sandia" >> $GITHUB_STEP_SUMMARY cuda11-uvm-EXPERIMENTAL: needs: pre-checks @@ -252,3 +286,20 @@ jobs: --filename-packageenables ./packageEnables.cmake \ --max-cores-allowed=96 \ --num-concurrent-tests=96 + - name: Summary + if: ${{ !cancelled() }} + shell: bash -l {0} + working-directory: /home/Trilinos/build + run: | + echo "## Image" >> $GITHUB_STEP_SUMMARY + echo "image: ${AT2_IMAGE:-unknown}" >> $GITHUB_STEP_SUMMARY + echo "## CDash Links" >> $GITHUB_STEP_SUMMARY + echo "### Current Build" >> $GITHUB_STEP_SUMMARY + AT2_URL=$(> $GITHUB_STEP_SUMMARY + echo "### All Builds" >> $GITHUB_STEP_SUMMARY + AT2_ALL_BUILDS=$(> $GITHUB_STEP_SUMMARY + echo "## Helpful Links" >> $GITHUB_STEP_SUMMARY + echo "https://github.com/trilinos/Trilinos/wiki/Containers" >> $GITHUB_STEP_SUMMARY + echo "https://gitlab-ex.sandia.gov/trilinos-project/trilinos-containers/-/wikis/Containers-at-Sandia" >> $GITHUB_STEP_SUMMARY diff --git a/cmake/SimpleTesting/cmake/ctest-cdash-setup.cmake b/cmake/SimpleTesting/cmake/ctest-cdash-setup.cmake index d1e28d458280..018863e17b68 100644 --- a/cmake/SimpleTesting/cmake/ctest-cdash-setup.cmake +++ b/cmake/SimpleTesting/cmake/ctest-cdash-setup.cmake @@ -120,9 +120,16 @@ string(SUBSTRING ${build_stamp_tmp} 1 1024 build_stamp) generate_build_url1(build_url1 ${CTEST_DROP_SITE} ${URL_location} ${CTEST_PROJECT_NAME} ${CTEST_BUILD_NAME} ${build_stamp} ${machine_name}) generate_build_url2(build_url2 ${CTEST_DROP_SITE} ${URL_location} ${CTEST_PROJECT_NAME} ${CTEST_BUILD_NAME} ${build_stamp}) generate_build_url3(build_url3 ${CTEST_DROP_SITE} ${URL_location} ${CTEST_PROJECT_NAME} ${CTEST_BUILD_NAME} ${build_stamp}) +generate_build_url4(build_url4 ${CTEST_DROP_SITE} ${URL_location} ${CTEST_PROJECT_NAME} ${PULLREQUESTNUM}) message(">>> CDash URL1 = ${build_url1}") message(">>> CDash URL2 = ${build_url2}") message(">>> CDash URL3 = ${build_url3}") +message(">>> CDash URL4 = ${build_url4}") + +# Write the URL into the filesystem so AT2 can read it later +message(">>> Writing URLs to /home/runner/AT2_URL.txt and AT2_ALL_BUILDS.txt") +file(WRITE /home/runner/AT2_URL.txt ${build_url3}) +file(WRITE /home/runner/AT2_ALL_BUILDS.txt ${build_url4}) # ----------------------------------------------------------- # -- Optionally update the repository diff --git a/cmake/SimpleTesting/cmake/ctest-functions.cmake b/cmake/SimpleTesting/cmake/ctest-functions.cmake index 97f1abb0e474..93d28ed9b10b 100644 --- a/cmake/SimpleTesting/cmake/ctest-functions.cmake +++ b/cmake/SimpleTesting/cmake/ctest-functions.cmake @@ -194,6 +194,21 @@ function(generate_build_url3 url_output cdash_site cdash_location project_name b endfunction() +# generate_build_url4 generates a link to view all builds for a particular PR +function(generate_build_url4 url_output cdash_site cdash_location project_name pr_num) + banner("generate_build_url4() START") + message(">>> cdash_site : ${cdash_site}") + message(">>> cdash_location: ${cdash_location}") + message(">>> project_name : ${project_name}") + message(">>> pr_num : ${pr_num}") + string(REPLACE " " "%20" url_output_tmp + "https://${cdash_site}${cdash_location}index.php?project=${project_name}&display=project&begin=2024-01-01&end=now&filtercount=1&showfilters=1&field1=buildname&compare1=65&value1=PR-${pr_num}" + ) + set(${url_output} ${url_output_tmp} PARENT_SCOPE) + banner("generate_build_url4() FINISH") +endfunction() + + message("+--------------------------------------+") message("| ctest-functions.cmake FINISH |") message("+--------------------------------------+") diff --git a/packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationStandard.py b/packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationStandard.py index 1d1555bf113c..81e98c8acebb 100644 --- a/packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationStandard.py +++ b/packages/framework/pr_tools/trilinosprhelpers/TrilinosPRConfigurationStandard.py @@ -60,12 +60,14 @@ def execute_test(self): if "BUILD_NUMBER" in os.environ: print("Running under Jenkins, keeping output less verbose to avoid space issues") verbosity_flag = "-V" + cmd = ['ctest', verbosity_flag, "-S", f"{self.arg_ctest_driver}", f"-Dsource_dir:PATH={self.arg_source_dir}", f"-Dbuild_dir:PATH={self.arg_build_dir}", f"-Dbuild_name:STRING={self.pullrequest_build_name}", + f"-DPULLREQUESTNUM:STRING={self.arg_pullrequest_number}", "-Dskip_by_parts_submit:BOOL=OFF", "-Dskip_update_step:BOOL=ON", f"-Ddashboard_model:STRING='{self.dashboard_model}'", From a75308d3027aa7ebdecca05a0b0a88f1f102fcb9 Mon Sep 17 00:00:00 2001 From: "Samuel E. Browne" Date: Thu, 12 Sep 2024 10:30:41 -0600 Subject: [PATCH 33/49] Add release notes for new warnings/errors policy Signed-off-by: Samuel E. Browne --- RELEASE_NOTES | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/RELEASE_NOTES b/RELEASE_NOTES index bf4f8a9c280c..4dc910bc563f 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -1,7 +1,55 @@ ############################################################################### # # -# Trilinos Release 16.0 Release Notes TBD May/June, 2024 # +# Trilinos Release 16.1 Release Notes TBD, 2024 # +# # +############################################################################### + +A large number of packages have been marked as deprecated in this release. +We are planning to remove them in the fall of 2025. The list of packages is + + - Amesos + - AztecOO + - Epetra + - EpetraExt + - Ifpack + - Intrepid + - Isorropia + - ML + - NewPackage + - Pliris + - PyTrilinos + - ShyLU_DDCore + - ThyraEpetraAdapters + - ThyraEpetraExtAdapters + - Triutils + +If you are a user of one of these packages, please transition to the newer +software stack. If you need guidance with finding an adequate replacement +or are missing a particular feature, please open an issue or a discussion +on Github. + + +Framework + + - Added option `Trilinos_WARNINGS_MODE` that can control warnings useful + for development. There is a list of warnings in + `cmake/WarningsErrorsPolicy.cmake` that can be applied as warnings or + errors by passing the `WARN` or `ERROR` value for that variable. Turning + either of those settings on will also turn on a set of 'promoted' warnings + that will always be errors in any mode other than the default. The Pull + Request testing will currently use the `WARN` setting for this mode, + meaning that any 'upcoming' warnings will show up as warnings, and any + 'promoted' warnings will show up as errors. You can also pass additional + 'upcoming' warnings via the `Trilinos_ADDITIONAL_WARNINGS` option. Lastly, + if either of these modes are enabled, all warnings are disabled for any + deprecated packages, in the interest of not spending effort cleaning them. + By default, no warnings or errors are added. + + +############################################################################### +# # +# Trilinos Release 16.0 Release Notes July 22, 2024 # # # ############################################################################### From 7d9bcc6e0267bf6e7860388f755ff1980bf8bc64 Mon Sep 17 00:00:00 2001 From: Nathan Ellingwood Date: Thu, 12 Sep 2024 11:13:35 -0600 Subject: [PATCH 34/49] Snapshot of kokkos.git from commit 5cb2fa30a39a73664b7508d0a514e8f8daa84359 From repository at git@github.com:kokkos/kokkos.git At commit: commit 5cb2fa30a39a73664b7508d0a514e8f8daa84359 Author: Nathan Ellingwood Date: Thu Sep 12 11:10:58 2024 -0600 Update master_history.txt for 4.4.01 --- packages/kokkos/.jenkins | 1 + packages/kokkos/CHANGELOG.md | 15 ++ packages/kokkos/CMakeLists.txt | 2 +- packages/kokkos/Makefile.kokkos | 2 +- packages/kokkos/cmake/KokkosCore_config.h.in | 1 + .../kokkos/cmake/kokkos_enable_options.cmake | 4 +- .../unit_tests/TestWithoutInitializing.hpp | 12 ++ .../kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp | 39 ++++- .../kokkos/core/src/Cuda/Kokkos_CudaSpace.hpp | 23 ++- .../core/src/Cuda/Kokkos_Cuda_Instance.cpp | 20 +++ packages/kokkos/core/src/Kokkos_View.hpp | 2 + .../kokkos/core/src/OpenMP/Kokkos_OpenMP.cpp | 2 +- .../src/OpenMP/Kokkos_OpenMP_Instance.cpp | 39 +++-- .../src/OpenMP/Kokkos_OpenMP_Instance.hpp | 4 +- .../src/OpenMP/Kokkos_OpenMP_UniqueToken.hpp | 3 +- .../kokkos/core/src/View/Kokkos_ViewAlloc.hpp | 45 ++++++ .../kokkos/core/src/impl/Kokkos_ViewCtor.hpp | 25 ++- .../core/src/impl/Kokkos_ViewMapping.hpp | 10 +- .../kokkos/core/unit_test/TestViewOfViews.hpp | 116 ++++++++++---- .../core/unit_test/cuda/TestCuda_Spaces.cpp | 16 ++ packages/kokkos/master_history.txt | 1 + packages/kokkos/simd/src/Kokkos_SIMD_AVX2.hpp | 12 +- packages/kokkos/simd/unit_tests/TestSIMD.cpp | 1 + .../include/TestSIMD_Construction.hpp | 150 ++++++++++++++++++ 24 files changed, 468 insertions(+), 77 deletions(-) create mode 100644 packages/kokkos/simd/unit_tests/include/TestSIMD_Construction.hpp diff --git a/packages/kokkos/.jenkins b/packages/kokkos/.jenkins index 0393ff06fb5e..1635a69f298f 100644 --- a/packages/kokkos/.jenkins +++ b/packages/kokkos/.jenkins @@ -461,6 +461,7 @@ pipeline { -DKokkos_ENABLE_CUDA=ON \ -DKokkos_ENABLE_CUDA_LAMBDA=ON \ -DKokkos_ENABLE_LIBDL=OFF \ + -DKokkos_ENABLE_OPENMP=ON \ -DKokkos_ENABLE_IMPL_MDSPAN=OFF \ -DKokkos_ENABLE_IMPL_CUDA_MALLOC_ASYNC=OFF \ .. && \ diff --git a/packages/kokkos/CHANGELOG.md b/packages/kokkos/CHANGELOG.md index 78225f9e6c27..7b1d69e56630 100644 --- a/packages/kokkos/CHANGELOG.md +++ b/packages/kokkos/CHANGELOG.md @@ -1,5 +1,20 @@ # CHANGELOG +## [4.4.01](https://github.com/kokkos/kokkos/tree/4.4.01) +[Full Changelog](https://github.com/kokkos/kokkos/compare/4.0.00...4.4.01) + +### Features: +* Introduce new SequentialHostInit view allocation property [\#7229](https://github.com/kokkos/kokkos/pull/7229) + +### Backend and Architecture Enhancements: + +#### CUDA: +* Experimental support for unified memory mode (intended for Grace-Hopper etc.) [\#6823](https://github.com/kokkos/kokkos/pull/6823) + +### Bug Fixes +* OpenMP: Fix issue related to the visibility of an internal symbol with shared libraries that affected `ScatterView` in particular [\#7284](https://github.com/kokkos/kokkos/pull/7284) +* Fix implicit copy assignment operators in few AVX2 masks being deleted [#7296](https://github.com/kokkos/kokkos/pull/7296) + ## [4.4.00](https://github.com/kokkos/kokkos/tree/4.4.00) [Full Changelog](https://github.com/kokkos/kokkos/compare/4.3.01...4.4.00) diff --git a/packages/kokkos/CMakeLists.txt b/packages/kokkos/CMakeLists.txt index 054de2c1dae8..736cbac218c2 100644 --- a/packages/kokkos/CMakeLists.txt +++ b/packages/kokkos/CMakeLists.txt @@ -151,7 +151,7 @@ ENDIF() set(Kokkos_VERSION_MAJOR 4) set(Kokkos_VERSION_MINOR 4) -set(Kokkos_VERSION_PATCH 0) +set(Kokkos_VERSION_PATCH 1) set(Kokkos_VERSION "${Kokkos_VERSION_MAJOR}.${Kokkos_VERSION_MINOR}.${Kokkos_VERSION_PATCH}") message(STATUS "Kokkos version: ${Kokkos_VERSION}") math(EXPR KOKKOS_VERSION "${Kokkos_VERSION_MAJOR} * 10000 + ${Kokkos_VERSION_MINOR} * 100 + ${Kokkos_VERSION_PATCH}") diff --git a/packages/kokkos/Makefile.kokkos b/packages/kokkos/Makefile.kokkos index 15f24f30732a..ccb568a553ce 100644 --- a/packages/kokkos/Makefile.kokkos +++ b/packages/kokkos/Makefile.kokkos @@ -2,7 +2,7 @@ KOKKOS_VERSION_MAJOR = 4 KOKKOS_VERSION_MINOR = 4 -KOKKOS_VERSION_PATCH = 0 +KOKKOS_VERSION_PATCH = 1 KOKKOS_VERSION = $(shell echo $(KOKKOS_VERSION_MAJOR)*10000+$(KOKKOS_VERSION_MINOR)*100+$(KOKKOS_VERSION_PATCH) | bc) # Options: Cuda,HIP,SYCL,OpenMPTarget,OpenMP,Threads,Serial diff --git a/packages/kokkos/cmake/KokkosCore_config.h.in b/packages/kokkos/cmake/KokkosCore_config.h.in index 7997aa3707c6..a93007ff83f6 100644 --- a/packages/kokkos/cmake/KokkosCore_config.h.in +++ b/packages/kokkos/cmake/KokkosCore_config.h.in @@ -37,6 +37,7 @@ #cmakedefine KOKKOS_ENABLE_CUDA_LAMBDA // deprecated #cmakedefine KOKKOS_ENABLE_CUDA_CONSTEXPR #cmakedefine KOKKOS_ENABLE_IMPL_CUDA_MALLOC_ASYNC +#cmakedefine KOKKOS_ENABLE_IMPL_CUDA_UNIFIED_MEMORY #cmakedefine KOKKOS_ENABLE_HIP_RELOCATABLE_DEVICE_CODE #cmakedefine KOKKOS_ENABLE_HIP_MULTIPLE_KERNEL_INSTANTIATIONS #cmakedefine KOKKOS_ENABLE_IMPL_HIP_UNIFIED_MEMORY diff --git a/packages/kokkos/cmake/kokkos_enable_options.cmake b/packages/kokkos/cmake/kokkos_enable_options.cmake index b900c4a232ea..53764b0c6848 100644 --- a/packages/kokkos/cmake/kokkos_enable_options.cmake +++ b/packages/kokkos/cmake/kokkos_enable_options.cmake @@ -48,6 +48,8 @@ KOKKOS_ENABLE_OPTION(CUDA_LAMBDA ${CUDA_LAMBDA_DEFAULT} "Whether to allow lambda # resolved but we keep the option around a bit longer to be safe. KOKKOS_ENABLE_OPTION(IMPL_CUDA_MALLOC_ASYNC ON "Whether to enable CudaMallocAsync (requires CUDA Toolkit 11.2)") KOKKOS_ENABLE_OPTION(IMPL_NVHPC_AS_DEVICE_COMPILER OFF "Whether to allow nvc++ as Cuda device compiler") +KOKKOS_ENABLE_OPTION(IMPL_CUDA_UNIFIED_MEMORY OFF "Whether to leverage unified memory architectures for CUDA") + KOKKOS_ENABLE_OPTION(DEPRECATED_CODE_4 ON "Whether code deprecated in major release 4 is available" ) KOKKOS_ENABLE_OPTION(DEPRECATION_WARNINGS ON "Whether to emit deprecation warnings" ) KOKKOS_ENABLE_OPTION(HIP_RELOCATABLE_DEVICE_CODE OFF "Whether to enable relocatable device code (RDC) for HIP") @@ -135,7 +137,7 @@ FUNCTION(check_device_specific_options) ENDIF() ENDFUNCTION() -CHECK_DEVICE_SPECIFIC_OPTIONS(DEVICE CUDA OPTIONS CUDA_UVM CUDA_RELOCATABLE_DEVICE_CODE CUDA_LAMBDA CUDA_CONSTEXPR CUDA_LDG_INTRINSIC) +CHECK_DEVICE_SPECIFIC_OPTIONS(DEVICE CUDA OPTIONS CUDA_UVM CUDA_RELOCATABLE_DEVICE_CODE CUDA_LAMBDA CUDA_CONSTEXPR CUDA_LDG_INTRINSIC IMPL_CUDA_UNIFIED_MEMORY) CHECK_DEVICE_SPECIFIC_OPTIONS(DEVICE HIP OPTIONS HIP_RELOCATABLE_DEVICE_CODE) CHECK_DEVICE_SPECIFIC_OPTIONS(DEVICE HPX OPTIONS IMPL_HPX_ASYNC_DISPATCH) diff --git a/packages/kokkos/containers/unit_tests/TestWithoutInitializing.hpp b/packages/kokkos/containers/unit_tests/TestWithoutInitializing.hpp index 7201cd402a95..e8558628dc84 100644 --- a/packages/kokkos/containers/unit_tests/TestWithoutInitializing.hpp +++ b/packages/kokkos/containers/unit_tests/TestWithoutInitializing.hpp @@ -37,6 +37,17 @@ #endif ///@} +/// Some tests are skipped for unified memory space +#if defined(KOKKOS_ENABLE_IMPL_CUDA_UNIFIED_MEMORY) +#define GTEST_SKIP_IF_UNIFIED_MEMORY_SPACE \ + if constexpr (std::is_same_v) \ + GTEST_SKIP() << "skipping since unified memory requires additional " \ + "fences"; +#else +#define GTEST_SKIP_IF_UNIFIED_MEMORY_SPACE +#endif + TEST(TEST_CATEGORY, resize_realloc_no_init_dualview) { using namespace Kokkos::Test::Tools; listen_tool_events(Config::DisableAll(), Config::EnableKernels()); @@ -657,6 +668,7 @@ TEST(TEST_CATEGORY, create_mirror_no_init_dynamicview) { TEST(TEST_CATEGORY, create_mirror_view_and_copy_dynamicview) { GTEST_SKIP_IF_CUDAUVM_MEMORY_SPACE + GTEST_SKIP_IF_UNIFIED_MEMORY_SPACE using namespace Kokkos::Test::Tools; listen_tool_events(Config::DisableAll(), Config::EnableKernels(), diff --git a/packages/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp b/packages/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp index 75318aff7781..6ae24022c8fd 100644 --- a/packages/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp +++ b/packages/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp @@ -31,7 +31,6 @@ #include #include -//#include #include #include @@ -178,6 +177,29 @@ void *impl_allocate_common(const int device_id, cudaError_t error_code = cudaSuccess; #ifndef CUDART_VERSION #error CUDART_VERSION undefined! +#elif defined(KOKKOS_ENABLE_IMPL_CUDA_UNIFIED_MEMORY) + // This is intended for Grace-Hopper (and future unified memory architectures) + // The idea is to use host allocator and then advise to keep it in HBM on the + // device, but that requires CUDA 12.2 + static_assert(CUDART_VERSION >= 12020, + "CUDA runtime version >=12.2 required when " + "Kokkos_ENABLE_IMPL_CUDA_UNIFIED_MEMORY is set. " + "Please update your CUDA runtime version or " + "reconfigure with " + "-D Kokkos_ENABLE_IMPL_CUDA_UNIFIED_MEMORY=OFF"); + if (arg_alloc_size) { // cudaMemAdvise_v2 does not work with nullptr + error_code = cudaMallocManaged(&ptr, arg_alloc_size, cudaMemAttachGlobal); + if (error_code == cudaSuccess) { + // One would think cudaMemLocation{device_id, + // cudaMemLocationTypeDevice} would work but it doesn't. I.e. the order of + // members doesn't seem to be defined. + cudaMemLocation loc; + loc.id = device_id; + loc.type = cudaMemLocationTypeDevice; + KOKKOS_IMPL_CUDA_SAFE_CALL(cudaMemAdvise_v2( + ptr, arg_alloc_size, cudaMemAdviseSetPreferredLocation, loc)); + } + } #elif (defined(KOKKOS_ENABLE_IMPL_CUDA_MALLOC_ASYNC) && CUDART_VERSION >= 11020) if (arg_alloc_size >= memory_threshold_g) { error_code = cudaMallocAsync(&ptr, arg_alloc_size, stream); @@ -190,9 +212,13 @@ void *impl_allocate_common(const int device_id, "Kokkos::Cuda: backend fence after async malloc"); } } - } else + } else { + error_code = cudaMalloc(&ptr, arg_alloc_size); + } +#else + error_code = cudaMalloc(&ptr, arg_alloc_size); #endif - { error_code = cudaMalloc(&ptr, arg_alloc_size); } + if (error_code != cudaSuccess) { // TODO tag as unlikely branch // This is the only way to clear the last error, which // we should do here since we're turning it into an @@ -326,6 +352,9 @@ void CudaSpace::impl_deallocate( } #ifndef CUDART_VERSION #error CUDART_VERSION undefined! +#elif defined(KOKKOS_ENABLE_IMPL_CUDA_UNIFIED_MEMORY) + KOKKOS_IMPL_CUDA_SAFE_CALL(cudaSetDevice(m_device)); + KOKKOS_IMPL_CUDA_SAFE_CALL(cudaFree(arg_alloc_ptr)); #elif (defined(KOKKOS_ENABLE_IMPL_CUDA_MALLOC_ASYNC) && CUDART_VERSION >= 11020) if (arg_alloc_size >= memory_threshold_g) { Impl::cuda_device_synchronize( @@ -436,8 +465,12 @@ void cuda_prefetch_pointer(const Cuda &space, const void *ptr, size_t bytes, #include +#if !defined(KOKKOS_ENABLE_IMPL_CUDA_UNIFIED_MEMORY) KOKKOS_IMPL_HOST_INACCESSIBLE_SHARED_ALLOCATION_RECORD_EXPLICIT_INSTANTIATION( Kokkos::CudaSpace); +#else +KOKKOS_IMPL_SHARED_ALLOCATION_RECORD_EXPLICIT_INSTANTIATION(Kokkos::CudaSpace); +#endif KOKKOS_IMPL_SHARED_ALLOCATION_RECORD_EXPLICIT_INSTANTIATION( Kokkos::CudaUVMSpace); KOKKOS_IMPL_SHARED_ALLOCATION_RECORD_EXPLICIT_INSTANTIATION( diff --git a/packages/kokkos/core/src/Cuda/Kokkos_CudaSpace.hpp b/packages/kokkos/core/src/Cuda/Kokkos_CudaSpace.hpp index 0e20193e8b42..e1d062d72d5a 100644 --- a/packages/kokkos/core/src/Cuda/Kokkos_CudaSpace.hpp +++ b/packages/kokkos/core/src/Cuda/Kokkos_CudaSpace.hpp @@ -88,6 +88,19 @@ class CudaSpace { void* allocate(const char* arg_label, const size_t arg_alloc_size, const size_t arg_logical_size = 0) const; +#if defined(KOKKOS_ENABLE_IMPL_CUDA_UNIFIED_MEMORY) + template + void* allocate(const ExecutionSpace&, const size_t arg_alloc_size) const { + return allocate(arg_alloc_size); + } + template + void* allocate(const ExecutionSpace&, const char* arg_label, + const size_t arg_alloc_size, + const size_t arg_logical_size = 0) const { + return allocate(arg_label, arg_alloc_size, arg_logical_size); + } +#endif + /**\brief Deallocate untracked memory in the cuda space */ void deallocate(void* const arg_alloc_ptr, const size_t arg_alloc_size) const; void deallocate(const char* arg_label, void* const arg_alloc_ptr, @@ -337,7 +350,11 @@ static_assert( template <> struct MemorySpaceAccess { enum : bool { assignable = false }; - enum : bool { accessible = false }; +#if !defined(KOKKOS_ENABLE_IMPL_CUDA_UNIFIED_MEMORY) + enum : bool{accessible = false}; +#else + enum : bool { accessible = true }; +#endif enum : bool { deepcopy = true }; }; @@ -558,8 +575,12 @@ struct DeepCopy #include +namespace { +int g_openmp_hardware_max_threads = 1; +} + namespace Kokkos { namespace Impl { std::vector OpenMPInternal::all_instances; std::mutex OpenMPInternal::all_instances_mutex; +int OpenMPInternal::max_hardware_threads() noexcept { + return g_openmp_hardware_max_threads; +} + void OpenMPInternal::clear_thread_data() { const size_t member_bytes = sizeof(int64_t) * @@ -188,9 +196,9 @@ void OpenMPInternal::initialize(int thread_count) { // Before any other call to OMP query the maximum number of threads // and save the value for re-initialization unit testing. - Impl::g_openmp_hardware_max_threads = get_current_max_threads(); + g_openmp_hardware_max_threads = get_current_max_threads(); - int process_num_threads = Impl::g_openmp_hardware_max_threads; + int process_num_threads = g_openmp_hardware_max_threads; if (Kokkos::hwloc::available()) { process_num_threads = Kokkos::hwloc::get_available_numa_count() * @@ -203,11 +211,11 @@ void OpenMPInternal::initialize(int thread_count) { // process_num_threads if thread_count > 0, set // g_openmp_hardware_max_threads to thread_count if (thread_count < 0) { - thread_count = Impl::g_openmp_hardware_max_threads; + thread_count = g_openmp_hardware_max_threads; } else if (thread_count == 0) { - if (Impl::g_openmp_hardware_max_threads != process_num_threads) { - Impl::g_openmp_hardware_max_threads = process_num_threads; - omp_set_num_threads(Impl::g_openmp_hardware_max_threads); + if (g_openmp_hardware_max_threads != process_num_threads) { + g_openmp_hardware_max_threads = process_num_threads; + omp_set_num_threads(g_openmp_hardware_max_threads); } } else { if (Kokkos::show_warnings() && thread_count > process_num_threads) { @@ -218,16 +226,16 @@ void OpenMPInternal::initialize(int thread_count) { << ", requested thread : " << std::setw(3) << thread_count << std::endl; } - Impl::g_openmp_hardware_max_threads = thread_count; - omp_set_num_threads(Impl::g_openmp_hardware_max_threads); + g_openmp_hardware_max_threads = thread_count; + omp_set_num_threads(g_openmp_hardware_max_threads); } // setup thread local -#pragma omp parallel num_threads(Impl::g_openmp_hardware_max_threads) +#pragma omp parallel num_threads(g_openmp_hardware_max_threads) { Impl::SharedAllocationRecord::tracking_enable(); } auto &instance = OpenMPInternal::singleton(); - instance.m_pool_size = Impl::g_openmp_hardware_max_threads; + instance.m_pool_size = g_openmp_hardware_max_threads; // New, unified host thread team data: { @@ -272,10 +280,9 @@ void OpenMPInternal::finalize() { if (this == &singleton()) { auto const &instance = singleton(); // Silence Cuda Warning - const int nthreads = - instance.m_pool_size <= Impl::g_openmp_hardware_max_threads - ? Impl::g_openmp_hardware_max_threads - : instance.m_pool_size; + const int nthreads = instance.m_pool_size <= g_openmp_hardware_max_threads + ? g_openmp_hardware_max_threads + : instance.m_pool_size; (void)nthreads; #pragma omp parallel num_threads(nthreads) @@ -284,7 +291,7 @@ void OpenMPInternal::finalize() { // allow main thread to track Impl::SharedAllocationRecord::tracking_enable(); - Impl::g_openmp_hardware_max_threads = 1; + g_openmp_hardware_max_threads = 1; } m_initialized = false; @@ -307,7 +314,7 @@ void OpenMPInternal::print_configuration(std::ostream &s) const { if (m_initialized) { const int numa_count = 1; - const int core_per_numa = Impl::g_openmp_hardware_max_threads; + const int core_per_numa = g_openmp_hardware_max_threads; const int thread_per_core = 1; s << " thread_pool_topology[ " << numa_count << " x " << core_per_numa diff --git a/packages/kokkos/core/src/OpenMP/Kokkos_OpenMP_Instance.hpp b/packages/kokkos/core/src/OpenMP/Kokkos_OpenMP_Instance.hpp index f4a0d3e20123..2aed723b18ff 100644 --- a/packages/kokkos/core/src/OpenMP/Kokkos_OpenMP_Instance.hpp +++ b/packages/kokkos/core/src/OpenMP/Kokkos_OpenMP_Instance.hpp @@ -47,8 +47,6 @@ namespace Impl { class OpenMPInternal; -inline int g_openmp_hardware_max_threads = 1; - struct OpenMPTraits { static constexpr int MAX_THREAD_COUNT = 512; }; @@ -86,6 +84,8 @@ class OpenMPInternal { void clear_thread_data(); + static int max_hardware_threads() noexcept; + int thread_pool_size() const { return m_pool_size; } void resize_thread_data(size_t pool_reduce_bytes, size_t team_reduce_bytes, diff --git a/packages/kokkos/core/src/OpenMP/Kokkos_OpenMP_UniqueToken.hpp b/packages/kokkos/core/src/OpenMP/Kokkos_OpenMP_UniqueToken.hpp index a37e1758a261..5937c093ba17 100644 --- a/packages/kokkos/core/src/OpenMP/Kokkos_OpenMP_UniqueToken.hpp +++ b/packages/kokkos/core/src/OpenMP/Kokkos_OpenMP_UniqueToken.hpp @@ -105,7 +105,8 @@ class UniqueToken { /// \brief upper bound for acquired values, i.e. 0 <= value < size() KOKKOS_INLINE_FUNCTION int size() const noexcept { - KOKKOS_IF_ON_HOST((return Kokkos::Impl::g_openmp_hardware_max_threads;)) + KOKKOS_IF_ON_HOST( + (return Kokkos::Impl::OpenMPInternal::max_hardware_threads();)) KOKKOS_IF_ON_DEVICE((return 0;)) } diff --git a/packages/kokkos/core/src/View/Kokkos_ViewAlloc.hpp b/packages/kokkos/core/src/View/Kokkos_ViewAlloc.hpp index 95cb6f619cce..1ade75692f1f 100644 --- a/packages/kokkos/core/src/View/Kokkos_ViewAlloc.hpp +++ b/packages/kokkos/core/src/View/Kokkos_ViewAlloc.hpp @@ -313,6 +313,51 @@ struct ViewValueFunctor { void destroy_shared_allocation() {} }; + +template +struct ViewValueFunctorSequentialHostInit { + using ExecSpace = typename DeviceType::execution_space; + using MemSpace = typename DeviceType::memory_space; + static_assert(SpaceAccessibility::accessible); + + ValueType* ptr; + size_t n; + + ViewValueFunctorSequentialHostInit() = default; + + ViewValueFunctorSequentialHostInit(ExecSpace const& /*arg_space*/, + ValueType* const arg_ptr, + size_t const arg_n, + std::string /*arg_name*/) + : ptr(arg_ptr), n(arg_n) {} + + ViewValueFunctorSequentialHostInit(ValueType* const arg_ptr, + size_t const arg_n, + std::string /*arg_name*/) + : ptr(arg_ptr), n(arg_n) {} + + void construct_shared_allocation() { + if constexpr (std::is_trivial_v) { + // value-initialization is equivalent to filling with zeros + std::memset(static_cast(ptr), 0, n * sizeof(ValueType)); + } else { + for (size_t i = 0; i < n; ++i) { + new (ptr + i) ValueType(); + } + } + } + + void destroy_shared_allocation() { + if constexpr (std::is_trivially_destructible_v) { + // do nothing, don't bother calling the destructor + } else { + for (size_t i = 0; i < n; ++i) { + (ptr + i)->~ValueType(); + } + } + } +}; + } // namespace Kokkos::Impl #endif // KOKKOS_VIEW_ALLOC_HPP diff --git a/packages/kokkos/core/src/impl/Kokkos_ViewCtor.hpp b/packages/kokkos/core/src/impl/Kokkos_ViewCtor.hpp index e1b8ba86a5b5..379180ae6435 100644 --- a/packages/kokkos/core/src/impl/Kokkos_ViewCtor.hpp +++ b/packages/kokkos/core/src/impl/Kokkos_ViewCtor.hpp @@ -23,12 +23,16 @@ namespace Kokkos { namespace Impl { +struct SequentialHostInit_t {}; struct WithoutInitializing_t {}; struct AllowPadding_t {}; template struct is_view_ctor_property : public std::false_type {}; +template <> +struct is_view_ctor_property : public std::true_type {}; + template <> struct is_view_ctor_property : public std::true_type {}; @@ -84,10 +88,10 @@ struct ViewCtorProp> { /* Property flags have constexpr value */ template -struct ViewCtorProp< - std::enable_if_t::value || - std::is_same::value>, - P> { +struct ViewCtorProp || + std::is_same_v || + std::is_same_v>, + P> { ViewCtorProp() = default; ViewCtorProp(const ViewCtorProp &) = default; ViewCtorProp &operator=(const ViewCtorProp &) = default; @@ -199,6 +203,11 @@ struct ViewCtorProp : public ViewCtorProp... { Kokkos::Impl::has_type::value; static constexpr bool initialize = !Kokkos::Impl::has_type::value; + static constexpr bool sequential_host_init = + Kokkos::Impl::has_type::value; + static_assert(initialize || !sequential_host_init, + "Incompatible WithoutInitializing and SequentialHostInit view " + "alloc properties"); using memory_space = typename var_memory_space::type; using execution_space = typename var_execution_space::type; @@ -251,7 +260,9 @@ auto with_properties_if_unset(const ViewCtorProp &view_ctor_prop, (is_view_label::value && !ViewCtorProp::has_label) || (std::is_same_v && - ViewCtorProp::initialize)) { + ViewCtorProp::initialize) || + (std::is_same_v && + !ViewCtorProp::sequential_host_init)) { using NewViewCtorProp = ViewCtorProp; NewViewCtorProp new_view_ctor_prop(view_ctor_prop); static_cast &>(new_view_ctor_prop).value = @@ -299,7 +310,9 @@ struct WithPropertiesIfUnset, Property, Properties...> { (is_view_label::value && !ViewCtorProp::has_label) || (std::is_same_v && - ViewCtorProp::initialize)) { + ViewCtorProp::initialize) || + (std::is_same_v && + !ViewCtorProp::sequential_host_init)) { using NewViewCtorProp = ViewCtorProp; NewViewCtorProp new_view_ctor_prop(view_ctor_prop); static_cast &>(new_view_ctor_prop).value = diff --git a/packages/kokkos/core/src/impl/Kokkos_ViewMapping.hpp b/packages/kokkos/core/src/impl/Kokkos_ViewMapping.hpp index 8919dccdb7a4..10aaa63b7c82 100644 --- a/packages/kokkos/core/src/impl/Kokkos_ViewMapping.hpp +++ b/packages/kokkos/core/src/impl/Kokkos_ViewMapping.hpp @@ -2825,10 +2825,12 @@ class ViewMapping< using memory_space = typename Traits::memory_space; static_assert( SpaceAccessibility::accessible); - using value_type = typename Traits::value_type; - using functor_type = - ViewValueFunctor, - value_type>; + using device_type = Kokkos::Device; + using value_type = typename Traits::value_type; + using functor_type = std::conditional_t< + alloc_prop::sequential_host_init, + ViewValueFunctorSequentialHostInit, + ViewValueFunctor>; using record_type = Kokkos::Impl::SharedAllocationRecord; diff --git a/packages/kokkos/core/unit_test/TestViewOfViews.hpp b/packages/kokkos/core/unit_test/TestViewOfViews.hpp index a87c829bb73c..1d53bca336d4 100644 --- a/packages/kokkos/core/unit_test/TestViewOfViews.hpp +++ b/packages/kokkos/core/unit_test/TestViewOfViews.hpp @@ -20,7 +20,7 @@ namespace { -// User-defined type with a View data member +// User-defined types with a View data member template class S { V v_; @@ -28,48 +28,102 @@ class S { public: template S(std::string label, Extents... extents) : v_(std::move(label), extents...) {} - S() = default; + KOKKOS_DEFAULTED_FUNCTION S() = default; }; template -void test_view_of_views() { +class N { // not default constructible + V v_; + + public: + template + N(std::string label, Extents... extents) : v_(std::move(label), extents...) {} +}; + +template +class H { // constructible and destructible only from on the host side + V v_; + + public: + template + H(std::string label, Extents... extents) : v_(std::move(label), extents...) {} + H() {} + ~H() {} +}; + +template +void test_view_of_views_default() { + // assigning a default-constructed view to destruct the inner objects using VoV = Kokkos::View; - { // assigning a default-constructed view to destruct the inner objects - VoV vov("vov", 2, 3); - V a("a"); - V b("b"); - vov(0, 0) = a; - vov(1, 0) = a; - vov(0, 1) = b; + VoV vov("vov", 2, 3); + V a("a"); + V b("b"); + vov(0, 0) = a; + vov(1, 0) = a; + vov(0, 1) = b; #ifndef KOKKOS_ENABLE_IMPL_VIEW_OF_VIEWS_DESTRUCTOR_PRECONDITION_VIOLATION_WORKAROUND - vov(0, 0) = V(); - vov(1, 0) = V(); - vov(0, 1) = V(); + vov(0, 0) = V(); + vov(1, 0) = V(); + vov(0, 1) = V(); #endif - } - { // using placement new to construct the inner objects and explicitly - // calling the destructor - VoV vov(Kokkos::view_alloc("vov", Kokkos::WithoutInitializing), 2, 3); - V a("a"); - V b("b"); - new (&vov(0, 0)) V(a); - new (&vov(1, 0)) V(a); - new (&vov(0, 1)) V(b); +} + +template +void test_view_of_views_without_initializing() { + // using placement new to construct the inner objects and explicitly + // calling the destructor + using VoV = Kokkos::View; + VoV vov(Kokkos::view_alloc("vov", Kokkos::WithoutInitializing), 2, 3); + V a("a"); + V b("b"); + new (&vov(0, 0)) V(a); + new (&vov(1, 0)) V(a); + new (&vov(0, 1)) V(b); #ifndef KOKKOS_ENABLE_IMPL_VIEW_OF_VIEWS_DESTRUCTOR_PRECONDITION_VIOLATION_WORKAROUND - vov(0, 0).~V(); - vov(1, 0).~V(); - vov(0, 1).~V(); + vov(0, 0).~V(); + vov(1, 0).~V(); + vov(0, 1).~V(); #else - // leaks memory + // leaks memory #endif - } } -TEST(TEST_CATEGORY, view_of_views) { - test_view_of_views>(); - test_view_of_views>(); +template +void test_view_of_views_sequential_host_init() { + // inner views value-initialized sequentially on the host, and also + // sequentially destructed on the host, without the need to cleanup + using VoV = Kokkos::View; + VoV vov(Kokkos::view_alloc("vov", Kokkos::SequentialHostInit), 2, 3); + V a("a"); + V b("b"); + vov(0, 0) = a; + vov(1, 0) = a; + vov(0, 1) = b; +} + +TEST(TEST_CATEGORY, view_of_views_default) { + test_view_of_views_default>(); + test_view_of_views_default>(); // User-defined type with View data member - test_view_of_views>>(); + test_view_of_views_default>>(); +} + +TEST(TEST_CATEGORY, view_of_views_without_initializing) { + test_view_of_views_without_initializing>(); + test_view_of_views_without_initializing< + S>>(); + test_view_of_views_without_initializing< + N>>(); + test_view_of_views_without_initializing< + H>>(); +} + +TEST(TEST_CATEGORY, test_view_of_views_sequential_host_init) { + test_view_of_views_sequential_host_init>(); + test_view_of_views_sequential_host_init< + S>>(); + test_view_of_views_sequential_host_init< + H>>(); } } // namespace diff --git a/packages/kokkos/core/unit_test/cuda/TestCuda_Spaces.cpp b/packages/kokkos/core/unit_test/cuda/TestCuda_Spaces.cpp index 11fe6b8555b8..f40af99e7c28 100644 --- a/packages/kokkos/core/unit_test/cuda/TestCuda_Spaces.cpp +++ b/packages/kokkos/core/unit_test/cuda/TestCuda_Spaces.cpp @@ -39,9 +39,14 @@ TEST(cuda, space_access) { !Kokkos::Impl::MemorySpaceAccess::assignable); +#ifndef KOKKOS_ENABLE_IMPL_CUDA_UNIFIED_MEMORY static_assert( !Kokkos::Impl::MemorySpaceAccess::accessible); +#else + static_assert(Kokkos::Impl::MemorySpaceAccess::accessible); +#endif static_assert( !Kokkos::Impl::MemorySpaceAccess::accessible); +#ifndef KOKKOS_ENABLE_IMPL_CUDA_UNIFIED_MEMORY static_assert(!Kokkos::SpaceAccessibility::accessible); +#else + static_assert(Kokkos::SpaceAccessibility::accessible); +#endif static_assert(Kokkos::SpaceAccessibility::accessible); @@ -157,8 +167,14 @@ TEST(cuda, space_access) { Kokkos::SpaceAccessibility::accessible); +#ifndef KOKKOS_ENABLE_IMPL_CUDA_UNIFIED_MEMORY static_assert(std::is_same::Space, Kokkos::HostSpace>::value); +#else + static_assert(std::is_same::Space, + Kokkos::Device>::value); +#endif static_assert( std::is_same::Space, diff --git a/packages/kokkos/master_history.txt b/packages/kokkos/master_history.txt index a0e83bef237d..f2a41636101d 100644 --- a/packages/kokkos/master_history.txt +++ b/packages/kokkos/master_history.txt @@ -38,3 +38,4 @@ tag: 4.2.01 date: 01:30:2024 master: 71a9bcae release: 221e5f7a tag: 4.3.00 date: 04:03:2024 master: e0dc0128 release: f08217a4 tag: 4.3.01 date: 05:07:2024 master: 486cc745 release: 262d2d6e tag: 4.4.00 date: 08:08:2024 master: 6ecdf605 release: 6068673c +tag: 4.4.01 date: 09:12:2024 master: 08ceff92 release: 2d60c039 diff --git a/packages/kokkos/simd/src/Kokkos_SIMD_AVX2.hpp b/packages/kokkos/simd/src/Kokkos_SIMD_AVX2.hpp index 27c8af79abd6..0525dc8887a7 100644 --- a/packages/kokkos/simd/src/Kokkos_SIMD_AVX2.hpp +++ b/packages/kokkos/simd/src/Kokkos_SIMD_AVX2.hpp @@ -361,9 +361,7 @@ class simd_mask> { }; using value_type = bool; using abi_type = simd_abi::avx2_fixed_size<4>; - KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION simd_mask() = default; - KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION simd_mask(simd_mask const&) = default; - KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION simd_mask(simd_mask&&) = default; + KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION simd_mask() = default; KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION explicit simd_mask(value_type value) : m_value(_mm_set1_epi32(-std::int32_t(value))) {} KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION static constexpr std::size_t size() { @@ -460,9 +458,7 @@ class simd_mask> { }; using value_type = bool; using abi_type = simd_abi::avx2_fixed_size<8>; - KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION simd_mask() = default; - KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION simd_mask(simd_mask const&) = default; - KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION simd_mask(simd_mask&&) = default; + KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION simd_mask() = default; KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION explicit simd_mask(value_type value) : m_value(_mm256_set1_epi32(-std::int32_t(value))) {} KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION static constexpr std::size_t size() { @@ -561,9 +557,7 @@ class simd_mask> { }; using value_type = bool; using abi_type = simd_abi::avx2_fixed_size<4>; - KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION simd_mask() = default; - KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION simd_mask(simd_mask const&) = default; - KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION simd_mask(simd_mask&&) = default; + KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION simd_mask() = default; KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION explicit simd_mask(value_type value) : m_value(_mm256_set1_epi64x(-std::int64_t(value))) {} KOKKOS_IMPL_HOST_FORCEINLINE_FUNCTION static constexpr std::size_t size() { diff --git a/packages/kokkos/simd/unit_tests/TestSIMD.cpp b/packages/kokkos/simd/unit_tests/TestSIMD.cpp index 7a1f9be2a0f9..df18b43c4e35 100644 --- a/packages/kokkos/simd/unit_tests/TestSIMD.cpp +++ b/packages/kokkos/simd/unit_tests/TestSIMD.cpp @@ -22,3 +22,4 @@ #include #include #include +#include diff --git a/packages/kokkos/simd/unit_tests/include/TestSIMD_Construction.hpp b/packages/kokkos/simd/unit_tests/include/TestSIMD_Construction.hpp new file mode 100644 index 000000000000..0ceb1496c47d --- /dev/null +++ b/packages/kokkos/simd/unit_tests/include/TestSIMD_Construction.hpp @@ -0,0 +1,150 @@ +//@HEADER +// ************************************************************************ +// +// Kokkos v. 4.0 +// Copyright (2022) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions. +// See https://kokkos.org/LICENSE for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//@HEADER + +#ifndef KOKKOS_TEST_SIMD_CONSTRUCTION_HPP +#define KOKKOS_TEST_SIMD_CONSTRUCTION_HPP + +#include +#include + +template +inline void host_test_simd_traits() { + using simd_type = Kokkos::Experimental::simd; + + static_assert(std::is_nothrow_default_constructible_v); + static_assert(std::is_nothrow_copy_assignable_v); + static_assert(std::is_nothrow_copy_constructible_v); + static_assert(std::is_nothrow_move_assignable_v); + static_assert(std::is_nothrow_move_constructible_v); + + simd_type default_simd, result; + simd_type test_simd(KOKKOS_LAMBDA(std::size_t i) { return (i % 2 == 0); }); + simd_type copy_simd(test_simd); + simd_type move_simd(std::move(copy_simd)); + default_simd = std::move(move_simd); + result = default_simd; + EXPECT_TRUE(all_of(test_simd == result)); +} + +template +inline void host_test_mask_traits() { + using mask_type = Kokkos::Experimental::simd_mask; + + static_assert(std::is_nothrow_default_constructible_v); + static_assert(std::is_nothrow_copy_assignable_v); + static_assert(std::is_nothrow_copy_constructible_v); + static_assert(std::is_nothrow_move_assignable_v); + static_assert(std::is_nothrow_move_constructible_v); + + mask_type default_mask, result; + mask_type test_mask(KOKKOS_LAMBDA(std::size_t i) { return (i % 2 == 0); }); + mask_type copy_mask(test_mask); + mask_type move_mask(std::move(copy_mask)); + default_mask = std::move(move_mask); + result = default_mask; + EXPECT_EQ(test_mask, result); +} + +template +inline void host_check_construction() { + if constexpr (is_type_v>) { + host_test_simd_traits(); + host_test_mask_traits(); + } +} + +template +inline void host_check_construction_all_types( + Kokkos::Experimental::Impl::data_types) { + (host_check_construction(), ...); +} + +template +inline void host_check_construction_all_abis( + Kokkos::Experimental::Impl::abi_set) { + using DataTypes = Kokkos::Experimental::Impl::data_type_set; + (host_check_construction_all_types(DataTypes()), ...); +} + +template +KOKKOS_INLINE_FUNCTION void device_test_simd_traits() { + using simd_type = Kokkos::Experimental::simd; + + simd_type default_simd, result; + simd_type test_simd(KOKKOS_LAMBDA(std::size_t i) { return (i % 2 == 0); }); + simd_type copy_simd(test_simd); + simd_type move_simd(std::move(copy_simd)); + default_simd = std::move(move_simd); + result = default_simd; + + kokkos_checker checker; + checker.truth(all_of(test_simd == result)); +} + +template +KOKKOS_INLINE_FUNCTION void device_test_mask_traits() { + using mask_type = Kokkos::Experimental::simd_mask; + + mask_type default_mask, result; + mask_type test_mask(KOKKOS_LAMBDA(std::size_t i) { return (i % 2 == 0); }); + mask_type copy_mask(test_mask); + mask_type move_mask(std::move(copy_mask)); + default_mask = std::move(move_mask); + result = default_mask; + + kokkos_checker checker; + checker.truth(test_mask == result); +} + +template +KOKKOS_INLINE_FUNCTION void device_check_construction() { + if constexpr (is_type_v>) { + device_test_simd_traits(); + device_test_mask_traits(); + } +} + +template +KOKKOS_INLINE_FUNCTION void device_check_construction_all_types( + Kokkos::Experimental::Impl::data_types) { + (device_check_construction(), ...); +} + +template +KOKKOS_INLINE_FUNCTION void device_check_construction_all_abis( + Kokkos::Experimental::Impl::abi_set) { + using DataTypes = Kokkos::Experimental::Impl::data_type_set; + (device_check_construction_all_types(DataTypes()), ...); +} + +class simd_device_construction_functor { + public: + KOKKOS_INLINE_FUNCTION void operator()(int) const { + device_check_construction_all_abis( + Kokkos::Experimental::Impl::device_abi_set()); + } +}; + +TEST(simd, host_construction) { + host_check_construction_all_abis(Kokkos::Experimental::Impl::host_abi_set()); +} + +TEST(simd, device_construction) { + Kokkos::parallel_for(Kokkos::RangePolicy>(0, 1), + simd_device_construction_functor()); +} + +#endif From d6d93234863199669b0fb8a7ec32603cc527233c Mon Sep 17 00:00:00 2001 From: Nathan Ellingwood Date: Thu, 12 Sep 2024 11:13:48 -0600 Subject: [PATCH 35/49] Snapshot of kokkos-kernels.git from commit 8193f0b86adda9a19a2f11488a38b4db151f6399 From repository at git@github.com:kokkos/kokkos-kernels.git At commit: commit 8193f0b86adda9a19a2f11488a38b4db151f6399 Author: Nathan Ellingwood Date: Thu Sep 12 11:12:02 2024 -0600 Update master_history.txt for 4.4.01 --- packages/kokkos-kernels/CHANGELOG.md | 14 ++++++++++++++ packages/kokkos-kernels/CMakeLists.txt | 2 +- packages/kokkos-kernels/master_history.txt | 1 + .../sparse/src/KokkosSparse_coo2crs.hpp | 2 +- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/packages/kokkos-kernels/CHANGELOG.md b/packages/kokkos-kernels/CHANGELOG.md index cefc116c83a0..343f815ed721 100644 --- a/packages/kokkos-kernels/CHANGELOG.md +++ b/packages/kokkos-kernels/CHANGELOG.md @@ -1,5 +1,19 @@ # Change Log +## [4.4.01](https://github.com/kokkos/kokkos-kernels/tree/4.4.01) +[Full Changelog](https://github.com/kokkos/kokkos-kernels/compare/4.4.00...4.4.01) + +### Build System: +- Restore size_t as default offset, in Tribits builds [\#2313](https://github.com/kokkos/kokkos-kernels/pull/2313) + +### Enhancements: +- Improve crs/bsr sorting performance [\#2293](https://github.com/kokkos/kokkos-kernels/pull/2293) + +### Bug Fixes: +- SpAdd handle: delete sort_option getter/setter [\#2296](https://github.com/kokkos/kokkos-kernels/pull/2296) +- Improve GH action to produce release artifacts [\#2312](https://github.com/kokkos/kokkos-kernels/pull/2312) +- coo2csr: add parens to function calls [\#2318](https://github.com/kokkos/kokkos-kernels/pull/2318) + ## [4.4.00](https://github.com/kokkos/kokkos-kernels/tree/4.4.00) [Full Changelog](https://github.com/kokkos/kokkos-kernels/compare/4.3.01...4.4.00) diff --git a/packages/kokkos-kernels/CMakeLists.txt b/packages/kokkos-kernels/CMakeLists.txt index 48608e756911..fd3515e0c44a 100644 --- a/packages/kokkos-kernels/CMakeLists.txt +++ b/packages/kokkos-kernels/CMakeLists.txt @@ -11,7 +11,7 @@ SET(KOKKOSKERNELS_TOP_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) SET(KokkosKernels_VERSION_MAJOR 4) SET(KokkosKernels_VERSION_MINOR 4) -SET(KokkosKernels_VERSION_PATCH 0) +SET(KokkosKernels_VERSION_PATCH 1) SET(KokkosKernels_VERSION "${KokkosKernels_VERSION_MAJOR}.${KokkosKernels_VERSION_MINOR}.${KokkosKernels_VERSION_PATCH}") #Set variables for config file diff --git a/packages/kokkos-kernels/master_history.txt b/packages/kokkos-kernels/master_history.txt index 6a546fb885ef..c712462dd81e 100644 --- a/packages/kokkos-kernels/master_history.txt +++ b/packages/kokkos-kernels/master_history.txt @@ -27,3 +27,4 @@ tag: 4.2.01 date: 01/30/2024 master: f429f6ec release: bcf9854b tag: 4.3.00 date: 04/03/2024 master: afd65f03 release: ebbf4b78 tag: 4.3.01 date: 05/07/2024 master: 1b0a15f5 release: 58785c1b tag: 4.4.00 date: 08/08/2024 master: d1a91b8a release: 1145f529 +tag: 4.4.01 date: 09/12/2024 master: 0608a337 release: 6b340287 diff --git a/packages/kokkos-kernels/sparse/src/KokkosSparse_coo2crs.hpp b/packages/kokkos-kernels/sparse/src/KokkosSparse_coo2crs.hpp index d10ef9974c19..d9964e18b729 100644 --- a/packages/kokkos-kernels/sparse/src/KokkosSparse_coo2crs.hpp +++ b/packages/kokkos-kernels/sparse/src/KokkosSparse_coo2crs.hpp @@ -79,7 +79,7 @@ auto coo2crs(DimType m, DimType n, RowViewType row, ColViewType col, DataViewTyp // clang-format on template auto coo2crs(KokkosSparse::CooMatrix &cooMatrix) { - return coo2crs(cooMatrix.numRows(), cooMatrix.numCols(), cooMatrix.row, cooMatrix.col, cooMatrix.data); + return coo2crs(cooMatrix.numRows(), cooMatrix.numCols(), cooMatrix.row(), cooMatrix.col(), cooMatrix.data()); } } // namespace KokkosSparse #endif // _KOKKOSSPARSE_COO2CRS_HPP From 3c7be10a5c8ae563ad45603ddb307afb12ff8ec0 Mon Sep 17 00:00:00 2001 From: Nathan Ellingwood Date: Thu, 12 Sep 2024 11:14:26 -0600 Subject: [PATCH 36/49] tpetra: update Tpetra_SUPPORTED_KOKKOS_VERSION to 4.4.1 --- packages/tpetra/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/tpetra/CMakeLists.txt b/packages/tpetra/CMakeLists.txt index 6dbaa6f6485b..eb0c52d686a6 100644 --- a/packages/tpetra/CMakeLists.txt +++ b/packages/tpetra/CMakeLists.txt @@ -24,7 +24,7 @@ TRIBITS_ADD_OPTION_AND_DEFINE( # Supported Kokkos version in Trilinos # NOTE: When we snapshot Kokkos into Trilinos, we have to update these numbers to maintain # compatibility with external Kokkos -SET(Tpetra_SUPPORTED_KOKKOS_VERSION "4.4.0") +SET(Tpetra_SUPPORTED_KOKKOS_VERSION "4.4.1") # Option to allow developers to ignore incompatible Kokkos versions From fb904dce054a5101215745862b9bb44048a3c2a5 Mon Sep 17 00:00:00 2001 From: "Samuel E. Browne" Date: Thu, 12 Sep 2024 11:45:55 -0600 Subject: [PATCH 37/49] Update PR w/o Epetra packages to use ERROR mode Can now add a nightly that builds the non-deprecated packages and gives warnings-as-errors. Signed-off-by: Samuel E. Browne --- packages/framework/ini-files/config-specs.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/framework/ini-files/config-specs.ini b/packages/framework/ini-files/config-specs.ini index 077149810ced..493e2e10cf64 100644 --- a/packages/framework/ini-files/config-specs.ini +++ b/packages/framework/ini-files/config-specs.ini @@ -1813,9 +1813,9 @@ use PACKAGE-ENABLES|ALL opt-set-cmake-var CMAKE_CXX_STANDARD STRING FORCE : 20 [rhel8_sems-gnu-8.5.0-openmpi-4.1.6-serial_debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_all-no-epetra] -#uses sems-v2 modules use rhel8_sems-gnu-8.5.0-openmpi-4.1.6-serial_debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_no-package-enables use PACKAGE-ENABLES|ALL-NO-EPETRA +opt-set-cmake-var Trilinos_WARNINGS_MODE FORCE : ERROR [rhel8_sems-gnu-8.5.0-openmpi-4.1.6-serial_debug-coverage_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_mpi_no-pt_no-rdc_no-uvm_deprecated-on_all] #uses sems-v2 modules From d7617bc79c87fba8f6f1287ea5c31768f2dc3770 Mon Sep 17 00:00:00 2001 From: "Samuel E. Browne" Date: Thu, 12 Sep 2024 12:03:00 -0600 Subject: [PATCH 38/49] Enable errors all at once Makes the reporting nicer. Signed-off-by: Samuel E. Browne --- cmake/WarningsErrorsPolicy.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmake/WarningsErrorsPolicy.cmake b/cmake/WarningsErrorsPolicy.cmake index 0dba4c4bf917..d87d9df30ef3 100644 --- a/cmake/WarningsErrorsPolicy.cmake +++ b/cmake/WarningsErrorsPolicy.cmake @@ -31,7 +31,6 @@ if("${Trilinos_WARNINGS_MODE}" STREQUAL "WARN") enable_errors("${promoted_warnings}") disable_warnings_for_deprecated_packages() elseif("${Trilinos_WARNINGS_MODE}" STREQUAL "ERROR") - enable_errors("${upcoming_warnings}") - enable_errors("${promoted_warnings}") + enable_errors("${promoted_warnings};${upcoming_warnings}") disable_warnings_for_deprecated_packages() endif() From 3bf1b55c59901d6849c4eefc1fbad8b2d34171b0 Mon Sep 17 00:00:00 2001 From: Anderson Chauphan Date: Thu, 12 Sep 2024 17:04:27 -0600 Subject: [PATCH 39/49] Removed python version from config build name Signed-off-by: Anderson Chauphan --- packages/framework/ini-files/config-specs.ini | 2 +- packages/framework/ini-files/environment-specs.ini | 2 +- packages/framework/ini-files/supported-envs.ini | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/framework/ini-files/config-specs.ini b/packages/framework/ini-files/config-specs.ini index 91fa7a252910..20c7692c63a3 100644 --- a/packages/framework/ini-files/config-specs.ini +++ b/packages/framework/ini-files/config-specs.ini @@ -2170,7 +2170,7 @@ opt-set-cmake-var Trilinos_ENABLE_TESTS BOOL FORCE : OFF opt-set-cmake-var Kokkos_ENABLE_TESTS BOOL FORCE : ON -[rhel8_python-3.8_debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_no-mpi_no-pt_no-rdc_no-uvm_deprecated-on_pr-framework] +[rhel8_python_debug_shared_no-kokkos-arch_no-asan_no-complex_no-fpic_no-mpi_no-pt_no-rdc_no-uvm_deprecated-on_pr-framework] use PACKAGE-ENABLES|PR-FRAMEWORK opt-set-cmake-var TFW_Python3_Testing BOOL FORCE : ON diff --git a/packages/framework/ini-files/environment-specs.ini b/packages/framework/ini-files/environment-specs.ini index bc57aa649f43..88d66fc8417e 100644 --- a/packages/framework/ini-files/environment-specs.ini +++ b/packages/framework/ini-files/environment-specs.ini @@ -166,7 +166,7 @@ envvar-set OMPI_CXX: ${TRILINOS_DIR}/packages/kokkos/bin/nvcc_wrapper [rhel8_aue-gcc-openmpi] -[rhel8_python-3.8] +[rhel8_python] envvar-find-in-path PYTHON_EXECUTABLE : python3 [rhel8_oneapi-intelmpi] diff --git a/packages/framework/ini-files/supported-envs.ini b/packages/framework/ini-files/supported-envs.ini index aacf2f12acad..12b5d9d135ac 100644 --- a/packages/framework/ini-files/supported-envs.ini +++ b/packages/framework/ini-files/supported-envs.ini @@ -174,7 +174,7 @@ gnu [rhel8] aue-gnu-12.1.0-anaconda3-serial -python-3.8 +python oneapi-intelmpi cuda-gcc-openmpi gcc-openmpi From 50278c0920765469cced90253842e5b3a218d81c Mon Sep 17 00:00:00 2001 From: Maarten Arnst Date: Thu, 12 Sep 2024 20:52:58 +0200 Subject: [PATCH 40/49] Take and forward exec in deep copy of View of MP Vector --- .../kokkos/vector/KokkosExp_View_MP_Vector_Contiguous.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/stokhos/src/sacado/kokkos/vector/KokkosExp_View_MP_Vector_Contiguous.hpp b/packages/stokhos/src/sacado/kokkos/vector/KokkosExp_View_MP_Vector_Contiguous.hpp index 552c84ec1649..94b49b6ce622 100644 --- a/packages/stokhos/src/sacado/kokkos/vector/KokkosExp_View_MP_Vector_Contiguous.hpp +++ b/packages/stokhos/src/sacado/kokkos/vector/KokkosExp_View_MP_Vector_Contiguous.hpp @@ -326,7 +326,7 @@ void deep_copy( /* Specialize for deep copy of MP::Vector */ template< class ExecSpace, class DT , class ... DP , class ST , class ... SP > inline -void deep_copy( const ExecSpace &, +void deep_copy( const ExecSpace & exec, const View & dst , const View & src , typename std::enable_if<( @@ -359,7 +359,7 @@ void deep_copy( const ExecSpace &, // typename View::array_type( src ) ); Kokkos::deep_copy( - ExecSpace() , + exec , typename FlatArrayType< View >::type( dst ) , typename FlatArrayType< View >::type( src ) ); } From d5f0ec2502e99fbd24f77ce97ba6bde5827a3c96 Mon Sep 17 00:00:00 2001 From: Jonathan Hu Date: Fri, 13 Sep 2024 10:28:01 -0700 Subject: [PATCH 41/49] Trilinos: fix project actions Fix MueLu and Tpetra project locations --- .github/workflows/tpetra_muelu_label_to_project.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tpetra_muelu_label_to_project.yml b/.github/workflows/tpetra_muelu_label_to_project.yml index 9f2849f34ce9..f1fb27aa2962 100644 --- a/.github/workflows/tpetra_muelu_label_to_project.yml +++ b/.github/workflows/tpetra_muelu_label_to_project.yml @@ -44,11 +44,11 @@ jobs: uses: srggrs/assign-one-project-github-action@65a8ddab497df42ef268001e67bbf976f8fd39e1 # 1.3.1 if: contains(github.event.label.name, 'MueLu') || contains(github.event.issue.title, 'MueLu') with: - project: 'https://github.com/trilinos/Trilinos/projects/5' + project: 'https://github.com/orgs/trilinos/projects/8' column_name: 'Backlog' - name: Add to Tpetra Project uses: srggrs/assign-one-project-github-action@65a8ddab497df42ef268001e67bbf976f8fd39e1 # 1.3.1 if: contains(github.event.label.name, 'Tpetra') || contains(github.event.issue.title, 'Tpetra') with: - project: 'https://github.com/trilinos/Trilinos/projects/2' + project: 'https://github.com/orgs/trilinos/projects/9' column_name: 'Needs Triage' From c581432d7c03e54f9d78c1dd6f07d1716f93316d Mon Sep 17 00:00:00 2001 From: "Samuel E. Browne" Date: Fri, 13 Sep 2024 20:48:01 -0600 Subject: [PATCH 42/49] Relocate code into TriBITS callback This way we can get the cache options from a TriBITS-imported cachefile Signed-off-by: Samuel E. Browne --- CMakeLists.txt | 6 ++--- cmake/ProjectCompilerPostConfig.cmake | 36 +++++++++++++++++++++++++++ cmake/WarningsErrorsPolicy.cmake | 36 --------------------------- 3 files changed, 38 insertions(+), 40 deletions(-) delete mode 100644 cmake/WarningsErrorsPolicy.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 13efb2cac6b1..0ea6ec4a5b48 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,9 +17,7 @@ PROJECT(${PROJECT_NAME} NONE) # Set up to use ccache include("${CMAKE_CURRENT_LIST_DIR}/cmake/UseCCache.cmake") -set(deprecated_packages Amesos AztecOO Epetra EpetraExt Ifpack Intrepid Isorropia ML NewPackage Pliris PyTrilinos ShyLU_DDCore ThyraEpetraAdapters ThyraEpetraExtAdapters Triutils) - -include("${CMAKE_CURRENT_LIST_DIR}/cmake/WarningsErrorsPolicy.cmake") +set(DEPRECATED_PACKAGES Amesos AztecOO Epetra EpetraExt Ifpack Intrepid Isorropia ML NewPackage Pliris PyTrilinos ShyLU_DDCore ThyraEpetraAdapters ThyraEpetraExtAdapters Triutils) # Set an env so we know we are in configure set(ENV{CMAKE_IS_IN_CONFIGURE_MODE} 1) @@ -61,7 +59,7 @@ IF(${PROJECT_NAME}_ENABLE_YouCompleteMe) ENDIF() set(enabled_deprecated_packages "") -FOREACH(package ${deprecated_packages}) +FOREACH(package ${DEPRECATED_PACKAGES}) IF(Trilinos_ENABLE_${package}) set(enabled_deprecated_packages ${package} ${enabled_deprecated_packages}) ENDIF() diff --git a/cmake/ProjectCompilerPostConfig.cmake b/cmake/ProjectCompilerPostConfig.cmake index 315247c500c5..b365047eeef4 100644 --- a/cmake/ProjectCompilerPostConfig.cmake +++ b/cmake/ProjectCompilerPostConfig.cmake @@ -1,5 +1,29 @@ tribits_get_package_enable_status(Kokkos KokkosEnable "") +macro(disable_warnings_for_deprecated_packages) + message(STATUS "Disabling all warnings/errors for deprecated packages") + foreach(package ${DEPRECATED_PACKAGES}) + set(${package}_CXX_FLAGS "-w ${${package}_CXX_FLAGS}") + endforeach() +endmacro() + + +macro(enable_warnings warnings) + message(STATUS "Trilinos warnings enabled: ${warnings}") + foreach(warning ${warnings}) + set(CMAKE_CXX_FLAGS "-W${warning} -Wno-error=${warning} ${CMAKE_CXX_FLAGS}") + endforeach() +endmacro() + + +macro(enable_errors errors) + message(STATUS "Trilinos warnings-as-errors enabled: ${errors}") + foreach(error ${errors}) + set(CMAKE_CXX_FLAGS "-Werror=${error} ${CMAKE_CXX_FLAGS}") + endforeach() +endmacro() + + IF (CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM") MESSAGE("-- " "Adding '-fp-model=precise' to C++ compiler flags because Trilinos needs it when using the Intel OneAPI C++ compiler.") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fp-model=precise") @@ -17,3 +41,15 @@ IF (KokkosEnable) # NOTE: Setting TRILINOS_TOPLEVEL_CXX_FLAGS only has any impact if Kokkos is # being treated as an internal package. ENDIF() + +set(upcoming_warnings shadow ${Trilinos_ADDITIONAL_WARNINGS}) +set(promoted_warnings parentheses sign-compare unused-variable) + +if("${Trilinos_WARNINGS_MODE}" STREQUAL "WARN") + enable_warnings("${upcoming_warnings}") + enable_errors("${promoted_warnings}") + disable_warnings_for_deprecated_packages() +elseif("${Trilinos_WARNINGS_MODE}" STREQUAL "ERROR") + enable_errors("${promoted_warnings};${upcoming_warnings}") + disable_warnings_for_deprecated_packages() +endif() diff --git a/cmake/WarningsErrorsPolicy.cmake b/cmake/WarningsErrorsPolicy.cmake deleted file mode 100644 index d87d9df30ef3..000000000000 --- a/cmake/WarningsErrorsPolicy.cmake +++ /dev/null @@ -1,36 +0,0 @@ -macro(disable_warnings_for_deprecated_packages) - message(STATUS "Disabling all warnings/errors for deprecated packages") - foreach(package ${deprecated_packages}) - set(${package}_CXX_FLAGS "-w ${${package}_CXX_FLAGS}") - endforeach() -endmacro() - - -macro(enable_warnings warnings) - message(STATUS "Trilinos warnings enabled: ${warnings}") - foreach(warning ${warnings}) - set(CMAKE_CXX_FLAGS "-W${warning} -Wno-error=${warning} ${CMAKE_CXX_FLAGS}") - endforeach() -endmacro() - - -macro(enable_errors errors) - message(STATUS "Trilinos warnings-as-errors enabled: ${errors}") - foreach(error ${errors}) - set(CMAKE_CXX_FLAGS "-Werror=${error} ${CMAKE_CXX_FLAGS}") - endforeach() -endmacro() - - -set(upcoming_warnings shadow ${Trilinos_ADDITIONAL_WARNINGS}) -set(promoted_warnings parentheses sign-compare unused-variable) - - -if("${Trilinos_WARNINGS_MODE}" STREQUAL "WARN") - enable_warnings("${upcoming_warnings}") - enable_errors("${promoted_warnings}") - disable_warnings_for_deprecated_packages() -elseif("${Trilinos_WARNINGS_MODE}" STREQUAL "ERROR") - enable_errors("${promoted_warnings};${upcoming_warnings}") - disable_warnings_for_deprecated_packages() -endif() From d037353776379f87348a04e2cf3b93adc673ebdc Mon Sep 17 00:00:00 2001 From: "Justin M. LaPre" Date: Mon, 16 Sep 2024 15:23:49 +0000 Subject: [PATCH 43/49] check for existence of dir before writing urls --- cmake/SimpleTesting/cmake/ctest-cdash-setup.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmake/SimpleTesting/cmake/ctest-cdash-setup.cmake b/cmake/SimpleTesting/cmake/ctest-cdash-setup.cmake index 018863e17b68..cb354a2b78f8 100644 --- a/cmake/SimpleTesting/cmake/ctest-cdash-setup.cmake +++ b/cmake/SimpleTesting/cmake/ctest-cdash-setup.cmake @@ -126,10 +126,12 @@ message(">>> CDash URL2 = ${build_url2}") message(">>> CDash URL3 = ${build_url3}") message(">>> CDash URL4 = ${build_url4}") -# Write the URL into the filesystem so AT2 can read it later -message(">>> Writing URLs to /home/runner/AT2_URL.txt and AT2_ALL_BUILDS.txt") -file(WRITE /home/runner/AT2_URL.txt ${build_url3}) -file(WRITE /home/runner/AT2_ALL_BUILDS.txt ${build_url4}) +if (EXISTS /home/runner/) + # Write the URL into the filesystem so AT2 can read it later + message(">>> Writing URLs to /home/runner/AT2_URL.txt and AT2_ALL_BUILDS.txt") + file(WRITE /home/runner/AT2_URL.txt ${build_url3}) + file(WRITE /home/runner/AT2_ALL_BUILDS.txt ${build_url4}) +endif() # ----------------------------------------------------------- # -- Optionally update the repository From 3083feab4a5c9ea072eb79733bda5417d0fadfd0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 22:57:10 +0000 Subject: [PATCH 44/49] Bump github/codeql-action from 3.26.6 to 3.26.7 Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.26.6 to 3.26.7. - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/4dd16135b69a43b6c8efb853346f8437d92d3c93...8214744c546c1e5c8f03dde8fab3a7353211988d) --- updated-dependencies: - dependency-name: github/codeql-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/codeql.yml | 4 ++-- .github/workflows/scorecards.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 1c950be5ed44..192b0458813c 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -62,7 +62,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6 + uses: github/codeql-action/init@8214744c546c1e5c8f03dde8fab3a7353211988d # v3.26.7 with: languages: ${{ matrix.language }} build-mode: ${{ matrix.build-mode }} @@ -85,6 +85,6 @@ jobs: make -j 2 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6 + uses: github/codeql-action/analyze@8214744c546c1e5c8f03dde8fab3a7353211988d # v3.26.7 with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/scorecards.yml b/.github/workflows/scorecards.yml index f895708c5971..3da9711a90b7 100644 --- a/.github/workflows/scorecards.yml +++ b/.github/workflows/scorecards.yml @@ -66,6 +66,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@4dd16135b69a43b6c8efb853346f8437d92d3c93 # v3.26.6 + uses: github/codeql-action/upload-sarif@8214744c546c1e5c8f03dde8fab3a7353211988d # v3.26.7 with: sarif_file: results.sarif From a7a5ceb15ef446ea9e1b4b25a51c2d731223f0b0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Sep 2024 22:57:13 +0000 Subject: [PATCH 45/49] Bump step-security/harden-runner from 2.9.1 to 2.10.1 Bumps [step-security/harden-runner](https://github.com/step-security/harden-runner) from 2.9.1 to 2.10.1. - [Release notes](https://github.com/step-security/harden-runner/releases) - [Commits](https://github.com/step-security/harden-runner/compare/5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde...91182cccc01eb5e619899d80e4e971d6181294a7) --- updated-dependencies: - dependency-name: step-security/harden-runner dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/dependency-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index bf2dcfbae9fd..c1209291aab7 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Harden Runner - uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1 + uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1 with: egress-policy: audit From 283beadb4345abf634282650a4c3ecaffd7a5bfc Mon Sep 17 00:00:00 2001 From: Christian Glusa Date: Tue, 17 Sep 2024 10:38:09 -0600 Subject: [PATCH 46/49] Thyra TpetraAdapters: Check that ETI matches Tpetra scalar types Signed-off-by: Christian Glusa --- packages/thyra/adapters/tpetra/CMakeLists.txt | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/packages/thyra/adapters/tpetra/CMakeLists.txt b/packages/thyra/adapters/tpetra/CMakeLists.txt index 7794705c2b88..43016f219f4d 100644 --- a/packages/thyra/adapters/tpetra/CMakeLists.txt +++ b/packages/thyra/adapters/tpetra/CMakeLists.txt @@ -1,6 +1,32 @@ TRIBITS_SUBPACKAGE(TpetraAdapters) +ASSERT_DEFINED( + Thyra_ENABLE_EXPLICIT_INSTANTIATION + Tpetra_INST_FLOAT + Tpetra_INST_COMPLEX_DOUBLE + Tpetra_INST_COMPLEX_FLOAT + Teuchos_INST_FLOAT + Teuchos_INST_COMPLEX_DOUBLE + Teuchos_INST_COMPLEX_FLOAT +) + +IF (Thyra_ENABLE_EXPLICIT_INSTANTIATION) + + IF ((Tpetra_INST_FLOAT AND NOT Teuchos_INST_FLOAT) OR (NOT Tpetra_INST_FLOAT AND Teuchos_INST_FLOAT)) + MESSAGE(FATAL_ERROR "Tpetra_INST_FLOAT=${Tpetra_INST_FLOAT} != Teuchos_INST_FLOAT=${Teuchos_INST_FLOAT}. The two need to match. Consider setting Trilinos_ENABLE_FLOAT instead of setting Tpetra_INST_FLOAT and/or Teuchos_INST_FLOAT individually.") + ENDIF() + + IF ((Tpetra_INST_COMPLEX_FLOAT AND NOT Teuchos_INST_COMPLEX_FLOAT) OR (NOT Tpetra_INST_COMPLEX_FLOAT AND Teuchos_INST_COMPLEX_FLOAT)) + MESSAGE(FATAL_ERROR "Tpetra_INST_COMPLEX_FLOAT=${Tpetra_INST_COMPLEX_FLOAT} != Teuchos_INST_COMPLEX_FLOAT=${Teuchos_INST_COMPLEX_FLOAT}. The two need to match. Consider setting Trilinos_ENABLE_COMPLEX_FLOAT instead of setting Tpetra_INST_COMPLEX_FLOAT and/or Teuchos_INST_COMPLEX_FLOAT individually.") + ENDIF() + + IF ((Tpetra_INST_COMPLEX_DOUBLE AND NOT Teuchos_INST_COMPLEX_DOUBLE) OR (NOT Tpetra_INST_COMPLEX_DOUBLE AND Teuchos_INST_COMPLEX_DOUBLE)) + MESSAGE(FATAL_ERROR "Tpetra_INST_COMPLEX_DOUBLE=${Tpetra_INST_COMPLEX_DOUBLE} != Teuchos_INST_COMPLEX_DOUBLE=${Teuchos_INST_COMPLEX_DOUBLE}. The two need to match. Consider setting Trilinos_ENABLE_COMPLEX_DOUBLE instead of setting Tpetra_INST_COMPLEX_DOUBLE and/or Teuchos_INST_COMPLEX_DOUBLE individually.") + ENDIF() + +ENDIF() + ADD_SUBDIRECTORY(src) TRIBITS_ADD_TEST_DIRECTORIES(test) From c06b4a182d5978f1145129045f99f0f4b4ba25e8 Mon Sep 17 00:00:00 2001 From: Anderson Chauphan Date: Tue, 17 Sep 2024 14:28:22 -0600 Subject: [PATCH 47/49] Removed unnecessary environment specs for unittests Signed-off-by: Anderson Chauphan --- .../unittests/environment-specs.ini | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/packages/framework/pr_tools/trilinosprhelpers/unittests/environment-specs.ini b/packages/framework/pr_tools/trilinosprhelpers/unittests/environment-specs.ini index 2c77e91434ea..a72a796e3f4c 100644 --- a/packages/framework/pr_tools/trilinosprhelpers/unittests/environment-specs.ini +++ b/packages/framework/pr_tools/trilinosprhelpers/unittests/environment-specs.ini @@ -151,35 +151,4 @@ # Common environment options not specific to a particular system. #------------------------------------------------------------------------------ -[COMPILER-VARS] -envvar-set CC : mpicc -envvar-set CXX : mpicxx -envvar-set FC : mpif77 -envvar-set F90 : mpif90 - -[MODULE-PURGE] -module-purge - -[MPI-COMPILER-VARS] -envvar-find-in-path MPICC : mpicc -envvar-find-in-path MPICXX : mpicxx -envvar-find-in-path MPIF90 : mpif90 - -[OMPI-CLANG-VARS] -envvar-find-in-path OMPI_CXX : clang++ -envvar-find-in-path OMPI_CC : clang -envvar-find-in-path OMPI_FC : gfortran - -[OMPI-GNU-VARS] -envvar-find-in-path OMPI_CXX : g++ -envvar-find-in-path OMPI_CC : gcc -envvar-find-in-path OMPI_FC : gfortran - -[OMPI-INTEL-VARS] -envvar-find-in-path OMPI_CXX : icpc -envvar-find-in-path OMPI_CC : icc -envvar-find-in-path OMPI_FC : ifort - [rhel8_sems-gnu-openmpi] -use MPI-COMPILER-VARS -use OMPI-GNU-VARS From a5539afa0cfa9ce61951c9619d923deefc5b6a6b Mon Sep 17 00:00:00 2001 From: Eric Phipps Date: Thu, 19 Sep 2024 09:02:02 -0600 Subject: [PATCH 48/49] Stokhos: Deprecate the PCE scalar type Adds Stokhos_ENABLE_DEPRECATED_CODE option (default is ON), and the PCE scalar type can only be enabled if Stokhos_ENABLE_DEPRECATED_CODE=ON. If off, and the PCE scalar type is enabled, cmake errors out. Also prints a cmake warning if deprecated code is on and the PCE scalar type is on, and copius compiler warnings. --- packages/stokhos/CMakeLists.txt | 22 ++++++++++++++++++- .../pce/Stokhos_Sacado_Kokkos_UQ_PCE.hpp | 2 ++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/packages/stokhos/CMakeLists.txt b/packages/stokhos/CMakeLists.txt index 18b3d6beb8cc..353c52805e9d 100644 --- a/packages/stokhos/CMakeLists.txt +++ b/packages/stokhos/CMakeLists.txt @@ -10,6 +10,14 @@ TRIBITS_PACKAGE(Stokhos) TRIBITS_ADD_EXPLICIT_INSTANTIATION_OPTION() +SET (Stokhos_ENABLE_DEPRECATED_CODE_DEFAULT ON) +TRIBITS_ADD_OPTION_AND_DEFINE( + Stokhos_ENABLE_DEPRECATED_CODE + STOKHOS_ENABLE_DEPRECATED_CODE + "Whether Stokhos enables deprecated code (that is, anything marked with the STOKHOS_DEPRECATED macro) at compile time. Default is ON (deprecated code enabled)." + ${Stokhos_ENABLE_DEPRECATED_CODE_DEFAULT} +) + TRIBITS_ADD_OPTION_AND_DEFINE(${PACKAGE_NAME}_ENABLE_DEBUG STOKHOS_DEBUG "Enable debug code in stokhos" @@ -48,8 +56,12 @@ IF(HAVE_STOKHOS_ENSEMBLE_GEMV) ENDIF() SET(Stokhos_ENABLE_Ensemble_Scalar_Type_Default OFF) +SET(Stokhos_ENABLE_PCE_Scalar_Type_Default OFF) IF(Stokhos_ENABLE_Sacado) SET(Stokhos_ENABLE_Ensemble_Scalar_Type_Default ON) + IF(Stokhos_ENABLE_DEPRECATED_CODE) + SET(Stokhos_ENABLE_PCE_Scalar_Type_Default ON) + ENDIF() ENDIF() TRIBITS_ADD_OPTION_AND_DEFINE(Stokhos_ENABLE_Ensemble_Scalar_Type @@ -60,7 +72,15 @@ TRIBITS_ADD_OPTION_AND_DEFINE(Stokhos_ENABLE_Ensemble_Scalar_Type TRIBITS_ADD_OPTION_AND_DEFINE(Stokhos_ENABLE_PCE_Scalar_Type HAVE_STOKHOS_PCE_SCALAR_TYPE "Enable use of the PCE UQ scalar type in stokhos" - ${Stokhos_ENABLE_Ensemble_Scalar_Type_Default} ) + ${Stokhos_ENABLE_PCE_Scalar_Type_Default} ) + +IF(Stokhos_ENABLE_PCE_Scalar_Type) + IF(Stokhos_ENABLE_DEPRECATED_CODE) + MESSAGE(WARNING "The PCE scalar type is deprecated in Stokhos but Stokhos_ENABLE_DEPRECATED_CODE=ON.") + ELSE() + MESSAGE(FATAL_ERROR "The PCE scalar type is deprecated in Stokhos but Stokhos_ENABLE_DEPRECATED_CODE=OFF. You must set Stokhos_ENABLE_PCE_Scalar_Type=OFF or Stokhos_ENABLE_DEPRECATED_CODE=ON.") + ENDIF() +ENDIF() IF(Stokhos_ENABLE_Ensemble_Scalar_Type AND NOT Stokhos_ENABLE_Sacado) MESSAGE(FATAL_ERROR "Ensemble scalar type cannot be enabled unless Sacado is enabled!") diff --git a/packages/stokhos/src/sacado/kokkos/pce/Stokhos_Sacado_Kokkos_UQ_PCE.hpp b/packages/stokhos/src/sacado/kokkos/pce/Stokhos_Sacado_Kokkos_UQ_PCE.hpp index e721a8e3fd75..b3460e4d3a5a 100644 --- a/packages/stokhos/src/sacado/kokkos/pce/Stokhos_Sacado_Kokkos_UQ_PCE.hpp +++ b/packages/stokhos/src/sacado/kokkos/pce/Stokhos_Sacado_Kokkos_UQ_PCE.hpp @@ -12,6 +12,8 @@ #include "Stokhos_ConfigDefs.h" +#warning "The PCE scalar type is deprecated." + #include "Kokkos_Macros.hpp" #include "Stokhos_Sacado_Kokkos_MathFunctions.hpp" From 3f9c2cccab2c226c2838c0e2a8357a5b8cf7a591 Mon Sep 17 00:00:00 2001 From: Eric Phipps Date: Thu, 19 Sep 2024 16:57:23 -0600 Subject: [PATCH 49/49] Stokhos: Use standard deprecation macros --- packages/stokhos/CMakeLists.txt | 16 +++++----------- packages/stokhos/cmake/Stokhos_config.h.in | 4 ++++ .../kokkos/pce/Stokhos_Sacado_Kokkos_UQ_PCE.hpp | 4 ++++ 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/packages/stokhos/CMakeLists.txt b/packages/stokhos/CMakeLists.txt index 353c52805e9d..95efba5fd571 100644 --- a/packages/stokhos/CMakeLists.txt +++ b/packages/stokhos/CMakeLists.txt @@ -10,13 +10,7 @@ TRIBITS_PACKAGE(Stokhos) TRIBITS_ADD_EXPLICIT_INSTANTIATION_OPTION() -SET (Stokhos_ENABLE_DEPRECATED_CODE_DEFAULT ON) -TRIBITS_ADD_OPTION_AND_DEFINE( - Stokhos_ENABLE_DEPRECATED_CODE - STOKHOS_ENABLE_DEPRECATED_CODE - "Whether Stokhos enables deprecated code (that is, anything marked with the STOKHOS_DEPRECATED macro) at compile time. Default is ON (deprecated code enabled)." - ${Stokhos_ENABLE_DEPRECATED_CODE_DEFAULT} -) +TRIBITS_ADD_SHOW_DEPRECATED_WARNINGS_OPTION() TRIBITS_ADD_OPTION_AND_DEFINE(${PACKAGE_NAME}_ENABLE_DEBUG STOKHOS_DEBUG @@ -59,7 +53,7 @@ SET(Stokhos_ENABLE_Ensemble_Scalar_Type_Default OFF) SET(Stokhos_ENABLE_PCE_Scalar_Type_Default OFF) IF(Stokhos_ENABLE_Sacado) SET(Stokhos_ENABLE_Ensemble_Scalar_Type_Default ON) - IF(Stokhos_ENABLE_DEPRECATED_CODE) + IF(NOT Stokhos_HIDE_DEPRECATED_CODE) SET(Stokhos_ENABLE_PCE_Scalar_Type_Default ON) ENDIF() ENDIF() @@ -75,10 +69,10 @@ TRIBITS_ADD_OPTION_AND_DEFINE(Stokhos_ENABLE_PCE_Scalar_Type ${Stokhos_ENABLE_PCE_Scalar_Type_Default} ) IF(Stokhos_ENABLE_PCE_Scalar_Type) - IF(Stokhos_ENABLE_DEPRECATED_CODE) - MESSAGE(WARNING "The PCE scalar type is deprecated in Stokhos but Stokhos_ENABLE_DEPRECATED_CODE=ON.") + IF(Stokhos_HIDE_DEPRECATED_CODE) + MESSAGE(FATAL_ERROR "The PCE scalar type is deprecated in Stokhos but Stokhos_HIDE_DEPRECATED_CODE=ON. You must set Stokhos_ENABLE_PCE_Scalar_Type=OFF or Stokhos_HIDE_DEPRECATED_CODE=OFF.") ELSE() - MESSAGE(FATAL_ERROR "The PCE scalar type is deprecated in Stokhos but Stokhos_ENABLE_DEPRECATED_CODE=OFF. You must set Stokhos_ENABLE_PCE_Scalar_Type=OFF or Stokhos_ENABLE_DEPRECATED_CODE=ON.") + MESSAGE(WARNING "The PCE scalar type is deprecated in Stokhos but Stokhos_HIDE_DEPRECATED_CODE=OFF.") ENDIF() ENDIF() diff --git a/packages/stokhos/cmake/Stokhos_config.h.in b/packages/stokhos/cmake/Stokhos_config.h.in index 412644c4dff2..735dbafa2916 100644 --- a/packages/stokhos/cmake/Stokhos_config.h.in +++ b/packages/stokhos/cmake/Stokhos_config.h.in @@ -132,3 +132,7 @@ #define STOKHOS_GEMV_CACHE_SIZE @Stokhos_Ensemble_GEMV_Cache_Size@ #define STOKHOS_GEMV_TEAM_SIZE @Stokhos_Ensemble_GEMV_Team_Size@ #endif // HAVE_STOKHOS_ENSEMBLE_GEMV + +@STOKHOS_DEPRECATED_DECLARATIONS@ + +#cmakedefine Stokhos_SHOW_DEPRECATED_WARNINGS diff --git a/packages/stokhos/src/sacado/kokkos/pce/Stokhos_Sacado_Kokkos_UQ_PCE.hpp b/packages/stokhos/src/sacado/kokkos/pce/Stokhos_Sacado_Kokkos_UQ_PCE.hpp index b3460e4d3a5a..77b0473c1952 100644 --- a/packages/stokhos/src/sacado/kokkos/pce/Stokhos_Sacado_Kokkos_UQ_PCE.hpp +++ b/packages/stokhos/src/sacado/kokkos/pce/Stokhos_Sacado_Kokkos_UQ_PCE.hpp @@ -12,7 +12,11 @@ #include "Stokhos_ConfigDefs.h" +#if defined(Stokhos_SHOW_DEPRECATED_WARNINGS) +#ifdef __GNUC__ #warning "The PCE scalar type is deprecated." +#endif +#endif #include "Kokkos_Macros.hpp"