source: NEMO/branches/2018/dev_r9759_HPC09_ESIWACE/tests/BENCH/EXPREF/submit_bench @ 9870

Last change on this file since 9870 was 9870, checked in by smasson, 3 years ago

dev_r9759_HPC09_ESIWACE: update bench jobs (fix)

  • Property svn:executable set to *
File size: 4.3 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
8set -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
17    nproc_exe1=$( echo $cores | bc )
18  (( nproc = $nproc_exe1 ))
19(( nnode = $nproc / $ncore_node ))
20[ $nnode -lt 1 ] && nnode=1
21
22nproc5=$( printf "%05d\n" ${nproc_exe1} )
23
24######################################################################
25### beaufixlogin
26######################################################################
27
28if [ "$machine" == "beaufixlogin" ]
29then
30   
31cat > Log/run_bench << EOF
32#!/bin/bash
33#SBATCH --time=00:1:00
34#SBATCH -p  normal64         # partition/queue
35#SBATCH --job-name=bench      # job name
36#SBATCH -N $nnode            # number of nodes
37#SBATCH -n $nproc            # number of procs
38#SBATCH -o /scratch/work/cglo315/ESIWACE/dev_r9759_HPC09_ESIWACE/tests/LBENCH_RN/EXP00/Log/job.out%j
39#SBATCH -e /scratch/work/cglo315/ESIWACE/dev_r9759_HPC09_ESIWACE/tests/LBENCH_RN/EXP00/Log/job.out%j
40#SBATCH --exclusive
41
42module unload intelmpi intel grib_api
43module load intel/16.1.150 intelmpi/5.1.2.150
44
45itac=0
46xpmpi=0
47
48if [ \$xpmpi == 1 ]; then
49  module load bullxde
50  module load xPMPI/1.1_intelmpi
51fi
52
53[ \$itac == 1 ] && module load itac/2017.2.028
54
55set -vx
56
57cd \${TMPDIR}
58cp /scratch/work/cglo315/ESIWACE/dev_r9759_HPC09_ESIWACE/tests/LBENCH_RN/EXP00/* .
59
60# Best decompositions BENCH-1
61jpni=${cores/\**/}
62jpnj=${cores/?*\*/}
63
64sed -e "s/jpni *=.*/jpni = \${jpni}/" -e "s/jpnj *=.*/jpnj = \${jpnj}/" namelist_cfg_orca${resolution}_like > namelist_cfg
65
66export OMP_NUM_THREADS=1
67ulimit -s unlimited
68#
69if [ \$itac == 1 ]; then
70  source /opt/softs/intel/2017/update_1/itac_latest/bin/itacvars.sh
71  time mpirun -ordered-output -prepend-rank -trace -np $nproc_exe1 ./nemo > jobout 2>joberr
72else
73  time mpirun -ordered-output -prepend-rank -np $nproc_exe1 ./nemo > jobout_${resolution}_${nproc5}
74fi
75/opt/softs/bin/ja
76
77if [ \$xpmpi == 1 ]; then
78  module unload xPMPI/1.1_intelmpi
79  module unload bullxde
80fi
81#
82EOF
83
84
85### 4. Execute the model
86
87    echo 'Submitting the job to queue using sbatch'
88    sbatch Log/run_bench
89    squeue -u cglo315
90
91echo 'is executed or submitted to queue.'
92
93
94fi
95
96######################################################################
97### curie or irene
98######################################################################
99
100if [[ ( "$machine" == "curie" ) || ( "$machine" == "irene" ) ]]
101then
102   
103    case ${resolution} in
104   "1")
105       if [ $nproc_exe1 -lt 50 ]
106       then
107      timejob=3600
108       elif [ $nproc_exe1 -lt 100 ]
109       then
110      timejob=1800
111       elif [ $nproc_exe1 -lt 200 ]
112       then
113      timejob=900
114       else
115      timejob=600
116       fi
117       ;;
118   "025")
119       if [ $nproc_exe1 -lt 50 ]
120       then
121      timejob=15000
122       elif [ $nproc_exe1 -lt 100 ]
123       then
124      timejob=7000
125       elif [ $nproc_exe1 -lt 200 ]
126       then
127      timejob=3600
128       elif [ $nproc_exe1 -lt 400 ]
129       then
130      timejob=2000
131       elif [ $nproc_exe1 -lt 800 ]
132       then
133      timejob=1000
134       else
135      timejob=600
136       fi
137       ;;
138   "12")
139       if [ $nproc_exe1 -lt 200 ]
140       then
141      timejob=30000
142       elif [ $nproc_exe1 -lt 400 ]
143       then
144      timejob=15000
145       elif [ $nproc_exe1 -lt 800 ]
146       then
147      timejob=8000
148       elif [ $nproc_exe1 -lt 1600 ]
149       then
150      timejob=5000
151       elif [ $nproc_exe1 -lt 3200 ]
152       then
153      timejob=2500
154       else
155      timejob=1200
156       fi
157   ;;
158    esac
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
Note: See TracBrowser for help on using the repository browser.