Skip to content

Commit 42567ee

Browse files
authored
Merge pull request #136 from GEOS-ESM/develop
Merge develop into main for release
2 parents a044536 + 162c215 commit 42567ee

File tree

2 files changed

+153
-52
lines changed

2 files changed

+153
-52
lines changed

.circleci/config.yml

Lines changed: 150 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2.1
22

33
executors:
4-
gcc-build-env:
4+
gfortran:
55
docker:
66
- image: gmao/ubuntu20-geos-env-mkl:v6.2.7-openmpi_4.0.6-gcc_11.2.0
77
auth:
@@ -11,73 +11,170 @@ executors:
1111
OMPI_ALLOW_RUN_AS_ROOT: 1
1212
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
1313
OMPI_MCA_btl_vader_single_copy_mechanism: none
14+
MPIEXEC_PREFLAGS: --oversubscribe
15+
resource_class: large
16+
#MEDIUM# resource_class: medium
17+
18+
ifort:
19+
docker:
20+
- image: gmao/ubuntu20-geos-env:v6.2.7-intelmpi_2021.2.0-intel_2021.2.0
21+
auth:
22+
username: $DOCKERHUB_USER
23+
password: $DOCKERHUB_AUTH_TOKEN
1424
resource_class: large
1525
#MEDIUM# resource_class: medium
1626

1727
workflows:
18-
version: 2.1
19-
build-and-test:
28+
build-test:
2029
jobs:
2130
- build-GEOSgcm:
31+
name: build-GEOSgcm-on-<< matrix.compiler >>
32+
matrix:
33+
parameters:
34+
compiler: [gfortran, ifort]
2235
context:
2336
- docker-hub-creds
24-
- make-FV3-experiment:
25-
context:
37+
- make-FV3-exp:
38+
name: make-FV3-exp-on-<< matrix.compiler >>
39+
matrix:
40+
parameters:
41+
compiler: [gfortran, ifort]
42+
context:
2643
- docker-hub-creds
2744
requires:
28-
- build-GEOSgcm
29-
- run-FV3-standalone:
30-
context:
45+
- build-GEOSgcm-on-<< matrix.compiler >>
46+
- run-FV3:
47+
name: run-FV3-on-<< matrix.compiler >>
48+
matrix:
49+
parameters:
50+
compiler: [gfortran, ifort]
51+
context:
3152
- docker-hub-creds
3253
requires:
33-
- make-FV3-experiment
54+
- make-FV3-exp-on-<< matrix.compiler >>
55+
56+
57+
58+
commands:
59+
versions:
60+
description: "Versions, etc."
61+
parameters:
62+
compiler:
63+
type: string
64+
steps:
65+
- run: mpirun --version && << parameters.compiler >> --version && echo $BASEDIR && pwd && ls && echo "$(nproc)"
66+
67+
checkout_fixture:
68+
description: "Checkout fixture"
69+
parameters:
70+
repo:
71+
type: string
72+
steps:
73+
- run: |
74+
cd ${CIRCLE_WORKING_DIRECTORY}
75+
git clone https://github.com/GEOS-ESM/<< parameters.repo >>.git
76+
77+
mepoclone:
78+
description: "Mepo clone external repos"
79+
parameters:
80+
repo:
81+
type: string
82+
steps:
83+
- run: |
84+
cd ${CIRCLE_WORKING_DIRECTORY}/<< parameters.repo >>
85+
mepo clone
86+
mepo status
87+
88+
mepodevelop:
89+
description: "Mepo develop GEOSgcm_GridComp GEOSgcm_App GMAO_Shared"
90+
parameters:
91+
repo:
92+
type: string
93+
steps:
94+
- run: |
95+
cd ${CIRCLE_WORKING_DIRECTORY}/<< parameters.repo >>
96+
mepo develop GEOSgcm_GridComp GEOSgcm_App GMAO_Shared
97+
mepo status
98+
99+
checkout_feature_branch:
100+
description: "Mepo checkout-if-exists feature branch"
101+
parameters:
102+
repo:
103+
type: string
104+
steps:
105+
- run: |
106+
cd ${CIRCLE_WORKING_DIRECTORY}/<< parameters.repo >>
107+
echo "${CIRCLE_BRANCH}"
108+
if [ "${CIRCLE_BRANCH}" != "develop" ] && [ "${CIRCLE_BRANCH}" != "main" ]
109+
then
110+
mepo checkout-if-exists ${CIRCLE_BRANCH}
111+
fi
112+
mepo status
113+
114+
cmake:
115+
description: "Run CMake"
116+
parameters:
117+
repo:
118+
type: string
119+
compiler:
120+
type: string
121+
steps:
122+
- run: |
123+
mkdir -p /logfiles
124+
cd ${CIRCLE_WORKING_DIRECTORY}/<< parameters.repo >>
125+
mkdir -p ${CIRCLE_WORKING_DIRECTORY}/workspace/build-<< parameters.repo >>
126+
cd ${CIRCLE_WORKING_DIRECTORY}/workspace/build-<< parameters.repo >>
127+
cmake ${CIRCLE_WORKING_DIRECTORY}/<< parameters.repo >> -DBASEDIR=$BASEDIR/Linux -DCMAKE_Fortran_COMPILER=<< parameters.compiler >> -DCMAKE_BUILD_TYPE=Debug -DUSE_F2PY=OFF -DMPIEXEC_PREFLAGS=${MPIEXEC_PREFLAGS} -DCMAKE_INSTALL_PREFIX=${CIRCLE_WORKING_DIRECTORY}/workspace/install-<< parameters.repo >> |& tee /logfiles/cmake.log
128+
129+
buildinstall:
130+
description: "Build and install"
131+
parameters:
132+
repo:
133+
type: string
134+
steps:
135+
- run: |
136+
cd ${CIRCLE_WORKING_DIRECTORY}/workspace/build-<< parameters.repo >>
137+
make -j"$(nproc)" install |& tee /logfiles/make.log
138+
#MEDIUM# make -j4 install |& tee /logfiles/make.log
34139
35140
jobs:
36141
build-GEOSgcm:
37-
executor: gcc-build-env
142+
parameters:
143+
compiler:
144+
type: string
145+
executor: << parameters.compiler >>
38146
working_directory: /root/project
39147
steps:
40148
- run:
41-
name: "FVdycoreCubed_GridComp branch"
149+
name: "GMAO_Shared branch"
42150
command: echo ${CIRCLE_BRANCH}
43-
- run:
44-
name: "Checkout GEOSgcm fixture"
45-
command: |
46-
cd ${CIRCLE_WORKING_DIRECTORY}
47-
git clone https://github.com/GEOS-ESM/GEOSgcm.git
48-
- run:
49-
name: "Mepo clone GEOSgcm fixture and update FVdycoreCubed_GridComp branch"
50-
command: |
51-
cd ${CIRCLE_WORKING_DIRECTORY}/GEOSgcm
52-
mepo clone
53-
mepo develop GEOSgcm_GridComp GEOSgcm_App
54-
if [ "${CIRCLE_BRANCH}" != "develop" ] && [ "${CIRCLE_BRANCH}" != "master" ] && [ "${CIRCLE_BRANCH}" != "main" ]
55-
then
56-
mepo checkout-if-exists ${CIRCLE_BRANCH}
57-
fi
58-
mepo status
59-
- run:
60-
name: "CMake"
61-
command: |
62-
cd ${CIRCLE_WORKING_DIRECTORY}/GEOSgcm
63-
mkdir build
64-
cd build
65-
cmake .. -DBASEDIR=$BASEDIR/Linux -DCMAKE_Fortran_COMPILER=gfortran -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=${CIRCLE_WORKING_DIRECTORY}/workspace/install-GEOSgcm -DUSE_F2PY=OFF
66-
- run:
67-
name: "Build and install"
68-
command: |
69-
cd ${CIRCLE_WORKING_DIRECTORY}/GEOSgcm/build
70-
make -j"$(nproc)" install
71-
#MEDIUM# make -j4 install
72-
73-
# We need to persist the install for the next step
151+
- checkout_fixture:
152+
repo: GEOSgcm
153+
- versions:
154+
compiler: << parameters.compiler >>
155+
- mepoclone:
156+
repo: GEOSgcm
157+
- mepodevelop:
158+
repo: GEOSgcm
159+
- checkout_feature_branch:
160+
repo: GEOSgcm
161+
- cmake:
162+
repo: GEOSgcm
163+
compiler: << parameters.compiler >>
164+
- buildinstall:
165+
repo: GEOSgcm
166+
- store_artifacts:
167+
path: /logfiles
74168
- persist_to_workspace:
75169
root: workspace
76170
paths:
77171
- install-GEOSgcm
78172

