forked from NOAA-EMC/global-workflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathS4.env
executable file
·274 lines (177 loc) · 8.97 KB
/
S4.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
#! /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"
# Configure MPI environment
export OMP_STACKSIZE=2048000
export NTHSTACK=1024000000
ulimit -s unlimited
ulimit -a
if [[ "${step}" = "prep" ]] || [[ "${step}" = "prepbufr" ]]; then
nth_max=$((npe_node_max / npe_node_prep))
export POE="NO"
export BACK="NO"
export sys_tp="S4"
export launcher_PREP="srun"
elif [[ "${step}" = "prepsnowobs" ]]; then
export APRUN_CALCFIMS="${launcher} -n 1"
elif [[ "${step}" = "prep_emissions" ]]; then
export APRUN="${launcher} -n 1"
elif [[ "${step}" = "waveinit" ]] || [[ "${step}" = "waveprep" ]] || [[ "${step}" = "wavepostsbs" ]] || [[ "${step}" = "wavepostbndpnt" ]] || [[ "${step}" = "wavepostbndpntbll" ]] || [[ "${step}" = "wavepostpnt" ]]; then
export CFP_MP="YES"
if [[ "${step}" = "waveprep" ]]; then export MP_PULSE=0 ; fi
export wavempexec=${launcher}
export wave_mpmd=${mpmd_opt}
elif [[ "${step}" = "atmanlvar" ]]; then
nth_max=$((npe_node_max / npe_node_atmanlvar))
export NTHREADS_ATMANLVAR=${nth_atmanlvar:-${nth_max}}
[[ ${NTHREADS_ATMANLVAR} -gt ${nth_max} ]] && export NTHREADS_ATMANLVAR=${nth_max}
export APRUN_ATMANLVAR="${launcher} -n ${npe_atmanlvar}"
elif [[ "${step}" = "atmensanlletkf" ]]; then
nth_max=$((npe_node_max / npe_node_atmensanlletkf))
export NTHREADS_ATMENSANLLETKF=${nth_atmensanlletkf:-${nth_max}}
[[ ${NTHREADS_ATMENSANLLETKF} -gt ${nth_max} ]] && export NTHREADS_ATMENSANLLETKF=${nth_max}
export APRUN_ATMENSANLLETKF="${launcher} -n ${npe_atmensanlletkf}"
elif [[ "${step}" = "atmensanlfv3inc" ]]; then
nth_max=$((npe_node_max / npe_node_atmensanlfv3inc))
export NTHREADS_ATMENSANLFV3INC=${nth_atmensanlfv3inc:-${nth_max}}
[[ ${NTHREADS_ATMENSANLFV3INC} -gt ${nth_max} ]] && export NTHREADS_ATMENSANLFV3INC=${nth_max}
export APRUN_ATMENSANLFV3INC="${launcher} -n ${npe_atmensanlfv3inc}"
elif [[ "${step}" = "aeroanlrun" ]]; then
export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}"
nth_max=$((npe_node_max / npe_node_aeroanlrun))
export NTHREADS_AEROANL=${nth_aeroanlrun:-${nth_max}}
[[ ${NTHREADS_AEROANL} -gt ${nth_max} ]] && export NTHREADS_AEROANL=${nth_max}
export APRUN_AEROANL="${launcher} -n ${npe_aeroanlrun}"
elif [[ "${step}" = "prepobsaero" ]]; then
nth_max=$((npe_node_max / npe_node_prepobsaero))
export NTHREADS_PREPOBSAERO=${nth_prepobsaero:-1}
export APRUN_PREPOBSAERO="${launcher} -n ${npe_prepobsaero} --cpus-per-task=${NTHREADS_PREPOBSAERO}"
elif [[ "${step}" = "snowanl" ]]; then
nth_max=$((npe_node_max / npe_node_snowanl))
export NTHREADS_SNOWANL=${nth_snowanl:-${nth_max}}
[[ ${NTHREADS_SNOWANL} -gt ${nth_max} ]] && export NTHREADS_SNOWANL=${nth_max}
export APRUN_SNOWANL="${launcher} -n ${npe_snowanl}"
export APRUN_APPLY_INCR="${launcher} -n 6"
elif [[ "${step}" = "atmanlfv3inc" ]]; then
nth_max=$((npe_node_max / npe_node_atmanlfv3inc))
export NTHREADS_ATMANLFV3INC=${nth_atmanlfv3inc:-${nth_max}}
[[ ${NTHREADS_ATMANLFV3INC} -gt ${nth_max} ]] && export NTHREADS_ATMANLFV3INC=${nth_max}
export APRUN_ATMANLFV3INC="${launcher} -n ${npe_atmanlfv3inc}"
elif [[ "${step}" = "ocnanalbmat" ]]; then
echo "WARNING: ${step} is not enabled on S4!"
elif [[ "${step}" = "ocnanalrun" ]]; then
echo "WARNING: ${step} is not enabled on S4!"
elif [[ "${step}" = "anal" ]] || [[ "${step}" = "analcalc" ]]; then
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}"
nth_max=$((npe_node_max / npe_node_anal))
export NTHREADS_GSI=${nth_anal:-${nth_max}}
[[ ${NTHREADS_GSI} -gt ${nth_max} ]] && export NTHREADS_GSI=${nth_max}
export APRUN_GSI="${launcher} -n ${npe_gsi:-${npe_anal}}"
export NTHREADS_CALCINC=${nth_calcinc:-1}
[[ ${NTHREADS_CALCINC} -gt ${nth_max} ]] && export NTHREADS_CALCINC=${nth_max}
export APRUN_CALCINC="${launcher} \$ncmd"
export NTHREADS_CYCLE=${nth_cycle:-12}
[[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max}
npe_cycle=${ntiles:-6}
export APRUN_CYCLE="${launcher} -n ${npe_cycle}"
export NTHREADS_GAUSFCANL=1
npe_gausfcanl=${npe_gausfcanl:-1}
export APRUN_GAUSFCANL="${launcher} -n ${npe_gausfcanl}"
elif [[ "${step}" = "sfcanl" ]]; then
nth_max=$((npe_node_max / npe_node_sfcanl))
export NTHREADS_CYCLE=${nth_sfcanl:-14}
[[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max}
npe_sfcanl=${ntiles:-6}
export APRUN_CYCLE="${launcher} -n ${npe_sfcanl}"
elif [[ "${step}" = "eobs" ]]; then
export MKL_NUM_THREADS=4
export MKL_CBWR=AUTO
nth_max=$((npe_node_max / npe_node_eobs))
export NTHREADS_GSI=${nth_eobs:-${nth_max}}
[[ ${NTHREADS_GSI} -gt ${nth_max} ]] && export NTHREADS_GSI=${nth_max}
export APRUN_GSI="${launcher} -n ${npe_gsi:-${npe_eobs}}"
export CFP_MP=${CFP_MP:-"YES"}
export USE_CFP=${USE_CFP:-"YES"}
export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}"
elif [[ "${step}" = "eupd" ]]; then
nth_max=$((npe_node_max / npe_node_eupd))
export NTHREADS_ENKF=${nth_eupd:-${nth_max}}
[[ ${NTHREADS_ENKF} -gt ${nth_max} ]] && export NTHREADS_ENKF=${nth_max}
export APRUN_ENKF="${launcher} -n ${npe_enkf:-${npe_eupd}}"
export CFP_MP=${CFP_MP:-"YES"}
export USE_CFP=${USE_CFP:-"YES"}
export APRUNCFP="${launcher} -n \$ncmd ${mpmd_opt}"
elif [[ "${step}" = "fcst" ]] || [[ "${step}" = "efcs" ]]; then
ppn="npe_node_${step}_${RUN}"
[[ -z "${!ppn+0}" ]] && ppn="npe_node_${step}"
nprocs="npe_${step}_${RUN}"
[[ -z ${!nprocs+0} ]] && nprocs="npe_${step}"
(( nnodes = (${!nprocs}+${!ppn}-1)/${!ppn} ))
(( ntasks = nnodes*${!ppn} ))
# With ESMF threading, the model wants to use the full node
export APRUN_UFS="${launcher} -n ${ntasks}"
unset nprocs ppn nnodes ntasks
elif [[ "${step}" = "upp" ]]; then
nth_max=$((npe_node_max / npe_node_upp))
export NTHREADS_UPP=${nth_upp:-1}
[[ ${NTHREADS_UPP} -gt ${nth_max} ]] && export NTHREADS_UPP=${nth_max}
export OMP_NUM_THREADS="${NTHREADS_UPP}"
export APRUN_UPP="${launcher} -n ${npe_upp}"
elif [[ "${step}" = "atmos_products" ]]; then
export USE_CFP="YES" # Use MPMD for downstream product generation
elif [[ "${step}" = "oceanice_products" ]]; then
nth_max=$((npe_node_max / npe_node_oceanice_products))
export NTHREADS_OCNICEPOST=${nth_oceanice_products:-1}
export APRUN_OCNICEPOST="${launcher} -n 1 --cpus-per-task=${NTHREADS_OCNICEPOST}"
elif [[ "${step}" = "ecen" ]]; then
nth_max=$((npe_node_max / npe_node_ecen))
export NTHREADS_ECEN=${nth_ecen:-${nth_max}}
[[ ${NTHREADS_ECEN} -gt ${nth_max} ]] && export NTHREADS_ECEN=${nth_max}
export APRUN_ECEN="${launcher} -n ${npe_ecen}"
export NTHREADS_CHGRES=${nth_chgres:-12}
[[ ${NTHREADS_CHGRES} -gt ${npe_node_max} ]] && export NTHREADS_CHGRES=${npe_node_max}
export APRUN_CHGRES="time"
export NTHREADS_CALCINC=${nth_calcinc:-1}
[[ ${NTHREADS_CALCINC} -gt ${nth_max} ]] && export NTHREADS_CALCINC=${nth_max}
export APRUN_CALCINC="${launcher} -n ${npe_ecen}"
elif [[ "${step}" = "esfc" ]]; then
nth_max=$((npe_node_max / npe_node_esfc))
export NTHREADS_ESFC=${nth_esfc:-${nth_max}}
[[ ${NTHREADS_ESFC} -gt ${nth_max} ]] && export NTHREADS_ESFC=${nth_max}
export APRUN_ESFC="${launcher} -n ${npe_esfc}"
export NTHREADS_CYCLE=${nth_cycle:-14}
[[ ${NTHREADS_CYCLE} -gt ${npe_node_max} ]] && export NTHREADS_CYCLE=${npe_node_max}
export APRUN_CYCLE="${launcher} -n ${npe_esfc}"
elif [[ "${step}" = "epos" ]]; then
nth_max=$((npe_node_max / npe_node_epos))
export NTHREADS_EPOS=${nth_epos:-${nth_max}}
[[ ${NTHREADS_EPOS} -gt ${nth_max} ]] && export NTHREADS_EPOS=${nth_max}
export APRUN_EPOS="${launcher} -n ${npe_epos}"
elif [[ "${step}" = "postsnd" ]]; then
export CFP_MP="YES"
nth_max=$((npe_node_max / npe_node_postsnd))
export NTHREADS_POSTSND=${nth_postsnd:-1}
[[ ${NTHREADS_POSTSND} -gt ${nth_max} ]] && export NTHREADS_POSTSND=${nth_max}
export APRUN_POSTSND="${launcher} -n ${npe_postsnd}"
export NTHREADS_POSTSNDCFP=${nth_postsndcfp:-1}
[[ ${NTHREADS_POSTSNDCFP} -gt ${nth_max} ]] && export NTHREADS_POSTSNDCFP=${nth_max}
export APRUN_POSTSNDCFP="${launcher} -n ${npe_postsndcfp} ${mpmd_opt}"
elif [[ "${step}" = "awips" ]]; then
echo "WARNING: ${step} is not enabled on S4!"
elif [[ "${step}" = "gempak" ]]; then
echo "WARNING: ${step} is not enabled on S4!"
elif [[ "${step}" = "fit2obs" ]]; then
nth_max=$((npe_node_max / npe_node_fit2obs))
export NTHREADS_FIT2OBS=${nth_fit2obs:-1}
[[ ${NTHREADS_FIT2OBS} -gt ${nth_max} ]] && export NTHREADS_FIT2OBS=${nth_max}
export MPIRUN="${launcher} -n ${npe_fit2obs}"
fi