New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
submit_bench in NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/BENCH/EXPREF – NEMO

source: NEMO/branches/2019/dev_r10984_HPC-13_IRRMANN_BDY_optimization/tests/BENCH/EXPREF/submit_bench @ 11364

Last change on this file since 11364 was 11364, checked in by smasson, 5 years ago

dev_r10984_HPC-13 : update BENCH to be more robust, see #2285

  • Property svn:executable set to *
File size: 6.4 KB
Line 
1#!/bin/bash
2
3#  BENCH launching scripts for beaufix, Meteo-France
4#                          and curie, TGCC
5#  To be modified for other machines
6#
7set -u
8#set -vx
9#
10cores=$1
11ncore_node=$2
12resolution=$3
13dateref=$4
14machine=$( hostname | sed -e "s/[0-9]*//g" )
15#
16# number of processes for each executable
17nproc_exe1=$( echo $cores | bc )
18nproc=$nproc_exe1
19nnode=$(( ( $nproc + $ncore_node - 1 )  / $ncore_node ))
20
21nproc5=$( printf "%05d\n" ${nproc_exe1} )
22
23case ${resolution} in
24    "1")
25   if [ $nproc_exe1 -lt 50 ]
26   then
27       timejob=3600
28   elif [ $nproc_exe1 -lt 100 ]
29   then
30       timejob=1800
31   elif [ $nproc_exe1 -lt 200 ]
32   then
33       timejob=900
34   else
35       timejob=600
36   fi
37   ;;
38    "025")
39   if [ $nproc_exe1 -lt 50 ]
40   then
41       timejob=15000
42   elif [ $nproc_exe1 -lt 100 ]
43   then
44       timejob=7000
45   elif [ $nproc_exe1 -lt 200 ]
46   then
47       timejob=3600
48   elif [ $nproc_exe1 -lt 400 ]
49   then
50       timejob=2000
51   elif [ $nproc_exe1 -lt 800 ]
52   then
53       timejob=1000
54   else
55       timejob=600
56   fi
57   ;;
58    "12")
59   if [ $nproc_exe1 -lt 200 ]
60   then
61       timejob=30000
62   elif [ $nproc_exe1 -lt 400 ]
63   then
64       timejob=15000
65   elif [ $nproc_exe1 -lt 800 ]
66   then
67       timejob=8000
68   elif [ $nproc_exe1 -lt 1600 ]
69   then
70       timejob=5000
71   elif [ $nproc_exe1 -lt 3200 ]
72   then
73       timejob=2500
74   else
75       timejob=1200
76   fi
77   ;;
78esac
79
80
81######################################################################
82### beaufixlogin
83######################################################################
84
85if [ "$machine" == "beaufixlogin" ]
86then
87   
88cat > Log/run_bench << EOF
89#!/bin/bash
90#SBATCH --time=00:1:00
91#SBATCH -p  normal64         # partition/queue
92#SBATCH --job-name=bench      # job name
93#SBATCH -N $nnode            # number of nodes
94#SBATCH -n $nproc            # number of procs
95#SBATCH -o /scratch/work/cglo315/ESIWACE/dev_r9759_HPC09_ESIWACE/tests/LBENCH_RN/EXP00/Log/job.out%j
96#SBATCH -e /scratch/work/cglo315/ESIWACE/dev_r9759_HPC09_ESIWACE/tests/LBENCH_RN/EXP00/Log/job.out%j
97#SBATCH --exclusive
98
99module unload intelmpi intel grib_api
100module load intel/16.1.150 intelmpi/5.1.2.150
101
102itac=0
103xpmpi=0
104
105if [ \$xpmpi == 1 ]; then
106  module load bullxde
107  module load xPMPI/1.1_intelmpi
108fi
109
110[ \$itac == 1 ] && module load itac/2017.2.028
111
112set -vx
113
114cd \${TMPDIR}
115cp /scratch/work/cglo315/ESIWACE/dev_r9759_HPC09_ESIWACE/tests/LBENCH_RN/EXP00/* .
116
117# Best decompositions BENCH-1
118jpni=${cores/\**/}
119jpnj=${cores/?*\*/}
120
121sed -e "s/jpni *=.*/jpni = \${jpni}/" -e "s/jpnj *=.*/jpnj = \${jpnj}/" namelist_cfg_orca${resolution}_like > namelist_cfg
122
123export OMP_NUM_THREADS=1
124ulimit -s unlimited
125#
126if [ \$itac == 1 ]; then
127  source /opt/softs/intel/2017/update_1/itac_latest/bin/itacvars.sh
128  time mpirun -ordered-output -prepend-rank -trace -np $nproc_exe1 ./nemo > jobout 2>joberr
129else
130  time mpirun -ordered-output -prepend-rank -np $nproc_exe1 ./nemo > jobout_${resolution}_${nproc5}
131fi
132/opt/softs/bin/ja
133
134if [ \$xpmpi == 1 ]; then
135  module unload xPMPI/1.1_intelmpi
136  module unload bullxde
137fi
138#
139EOF
140
141
142### 4. Execute the model
143
144    echo 'Submitting the job to queue using sbatch'
145    sbatch Log/run_bench
146    squeue -u cglo315
147
148echo 'is executed or submitted to queue.'
149
150
151fi
152
153######################################################################
154### curie or irene
155######################################################################
156
157if [[ ( "$machine" == "curie" ) || ( "$machine" == "irene" ) ]]
158then
159
160    [ "$machine" == "curie" ] && queuename=standard || queuename=skylake
161   
162    EXPjob=../EXP_${resolution}_${nproc5}_${dateref}
163    mkdir -p ${EXPjob}
164    cd ${EXPjob}
165    jobname=jobbench
166    cat > $jobname << EOF
167#!/bin/bash
168#MSUB -r bench${nproc5}
169#MSUB -n ${nproc_exe1}
170#MSUB -T $timejob
171#MSUB -e bench_${resolution}_${nproc5}_%I.eo
172#MSUB -o bench_${resolution}_${nproc5}_%I.eo
173#MSUB -j oe
174#MSUB -x
175#MSUB -q ${queuename}
176#MSUB -A gen6895
177#==========================================
178set -u
179#
180
181cd \${BRIDGE_MSUB_PWD}
182
183for ff in \${BRIDGE_MSUB_PWD}/../EXPREF/namelist_*cfg \${BRIDGE_MSUB_PWD}/../EXPREF/namelist_*ref \${BRIDGE_MSUB_PWD}/../BLD/bin/nemo.exe
184do
185    cp \$ff .
186done
187
188jpni=${cores/\**/}
189jpnj=${cores/?*\*/}
190
191sed -e "s/jpni *=.*/jpni = \${jpni}/" \
192    -e "s/jpnj *=.*/jpnj = \${jpnj}/"\
193    -e "s/ln_timing *= *.false./ln_timing   =  .true./" \
194     \${BRIDGE_MSUB_PWD}/../EXPREF/namelist_cfg_orca${resolution}_like > namelist_cfg
195
196time ccc_mprun -n \${BRIDGE_MSUB_NPROC} ./nemo.exe > jobout_${resolution}_${nproc5}_${dateref} 2>&1
197
198EOF
199
200    ccc_msub $jobname
201
202fi
203
204######################################################################
205### Jean-Zay
206######################################################################
207
208if [ "$machine" == "jean-zay" ]
209then
210    hh=$( printf "%02d\n" $(( ${timejob} / 3600 )) )
211    mm=$( printf "%02d\n" $(( ( ${timejob} % 3600 ) / 60 )) )
212    ss=$( printf "%02d\n" $(( ( ${timejob} % 3600 ) % 60 )) )
213
214    EXPjob=../EXP_${resolution}_${nproc5}_${dateref}
215    mkdir -p ${EXPjob}
216    cd ${EXPjob}
217    jobname=jobbench
218    cat > $jobname << EOF
219#!/bin/bash
220#SBATCH --job-name=Seq        # nom du job
221#SBATCH --partition=cpu_dev   # demande d'allocation sur la partition CPU
222#SBATCH --nodes=${nnode}             # nombre de noeuds
223#SBATCH --ntasks-per-node=${ncore_node}  # nombre de taches MPI par noeud
224#SBATCH --ntasks-per-core=1        # 1 processus MPI par coeur physique (pas d'hyperthreading)
225#SBATCH --time=${hh}:${mm}:${ss}       # temps d execution maximum demande (HH:MM:SS)
226#SBATCH --output=bench_${resolution}_${nproc5}_%j.eo        # nom du fichier de sortie
227#SBATCH --error=bench_${resolution}_${nproc5}_%j.eo         # nom du fichier d'erreur (ici en commun avec la sortie)
228#==========================================
229set -u
230#set -xv
231#
232#cd \${SLURM_SUBMIT_DIR}
233cd \${JOBSCRATCH}
234pwd
235
236for ff in \${SLURM_SUBMIT_DIR}/../EXPREF/namelist_*cfg \${SLURM_SUBMIT_DIR}/../EXPREF/namelist_*ref \${SLURM_SUBMIT_DIR}/../BLD/bin/nemo.exe
237do
238    cp \$ff .
239done
240
241jpni=${cores/\**/}
242jpnj=${cores/?*\*/}
243
244sed -e "s/jpni *=.*/jpni = \${jpni}/" \
245    -e "s/jpnj *=.*/jpnj = \${jpnj}/" \
246    -e "s/ln_timing *= *.false./ln_timing   =  .true./" \
247    \${SLURM_SUBMIT_DIR}/../EXPREF/namelist_cfg_orca${resolution}_like > namelist_cfg
248
249ls -l
250
251echo
252echo
253echo " =========== start the model ==========="
254echo
255echo
256
257time srun --mpi=pmi2 --cpu-bind=cores -K1 -n ${nproc} ./nemo.exe > jobout_${resolution}_${nproc5}_${dateref} 2>&1
258
259ls -l
260
261rsync -av namelist_cfg time.step ocean.output out_run.txt communication_report.txt layout.dat timing.output output.namelist* $( pwd )
262
263EOF
264
265    sbatch $jobname
266
267fi
Note: See TracBrowser for help on using the repository browser.