Skip to content

Commit ed030dc

Browse files
committed
Merge branch 'bartgol/e3sm/kokkos-4.2' into master (PR #6101)
This PR will take time to integrate, I'm opening it so I can keep track of what I check. e3sm_integration: chrysalis (intel): all PASS pm-cpu (intel) 127 PASS and 1 DIFF: SMS_Ld2.ne30pg2_r05_IcoswISC30E3r5.BGCEXP_CNTL_CNPECACNT_1850.pm-cpu_intel.elm-bgcexp (which is currently consistently failing in the e3sm_integration_next_intel nightly build) e3sm_developer: pm-cpu (gnu): 75 PASS and 1 DIFF: ERP_Ld3.ne4pg2_oQU480.F2010.pm-cpu_gnu homme_integration: chrysalis (intel): PASS pm-cpu (gnu): builds PASS, stuck in Q for run, so I cancelled it. pm-cpu is not tested in nightlies anyways eamxx testing (from eamxx repo, with a few additional commits for eamxx) v1 (CIME) chrysalis (intel): 10 PASS (all scream v1) 5 DIFF (all scream v0) pm-cpu (gnu): 3 PASS, 1 DIFF frontier PEND ascent: no longer part of eamxx nightlies pm-gpu (gnugpu): 7 PASS, 5 DIFF. All DIFF are in debug mode, while all non-debug builds pass. I'm trying to understand what's the catch. standalone mappy (gnu): all PASS weaver (gnu+cuda): all PASS [BFB]
2 parents 1eb1aa5 + 74611c9 commit ed030dc

File tree

19 files changed

+39
-36
lines changed

19 files changed

+39
-36
lines changed

cime_config/machines/cmake_macros/crayclang-scream_frontier-scream-gpu.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ if (COMP_NAME STREQUAL gptl)
3434
endif()
3535
set(PIO_FILESYSTEM_HINTS "lustre")
3636

37-
string(APPEND KOKKOS_OPTIONS " -DKokkos_ENABLE_HIP=On -DKokkos_ARCH_VEGA90A=On -DCMAKE_CXX_FLAGS='-std=gnu++14'")
37+
string(APPEND KOKKOS_OPTIONS " -DKokkos_ENABLE_HIP=On -DKokkos_ARCH_VEGA90A=On -DCMAKE_CXX_FLAGS='-std=gnu++14' -DKokkos_ENABLE_OPENMP=OFF")
3838
set(USE_HIP "TRUE")

components/eamxx/src/share/util/scream_utils.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <list>
1212
#include <algorithm>
1313
#include <map>
14+
#include <iostream>
1415

1516
namespace scream {
1617

components/homme/CMakeLists.txt

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -447,18 +447,22 @@ if(HOMME_BUILD_EXECS AND NOT BUILD_HOMME_WITHOUT_PIOLIBRARY)
447447
ENDIF ()
448448
ENDIF ()
449449

450-
# If we don't need kokkos we don't need EKAT, and if
451-
# Homme is built in EAMxx EKAT is already built
452-
IF (HOMME_USE_KOKKOS AND HOMME_STANDALONE)
453-
# Add ekat's cmake/pkg_build folder to cmake path
450+
IF (HOMME_USE_KOKKOS)
451+
# Add ekat's cmake scripts folders to cmake path
454452
set (EKAT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../externals/ekat)
455453
set (EKAT_CMAKE_PATH ${EKAT_SOURCE_DIR}/cmake)
456454
list(APPEND CMAKE_MODULE_PATH
457-
${EKAT_CMAKE_PATH}
458-
${EKAT_CMAKE_PATH}/pkg_build
459-
${EKAT_CMAKE_PATH}/tpls
455+
${EKAT_CMAKE_PATH}
456+
${EKAT_CMAKE_PATH}/tpls
460457
)
461-
include (EkatBuildKokkos)
458+
459+
# We first try to use find_package. If that doesn't work, build from EKAT's submodule
460+
include (EkatFindKokkos)
461+
if (NOT Kokkos_FOUND)
462+
# The following script checks if Kokkos is already available as a target, and if so does nothing.
463+
# For instance, if HOMME is built inside EAMxx, Kokkos will already be available
464+
include (EkatBuildKokkos)
465+
endif()
462466
ENDIF ()
463467

464468
# This folder contains the CMake macro used to build cxx unit tests

components/homme/cmake/SetCompilerFlags.cmake

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,6 @@ IF (${HOMME_USE_CXX})
6868
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g")
6969

7070
INCLUDE(CheckCXXCompilerFlag)
71-
CHECK_CXX_COMPILER_FLAG("-std=c++14" CXX14_SUPPORTED)
72-
IF (CXX14_SUPPORTED)
73-
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
74-
ELSEIF (${HOMME_USE_KOKKOS})
75-
MESSAGE (FATAL_ERROR "Kokkos needs C++14, but the C++ compiler does not support it.")
76-
ENDIF ()
7771
CHECK_CXX_COMPILER_FLAG("-cxxlib" CXXLIB_SUPPORTED)
7872
IF (CXXLIB_SUPPORTED)
7973
SET(CXXLIB_SUPPORTED_CACHE TRUE CACHE BOOL "")

components/homme/src/preqx_kokkos/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,8 @@ MACRO(PREQX_KOKKOS_SETUP)
168168
${SRC_SHARE_DIR}/cxx/EulerStepFunctor.cpp
169169
${SRC_SHARE_DIR}/cxx/ExecSpaceDefs.cpp
170170
${SRC_SHARE_DIR}/cxx/FunctorsBuffersManager.cpp
171+
${SRC_SHARE_DIR}/cxx/GllFvRemap.cpp
172+
${SRC_SHARE_DIR}/cxx/GllFvRemapImpl.cpp
171173
${SRC_SHARE_DIR}/cxx/Hommexx_Session.cpp
172174
${SRC_SHARE_DIR}/cxx/HybridVCoord.cpp
173175
${SRC_SHARE_DIR}/cxx/HyperviscosityFunctor.cpp

components/homme/src/preqx_kokkos/config.h.cmake.in

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,8 @@
5858
/* ZOLTAN2 SUBPACKAGE OF TRILINOS library */
5959
#cmakedefine01 TRILINOS_HAVE_ZOLTAN2
6060

61-
/* When doing BFB testing, we occasionally must use modified code. */
62-
/* Use this flag to protect such code. */
63-
#cmakedefine HOMMEXX_BFB_TESTING
61+
/* Detect whether this is a kokkos target */
62+
#cmakedefine01 KOKKOS_TARGET
6463

6564
/* Whether to use OpenMP4 */
6665
#cmakedefine OMP4

components/homme/src/share/compose/cedr_util.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
#ifndef INCLUDE_CEDR_UTIL_HPP
55
#define INCLUDE_CEDR_UTIL_HPP
66

7-
#include <sstream>
8-
97
#include "cedr_kokkos.hpp"
108
#include "cedr_mpi.hpp"
119

10+
#include <sstream> // For std::stringstream
11+
#include <iostream> // For std::cerr
12+
1213
namespace cedr {
1314
namespace util {
1415

components/homme/src/share/compose/compose_slmm.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,6 @@ extern "C" {
276276
// Interface for Homme, through compose_mod.F90.
277277
void kokkos_init () {
278278
amb::dev_init_threads();
279-
Kokkos::InitArguments args;
280-
args.disable_warnings = true;
281279
initialize_kokkos();
282280
// Test these initialize correctly.
283281
Kokkos::View<int> v("hi");

components/homme/src/share/compose/compose_slmm_siqk.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class TestSphereToRefKernel {
7575
}
7676

7777
KOKKOS_INLINE_FUNCTION
78-
void join (volatile value_type& dst, volatile value_type const& src) const {
78+
void join (value_type& dst, value_type const& src) const {
7979
dst.max_nits = max(dst.max_nits, src.max_nits);
8080
dst.sum_nits += src.sum_nits;
8181
dst.nfails += src.nfails;

components/homme/src/share/cxx/ExecSpaceDefs.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ team_num_threads_vectors (const int num_parallel_iterations,
187187
#elif defined(KOKKOS_ENABLE_HIP)
188188
// Use 64 wavefronts per CU and 120 CUs.
189189
const int num_warps_device = 120*64; // no such thing Kokkos::Impl::hip_internal_maximum_warp_count();
190-
const int num_threads_warp = Kokkos::Experimental::Impl::HIPTraits::WarpSize;
190+
const int num_threads_warp = Kokkos::Impl::HIPTraits::WarpSize;
191191
#else
192192
// I want thread-distribution rules to be unit-testable even when GPU spaces
193193
// are off. Thus, make up a GPU-like machine:

components/homme/src/share/cxx/ExecSpaceDefs.hpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,7 @@ struct DefaultThreadsDistribution {
143143
team_num_threads_vectors(const int num_parallel_iterations,
144144
const ThreadPreferences tp = ThreadPreferences()) {
145145
return Parallel::team_num_threads_vectors_from_pool(
146-
#ifdef KOKKOS_ENABLE_DEPRECATED_CODE
147-
ExecSpaceType::thread_pool_size()
148-
#else
149-
ExecSpaceType::impl_thread_pool_size()
150-
#endif
146+
ExecSpaceType().impl_thread_pool_size()
151147
, num_parallel_iterations, tp);
152148
}
153149
};

components/homme/test_execs/preqx_kokkos_ut/remap_preqx_ut.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "utilities/TestUtils.hpp"
1111

1212
#include <random>
13+
#include <iostream>
1314

1415
TEST_CASE("remap_interface", "vertical remap") {
1516

components/homme/test_execs/share_kokkos_ut/boundary_exchange_ut.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include <random>
1313
#include <iomanip>
14+
#include <iostream>
1415

1516
using namespace Homme;
1617

components/homme/test_execs/share_kokkos_ut/col_ops_ut.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
#include <catch2/catch.hpp>
22

3-
#include <random>
4-
53
#include "ColumnOps.hpp"
6-
#include "Types.hpp"
74

85
#include "utilities/TestUtils.hpp"
96
#include "utilities/SubviewUtils.hpp"
107
#include "utilities/SyncUtils.hpp"
118
#include "utilities/ViewUtils.hpp"
129

10+
#include "Types.hpp"
11+
12+
#include <random>
13+
#include <iostream>
14+
1315
using namespace Homme;
1416

1517

components/homme/test_execs/share_kokkos_ut/ppm_remap_ut.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "utilities/TestUtils.hpp"
99

1010
#include <random>
11+
#include <iostream>
1112

1213
using namespace Homme;
1314

components/homme/test_execs/share_kokkos_ut/sphere_op_ml.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <assert.h>
1414
#include <stdio.h>
1515
#include <random>
16+
#include <iostream>
1617

1718
using namespace Homme;
1819

components/homme/test_execs/share_kokkos_ut/sphere_op_sl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <assert.h>
1414
#include <stdio.h>
1515
#include <random>
16+
#include <iostream>
1617

1718
using namespace Homme;
1819

components/homme/test_execs/thetal_kokkos_ut/elem_ops_ut.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
#include <catch2/catch.hpp>
22

3-
#include <random>
4-
53
#include "ElementOps.hpp"
6-
#include "Types.hpp"
74

85
#include "utilities/TestUtils.hpp"
96
#include "utilities/SubviewUtils.hpp"
107
#include "utilities/SyncUtils.hpp"
118
#include "utilities/ViewUtils.hpp"
9+
#include "Types.hpp"
10+
11+
#include <iostream>
12+
#include <random>
1213

1314
using namespace Homme;
1415

0 commit comments

Comments
 (0)