79-
make-FV3-experiment:
80-
executor: gcc-build-env
173+
make-FV3-exp:
174+
parameters:
175+
compiler:
176+
type: string
177+
executor: << parameters.compiler >>
81178
working_directory: /root/project
82179
steps:
83180
- attach_workspace:
@@ -118,17 +215,21 @@ jobs:
118215
paths:
119216
- test-fv3-c12
120217

121-
run-FV3-standalone:
122-
executor: gcc-build-env
218+
run-FV3:
219+
parameters:
220+
compiler:
221+
type: string
222+
executor: << parameters.compiler >>
123223
working_directory: /root/project
124224
steps:
125225
- attach_workspace:
126226
at: workspace
127227
- run:
128228
name: "Run fv3.j"
129229
command: |
230+
mkdir -p /logfiles
130231
cd ${CIRCLE_WORKING_DIRECTORY}/workspace/test-fv3-c12
131-
./fv3.j
232+
./fv3.j |& tee /logfiles/fv3_run.log
132233
- run:
133234
name: "Check for EGRESS"
134235
command: |
@@ -144,9 +245,6 @@ jobs:
144245
echo "EGRESS not found!"
145246
exit 1
146247
fi
147-
- run:
148-
name: "Cat log file"
149-
command: |
150-
cd ${CIRCLE_WORKING_DIRECTORY}/workspace/test-fv3-c12
248+
- store_artifacts:
249+
path: /logfiles
151250

152-
cat *.log

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ if (CRAY_POINTER)
5656
set_target_properties (${this} PROPERTIES COMPILE_FLAGS ${CRAY_POINTER})
5757
endif()
5858

59+
# Enable OpenMP
60+
target_link_libraries(${this} PRIVATE OpenMP::OpenMP_Fortran)
61+
5962
add_definitions (-DSPMD -DMAPL_MODE)
6063

6164
foreach(flag ${tmp})

0 commit comments

Comments
 (0)