forked from NOAA-EMC/global-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGAEAC5.env
executable file
·328 lines (247 loc) · 9.29 KB
/
GAEAC5.env
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
#! /usr/bin/env bash
if [[ $# -ne 1 ]]; then
echo "Must specify an input argument to set runtime environment variables!"
exit 1
fi
step=$1
export launcher="srun -l --export=ALL"
export mpmd_opt="--multi-prog --output=mpmd.%j.%t.out"
export OMP_STACKSIZE=2048000
export NTHSTACK=1024000000
ulimit -s unlimited
ulimit -a
# Calculate common variables
# Check first if the dependent variables are set
if [[ -n "${ntasks:-}" && -n "${max_tasks_per_node:-}" && -n "${tasks_per_node:-}" ]]; then
max_threads_per_task=$((max_tasks_per_node / tasks_per_node))
NTHREADSmax=${threads_per_task:-${max_threads_per_task}}
NTHREADS1=${threads_per_task:-1}
if [[ ${NTHREADSmax} -gt ${max_threads_per_task} ]]; then
NTHREADSmax=${max_threads_per_task}
fi
if [[ ${NTHREADS1} -gt ${max_threads_per_task} ]]; then
NTHREADS1=${max_threads_per_task}
fi
# This may be useful when GaeaC5 is fully ported, so ignore SC warning
# shellcheck disable=SC2034
APRUN_default="${launcher} -n ${ntasks}"
else
echo "ERROR config.resources must be sourced before sourcing GAEAC5.env"
exit 2
fi
case ${step} in
"prep" | "prepbufr")
export POE="NO"
export BACK=${BACK:-"YES"}
export sys_tp="GAEAC5"
export launcher_PREP="srun"
;;
"prep_emissions")
export APRUN="${APRUN_default}"
;;
"waveinit" | "waveprep" | "wavepostsbs" | "wavepostbndpnt" | "wavepostpnt" | "wavepostbndpntbll")
export CFP_MP="YES"
if [[ "${step}" = "waveprep" ]]; then
export MP_PULSE=0
fi
export wavempexec=${launcher}
export wave_mpmd=${mpmd_opt}
;;
"atmanlvar")
export NTHREADS_ATMANLVAR=${NTHREADSmax}
export APRUN_ATMANLVAR="${APRUN_default} --cpus-per-task=${NTHREADS_ATMANLVAR}"
;;
"atmanlfv3inc")
export NTHREADS_ATMANLFV3INC=${NTHREADSmax}
export APRUN_ATMANLFV3INC="${APRUN_default} --cpus-per-task=${NTHREADS_ATMANLFV3INC}"
;;
"atmensanlobs")
export NTHREADS_ATMENSANLOBS=${NTHREADSmax}
export APRUN_ATMENSANLOBS="${APRUN_default} --cpus-per-task=${NTHREADS_ATMENSANLOBS}"
;;
"atmensanlsol")
export NTHREADS_ATMENSANLSOL=${NTHREADSmax}
export APRUN_ATMENSANLSOL="${APRUN_default} --cpus-per-task=${NTHREADS_ATMENSANLSOL}"
;;
"atmensanlletkf")
export NTHREADS_ATMENSANLLETKF=${NTHREADSmax}
export APRUN_ATMENSANLLETKF="${APRUN_default} --cpus-per-task=${NTHREADS_ATMENSANLLETKF}"
;;
"atmensanlfv3inc")
export NTHREADS_ATMENSANLFV3INC=${NTHREADSmax}
export APRUN_ATMENSANLFV3INC="${APRUN_default} --cpus-per-task=${NTHREADS_ATMENSANLFV3INC}"
;;
"aeroanlvar")
export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}"
export NTHREADS_AEROANL=${NTHREADSmax}
export APRUN_AEROANL="${APRUN_default} --cpus-per-task=${NTHREADS_AEROANL}"
;;
"aeroanlgenb")
export NTHREADS_AEROANLGENB=${NTHREADSmax}
export APRUN_AEROANLGENB="${APRUN_default} --cpus-per-task=${NTHREADS_AEROANLGENB}"
;;
"prepobsaero")
export NTHREADS_PREPOBSAERO=${NTHREADS1}
export APRUN_PREPOBSAERO="${APRUN_default} --cpus-per-task=${NTHREADS_PREPOBSAERO}"
;;
"snowanl")
export APRUN_CALCFIMS="${launcher} -n 1"
export NTHREADS_SNOWANL=${NTHREADSmax}
export APRUN_SNOWANL="${APRUN_default} --cpus-per-task=${NTHREADS_SNOWANL}"
export APRUN_APPLY_INCR="${launcher} -n 6"
;;
"esnowrecen")
export NTHREADS_ESNOWRECEN=${NTHREADSmax}
export APRUN_ESNOWRECEN="${APRUN_default} --cpus-per-task=${NTHREADS_ESNOWRECEN}"
export APRUN_APPLY_INCR="${launcher} -n 6"
;;
"marinebmat")
export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}"
export APRUN_MARINEBMAT="${APRUN_default}"
;;
"marineanlvar")
export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}"
export APRUN_MARINEANLVAR="${APRUN_default}"
;;
"ocnanalecen")
export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}"
max_threads_per_task=$((max_tasks_per_node / tasks_per_node_ocnanalecen))
export NTHREADS_OCNANALECEN=${threads_per_task_ocnanalecen:-${max_threads_per_task}}
if [[ ${NTHREADS_OCNANALECEN} -gt ${max_threads_per_task} ]]; then
export NTHREADS_OCNANALECEN=${max_threads_per_task}
fi
export APRUN_OCNANALECEN="${launcher} -n ${ntasks_ocnanalecen} --cpus-per-task=${NTHREADS_OCNANALECEN}"
;;
"marineanlchkpt")
export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}"
export NTHREADS_OCNANAL=${NTHREADSmax}
export APRUN_MARINEANLCHKPT="${APRUN_default} --cpus-per-task=${NTHREADS_OCNANAL}"
;;
"anal" | "analcalc")
export MKL_NUM_THREADS=4
export MKL_CBWR=AUTO
export CFP_MP=${CFP_MP:-"YES"}
export USE_CFP=${USE_CFP:-"YES"}
export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}"
export NTHREADS_GSI=${threads_per_task_anal:-${max_threads_per_task}}
export APRUN_GSI="${APRUN_default} --cpus-per-task=${NTHREADS_GSI}"
export NTHREADS_CALCINC=${threads_per_task_calcinc:-1}
if [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]]; then
export NTHREADS_CALCINC=${max_threads_per_task}
fi
export APRUN_CALCINC="${launcher} \$ncmd --cpus-per-task=${NTHREADS_CALCINC}"
export NTHREADS_CYCLE=${threads_per_task_cycle:-12}
if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then
export NTHREADS_CYCLE=${max_tasks_per_node}
fi
ntasks_cycle=${ntiles:-6}
export APRUN_CYCLE="${launcher} -n ${ntasks_cycle} --cpus-per-task=${NTHREADS_CYCLE}"
export NTHREADS_GAUSFCANL=1
ntasks_gausfcanl=${ntasks_gausfcanl:-1}
export APRUN_GAUSFCANL="${launcher} -n ${ntasks_gausfcanl} --cpus-per-task=${NTHREADS_GAUSFCANL}"
;;
"sfcanl")
export NTHREADS_CYCLE=${threads_per_task:-14}
if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then
export NTHREADS_CYCLE=${max_tasks_per_node}
fi
export APRUN_CYCLE="${APRUN_default} --cpus-per-task=${NTHREADS_CYCLE}"
# REGRID requires multiple of 6 tasks
ntdiv6=$((ntasks/6))
ntasks_regrid=$((ntdiv6*6))
if [[ ${ntasks_regrid} -gt 36 ]]; then
ntasks_regrid=36
fi
export APRUN_REGRID="${launcher} -n ${ntasks_regrid} "
;;
"eobs")
export MKL_NUM_THREADS=4
export MKL_CBWR=AUTO
export CFP_MP=${CFP_MP:-"YES"}
export USE_CFP=${USE_CFP:-"YES"}
export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}"
export NTHREADS_GSI=${NTHREADSmax}
if [[ ${NTHREADS_GSI} -gt ${max_threads_per_task} ]]; then
export NTHREADS_GSI=${max_threads_per_task}
fi
export APRUN_GSI="${APRUN_default} --cpus-per-task=${NTHREADS_GSI}"
;;
"eupd")
export CFP_MP=${CFP_MP:-"YES"}
export USE_CFP=${USE_CFP:-"YES"}
export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}"
export NTHREADS_ENKF=${NTHREADSmax}
export APRUN_ENKF="${launcher} -n ${ntasks_enkf:-${ntasks}} --cpus-per-task=${NTHREADS_ENKF}"
;;
"fcst" | "efcs")
export OMP_STACKSIZE=512M
(( nnodes = (ntasks+tasks_per_node-1)/tasks_per_node ))
(( ufs_ntasks = nnodes*tasks_per_node ))
# With ESMF threading, the model wants to use the full node
export APRUN_UFS="${launcher} -n ${ufs_ntasks}"
unset nnodes ufs_ntasks
;;
"upp")
export NTHREADS_UPP=${NTHREADS1}
export APRUN_UPP="${APRUN_default} --cpus-per-task=${NTHREADS_UPP}"
;;
"atmos_products")
export USE_CFP="YES" # Use MPMD for downstream product generation
;;
"oceanice_products")
export NTHREADS_OCNICEPOST=${NTHREADS1}
export APRUN_OCNICEPOST="${launcher} -n 1 --cpus-per-task=${NTHREADS_OCNICEPOST}"
;;
"ecen")
export NTHREADS_ECEN=${NTHREADSmax}
export APRUN_ECEN="${APRUN_default} --cpus-per-task=${NTHREADS_ECEN}"
export NTHREADS_CHGRES=${threads_per_task_chgres:-12}
if [[ ${NTHREADS_CHGRES} -gt ${max_tasks_per_node} ]]; then
export NTHREADS_CHGRES=${max_tasks_per_node}
fi
export APRUN_CHGRES="time"
export NTHREADS_CALCINC=${threads_per_task_calcinc:-1}
if [[ ${NTHREADS_CALCINC} -gt ${max_threads_per_task} ]]; then
export NTHREADS_CALCINC=${max_threads_per_task}
fi
export APRUN_CALCINC="${APRUN_default} --cpus-per-task=${NTHREADS_CALCINC}"
;;
"esfc")
export NTHREADS_ESFC=${NTHREADSmax}
export APRUN_ESFC="${APRUN_default} --cpus-per-task=${NTHREADS_ESFC}"
export NTHREADS_CYCLE=${threads_per_task_cycle:-14}
if [[ ${NTHREADS_CYCLE} -gt ${max_tasks_per_node} ]]; then
export NTHREADS_CYCLE=${max_tasks_per_node}
fi
export APRUN_CYCLE="${APRUN_default} --cpus-per-task=${NTHREADS_CYCLE}"
;;
"epos")
export NTHREADS_EPOS=${NTHREADSmax}
export APRUN_EPOS="${APRUN_default} --cpus-per-task=${NTHREADS_EPOS}"
;;
"postsnd")
export CFP_MP="YES"
export NTHREADS_POSTSND=${NTHREADS1}
export APRUN_POSTSND="${APRUN_default} --cpus-per-task=${NTHREADS_POSTSND}"
export NTHREADS_POSTSNDCFP=${threads_per_task_postsndcfp:-1}
if [[ ${NTHREADS_POSTSNDCFP} -gt ${max_threads_per_task} ]]; then
export NTHREADS_POSTSNDCFP=${max_threads_per_task}
fi
export APRUN_POSTSNDCFP="${launcher} -n ${ntasks_postsndcfp} ${mpmd_opt}"
;;
"awips")
export NTHREADS_AWIPS=${NTHREADS1}
export APRUN_AWIPSCFP="${APRUN_default} ${mpmd_opt}"
;;
"gempak")
echo "WARNING: ${step} is not enabled on ${machine}!"
;;
"fit2obs")
export NTHREADS_FIT2OBS=${NTHREADS1}
export MPIRUN="${APRUN_default} --cpus-per-task=${NTHREADS_FIT2OBS}"
;;
*)
# Some other job not yet defined here
echo "WARNING: The job step ${step} does not specify GAEAC5-specific resources"
;;
esac