Skip to content

Commit 878c029

Browse files
committed
EAMxx: set EKAT test options if EKAT_ENABLE_TESTS=ON
Make sure we match settings of eamxx
1 parent 9707168 commit 878c029

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

components/eamxx/CMakeLists.txt

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -514,12 +514,27 @@ if (DEFINED ENV{SCREAM_FAKE_ONLY})
514514

515515
else()
516516
# Enable all EKAT packages
517-
set(EKAT_ENABLE_KOKKOS ON)
518-
set(EKAT_ENABLE_PACK ON)
519-
set(EKAT_ENABLE_ALGORITHM ON)
520-
set(EKAT_ENABLE_LOGGING ON)
521-
set(EKAT_ENABLE_YAML_PARSER ON)
517+
set(EKAT_ENABLE_ALL_PACKAGES ON)
522518
set(EKAT_DISABLE_TPL_WARNINGS ON)
519+
520+
# Disable tests by default (user can override via -D EKAT_ENABLE_TESTS=ON)
521+
set (EKAT_ENABLE_TESTS OFF)
522+
523+
# Ensure testing options are consistent with EAMxx settings (threads, ranks, packs, etc)
524+
set (EKAT_TEST_MAX_THREADS ${SCREAM_TEST_MAX_THREADS} CACHE STRING "Max number of threads for tests")
525+
set (EKAT_TEST_THREAD_INC ${SCREAM_TEST_THREAD_INC} CACHE STRING "Thread count increment for threaded tests")
526+
set (EKAT_TEST_MAX_RANKS ${SCREAM_TEST_MAX_RANKS} CACHE STRING "Max number of ranks for tests")
527+
set (EKAT_TEST_PACK_SIZE ${SCREAM_PACK_SIZE} CACHE STRING
528+
" The number of scalars in a pack::Pack and Mask. Larger packs have good performance on conditional-free loops due to improved caching.")
529+
530+
if (SCREAM_DOUBLE_PRECISION)
531+
set (EKAT_TEST_SINGLE_PRECISION OFF)
532+
set (EKAT_TEST_DOUBLE_PRECISION ON)
533+
else()
534+
set (EKAT_TEST_SINGLE_PRECISION ON)
535+
set (EKAT_TEST_DOUBLE_PRECISION OFF)
536+
endif()
537+
523538
add_subdirectory(${EKAT_SOURCE_DIR} ${CMAKE_BINARY_DIR}/externals/ekat)
524539
endif()
525540

0 commit comments

Comments
 (0)