Skip to content

Commit 6920f5e

Browse files
authored
Merge branch 'mahf708/ig/standalone-ghci-oci' (PR #6637)
Adds support for running eamxx standalone testing in the gh/ci containers, for now only single-precision tests due to a mix of issues. Addresses two issues that have already been fixed in the scream fork. Adds flexibility to build cprnc in eamxx. [BFB]
2 parents 169448a + b33da8c commit 6920f5e

File tree

7 files changed

+113
-29
lines changed

7 files changed

+113
-29
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: gh-standalone
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
paths:
7+
# first, yes to these
8+
- '.github/workflows/eamxx-gh-ci-standalone.yml'
9+
- 'cime_config/machine/config_machines.xml'
10+
- 'components/eamxx/**'
11+
- 'components/homme/**'
12+
# second, no to these
13+
- '!components/eamxx/docs/**'
14+
- '!components/eamxx/mkdocs.yml'
15+
16+
workflow_dispatch:
17+
18+
jobs:
19+
20+
ci:
21+
runs-on: ubuntu-latest
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
test:
26+
- sp
27+
- opt
28+
- dbg
29+
- fpe
30+
container:
31+
image: ghcr.io/e3sm-project/containers-standalone-ghci:standalone-ghci-0.1.0
32+
33+
steps:
34+
-
35+
name: Checkout
36+
uses: actions/checkout@v4
37+
with:
38+
show-progress: false
39+
submodules: recursive
40+
-
41+
name: standalone
42+
env:
43+
SHELL: sh
44+
run: |
45+
# TODO: get rid of this extra line if we can?
46+
git config --global safe.directory '*'
47+
./components/eamxx/scripts/test-all-scream -m ghci-oci -t ${{ matrix.test }}
48+
-
49+
name: Artifacts
50+
uses: actions/upload-artifact@v4
51+
if: ${{ always() }}
52+
with:
53+
name: ${{ matrix.test }}
54+
path: |
55+
components/eamxx/ctest-build/*/Testing/Temporary/Last*.log

.gitmodules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
branch = scorpio_classic
2323
[submodule "cosp2"]
2424
path = components/eam/src/physics/cosp2/external
25-
url = [email protected]:CFMIP/COSPv2.0.git
26-
branch = CESM_v2.1.4
25+
url = [email protected]:bartgol/COSPv2.0.git
26+
branch = bartgol/fix-cosp_optical_inputs
2727
[submodule "cime"]
2828
path = cime
2929
url = [email protected]:ESMCI/cime.git

components/eamxx/cmake/BuildCprnc.cmake

Lines changed: 37 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,44 @@
88
include (EkatUtils)
99
macro(BuildCprnc)
1010

11-
# Make sure this is built only once
12-
if (NOT TARGET cprnc)
13-
if (SCREAM_CIME_BUILD)
14-
string (CONCAT MSG
15-
"WARNING! By default, scream should not build tests in a CIME build,\n"
16-
"and cprnc should only be built by scream in case tests are enabled.\n"
17-
"If you explicitly requested tests to be on in a CIME build,\n"
18-
"then you can discard this warning. Otherwise, please, contact developers.\n")
19-
message("${MSG}")
20-
endif()
21-
set(BLDROOT ${PROJECT_BINARY_DIR}/externals/cprnc)
22-
file(WRITE ${BLDROOT}/Macros.cmake
23-
"
24-
set(SCC ${CMAKE_C_COMPILER})
25-
set(SFC ${CMAKE_Fortran_COMPILER})
26-
set(FFLAGS \"${CMAKE_Fortran_FLAGS}\")
27-
set(NETCDF_PATH ${NetCDF_Fortran_PATH})
28-
"
29-
)
30-
set(SRC_ROOT ${SCREAM_BASE_DIR}/../..)
31-
add_subdirectory(${SRC_ROOT}/cime/CIME/non_py/cprnc ${BLDROOT})
32-
EkatDisableAllWarning(cprnc)
33-
34-
set(CPRNC_BINARY ${BLDROOT}/cprnc CACHE INTERNAL "")
35-
11+
# TODO: handle this more carefully and more gracefully in the future
12+
# TODO: For now, it is just a hack to get going...
13+
# find cprnc defined in machine entries
14+
set(CCSM_CPRNC $ENV{CCSM_CPRNC})
15+
if(EXISTS "${CCSM_CPRNC}")
16+
message(STATUS "Path ${CCSM_CPRNC} exists, so we will use it")
17+
set(CPRNC_BINARY ${CCSM_CPRNC} CACHE INTERNAL "")
3618
configure_file (${SCREAM_BASE_DIR}/cmake/CprncTest.cmake.in
3719
${CMAKE_BINARY_DIR}/bin/CprncTest.cmake @ONLY)
20+
else()
21+
message(WARNING "Path ${CCSM_CPRNC} does not exist, so we will try to build it")
22+
# Make sure this is built only once
23+
if (NOT TARGET cprnc)
24+
if (SCREAM_CIME_BUILD)
25+
string (CONCAT MSG
26+
"WARNING! By default, scream should not build tests in a CIME build,\n"
27+
"and cprnc should only be built by scream in case tests are enabled.\n"
28+
"If you explicitly requested tests to be on in a CIME build,\n"
29+
"then you can discard this warning. Otherwise, please, contact developers.\n")
30+
message("${MSG}")
31+
endif()
32+
set(BLDROOT ${PROJECT_BINARY_DIR}/externals/cprnc)
33+
file(WRITE ${BLDROOT}/Macros.cmake
34+
"
35+
set(SCC ${CMAKE_C_COMPILER})
36+
set(SFC ${CMAKE_Fortran_COMPILER})
37+
set(FFLAGS \"${CMAKE_Fortran_FLAGS}\")
38+
set(NETCDF_PATH ${NetCDF_Fortran_PATH})
39+
"
40+
)
41+
set(SRC_ROOT ${SCREAM_BASE_DIR}/../..)
42+
add_subdirectory(${SRC_ROOT}/cime/CIME/non_py/cprnc ${BLDROOT})
43+
EkatDisableAllWarning(cprnc)
44+
45+
set(CPRNC_BINARY ${BLDROOT}/cprnc CACHE INTERNAL "")
46+
47+
configure_file (${SCREAM_BASE_DIR}/cmake/CprncTest.cmake.in
48+
${CMAKE_BINARY_DIR}/bin/CprncTest.cmake @ONLY)
49+
endif()
3850
endif()
3951
endmacro()
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
11
include(${CMAKE_CURRENT_LIST_DIR}/common.cmake)
22
common_setup()
3+
4+
set(CMAKE_Fortran_FLAGS "-Wno-maybe-uninitialized -Wno-unused-dummy-argument -fallow-argument-mismatch" CACHE STRING "" FORCE)
5+
set(CMAKE_CXX_FLAGS "-fvisibility-inlines-hidden -fmessage-length=0 -Wno-use-after-free -Wno-unused-variable -Wno-maybe-uninitialized" CACHE STRING "" FORCE)
6+
7+
# TODO: figure out a better way to handle this, e.g.,
8+
# TODO: --map-by ppr:1:node:pe=1 doesn't work with mpich,
9+
# TODO: but -map-by core:1:numa:hwthread=1 may work well?
10+
# TODO: this will need to be handled in EKAT at some point
11+
set(EKAT_MPI_NP_FLAG "-np" CACHE STRING "-np")
12+
13+
# TODO: hack in place to get eamxx to recognize CPRNC
14+
# TODO: See note in BuildCprnc.cmake...
15+
set(ENV{CCSM_CPRNC} "/usr/local/packages/bin/cprnc")

components/eamxx/scripts/machines_specs.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@
8282
["mpicxx","mpifort","mpicc"],
8383
"",
8484
""),
85+
"ghci-oci" : ([f"eval $({CIMEROOT}/CIME/Tools/get_case_env -c SMS.ne4pg2_ne4pg2.F2010-SCREAMv1.ghci-oci_gnu)"],
86+
["mpicxx","mpifort","mpicc"],
87+
"",
88+
""),
8589
"linux-generic" : ([],["mpicxx","mpifort","mpicc"],"", ""),
8690
"linux-generic-debug" : ([],["mpicxx","mpifort","mpicc"],"", ""),
8791
"linux-generic-serial" : ([],["mpicxx","mpifort","mpicc"],"", ""),

components/eamxx/src/share/tests/atm_process_tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ TEST_CASE("atm_proc_dag", "") {
443443

444444
using strvec_t = std::vector<std::string>;
445445
auto params = create_test_params();
446-
auto p1 = params.sublist("BarBaz");
446+
auto& p1 = params.sublist("BarBaz");
447447

448448
// Make sure there's a missing piece (whatever Baz computes);
449449
p1.set<strvec_t>("atm_procs_list",{"Bar"});

0 commit comments

Comments
 (0)