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_r11514_HPC-02_single-core-extrahalo/tests/BENCH/EXPREF – NEMO

source: NEMO/branches/2019/dev_r11514_HPC-02_single-core-extrahalo/tests/BENCH/EXPREF/submit_bench @ 11692

Last change on this file since 11692 was 11692, checked in by francesca, 5 years ago

Update branch to integrate the development starting from the current v4.01 ready trunk

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