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

Last change on this file since 11359 was 11359, checked in by smasson, 2 years ago

dev_r10984_HPC-13 : add new machine and update BENCH scripts, see #2285

  • Property svn:executable set to *
File size: 6.0 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    jobname=$HOME/binrun/jobbench
163    cat > $jobname << EOF
164#!/bin/bash
165#MSUB -r bench${nproc5}
166#MSUB -n ${nproc_exe1}
167#MSUB -T $timejob
168#MSUB -e bench_${resolution}_${nproc5}_%I.eo
169#MSUB -o bench_${resolution}_${nproc5}_%I.eo
170#MSUB -j oe
171#MSUB -x
172#MSUB -q ${queuename}
173#MSUB -A gen6895
174#==========================================
175set -u
176#
177
178cd \${BRIDGE_MSUB_PWD}/..
179
180
181EXPjob=EXP_${resolution}_${nproc5}_${dateref}
182rsync -av --exclude="*eo" EXPREF/ \${EXPjob}/
183rsync -av EXP00/nemo \${EXPjob}/nemo
184cd \${EXPjob}
185
186jpni=${cores/\**/}
187jpnj=${cores/?*\*/}
188
189sed -e "s/jpni *=.*/jpni = \${jpni}/" -e "s/jpnj *=.*/jpnj = \${jpnj}/" namelist_cfg_orca${resolution}_like > namelist_cfg
190
191time ccc_mprun -n \${BRIDGE_MSUB_NPROC} ./nemo > jobout_${resolution}_${nproc5}_${dateref}
192
193EOF
194
195    ccc_msub $jobname
196
197fi
198
199######################################################################
200### Jean-Zay
201######################################################################
202
203if [ "$machine" == "jean-zay" ]
204then
205    hh=$( printf "%02d\n" $(( ${timejob} / 3600 )) )
206    mm=$( printf "%02d\n" $(( ( ${timejob} % 3600 ) / 60 )) )
207    ss=$( printf "%02d\n" $(( ( ${timejob} % 3600 ) % 60 )) )
208
209    EXPjob=../EXP_${resolution}_${nproc5}_${dateref}
210    mkdir -p ${EXPjob}
211    cd ${EXPjob}
212    jobname=jobbench
213    cat > $jobname << EOF
214#!/bin/bash
215#SBATCH --job-name=Seq        # nom du job
216#SBATCH --partition=cpu_dev   # demande d'allocation sur la partition CPU
217#SBATCH --nodes=${nnode}             # nombre de noeuds
218#SBATCH --ntasks-per-node=${ncore_node}  # nombre de taches MPI par noeud
219#SBATCH --time=${hh}:${mm}:${ss}       # temps d execution maximum demande (HH:MM:SS)
220#SBATCH --output=bench_${resolution}_${nproc5}_%j.eo        # nom du fichier de sortie
221#SBATCH --error=bench_${resolution}_${nproc5}_%j.eo         # nom du fichier d'erreur (ici en commun avec la sortie)
222#==========================================
223set -u
224#set -xv
225#
226#cd \${SLURM_SUBMIT_DIR}
227cd \${JOBSCRATCH}
228pwd
229
230for ff in \${SLURM_SUBMIT_DIR}/../EXPREF/namelist_*cfg \${SLURM_SUBMIT_DIR}/../EXPREF/namelist_*ref \${SLURM_SUBMIT_DIR}/../BLD/bin/nemo.exe
231do
232    cp \$ff .
233done
234
235jpni=${cores/\**/}
236jpnj=${cores/?*\*/}
237
238sed -e "s/jpni *=.*/jpni = \${jpni}/" \
239    -e "s/jpnj *=.*/jpnj = \${jpnj}/" \
240    -e "s/ln_timing *= *.false./ln_timing   =  .true./" \
241    \${SLURM_SUBMIT_DIR}/../EXPREF/namelist_cfg_orca${resolution}_like > namelist_cfg
242
243ls -l
244
245echo
246echo
247echo " =========== start the model ==========="
248echo
249echo
250
251time mpirun -np ${nproc} ./nemo.exe > out_run.txt 2>&1
252
253ls -l
254
255rsync -av namelist_cfg time.step ocean.output out_run.txt communication_report.txt layout.dat timing.output output.namelist* $( pwd )
256
257EOF
258
259    sbatch $jobname
260
261fi
Note: See TracBrowser for help on using the repository browser.