/[MITgcm]/MITgcm_contrib/test_scripts/ollie/mitgcmtestreport_ifort
ViewVC logotype

Annotation of /MITgcm_contrib/test_scripts/ollie/mitgcmtestreport_ifort

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.8 - (hide annotations) (download)
Tue Apr 3 12:03:36 2018 UTC (7 years, 7 months ago) by mlosch
Branch: MAIN
Changes since 1.7: +6 -5 lines
small adjustments

1 mlosch 1.1 #!/bin/bash -e
2     # new script for running testreport on ollie.awi.de
3 mlosch 1.3 # - compile and run on compute nodes
4     # - use ssh to call mpack command from the head node ollie0
5 mlosch 1.8 #$Header: /u/gcmpack/MITgcm_contrib/test_scripts/ollie/mitgcmtestreport_ifort,v 1.7 2018/02/13 15:47:57 mlosch Exp $
6 mlosch 1.2 #$Name: $
7 mlosch 1.1
8     # needed for cron-job
9     source /usr/Modules/3.2.10/init/bash
10     source /etc/profile.d/cray_pe.sh
11     source /etc/profile.d/AWI.sh
12     #
13     module purge
14     module load intel.compiler
15     module load intel.mpi
16 mlosch 1.5 module load netcdf
17     #export LD_LIBRARY_PATH=${CRAY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}:
18 mlosch 1.1
19 mlosch 1.5 export MPI_ROOT=${I_MPI_ROOT}
20     #(dirname $(dirname `which mpiifort`))
21 mlosch 1.1 export MPI_INC_DIR=${MPI_ROOT}/include64
22    
23 mlosch 1.5 # there is no slurm module anymore and this is the current recommendation to
24     # have sbatch in your path (rather than running /etc/profile.d./slurm.sh)
25     export PATH=${PATH}:/global/opt/slurm/default/bin
26    
27 mlosch 1.1 dNam='ollie'
28     TST_DIR="/work/ollie/mlosch/test_$dNam"
29     echo "start from TST_DIR='$TST_DIR' at: "`date`
30    
31     umask 0022
32    
33     sfx='ifort'
34     RUNIT="runit_"$sfx
35    
36 mlosch 1.2 OPTFILE=../tools/build_options/linux_ia64_${sfx}_ollie
37 mlosch 1.1 options="-MPI 6"
38 mlosch 1.2 options="$options -odir ${dNam}-i"
39 mlosch 1.1 options="$options -j 6"
40 mlosch 1.8 #options="$options -t global_ocean.cs32x15"
41 mlosch 1.3
42 mlosch 1.6 #EXE='mpiexec.hydra -bootstrap slurm -n TR_NPROC ./mitgcmuv'
43 mlosch 1.1 #EXE='srun --mpi=pmi2 -n TR_NPROC ./mitgcmuv'
44 mlosch 1.6 EXE='srun -n TR_NPROC ./mitgcmuv'
45 mlosch 1.1
46     if [ -e $TST_DIR ]; then
47     echo "$TST_DIR exists"
48     else
49     mkdir $TST_DIR
50     fi
51     cd $TST_DIR
52     HERE=$TST_DIR/output
53     if [ -e $HERE ]; then
54     echo "$HERE"
55     else
56     mkdir $HERE
57     fi
58 mlosch 1.2 OUTFILE=$HERE/slurm_${sfx}.out
59 mlosch 1.1 MYOUTPUT=$HERE/out_$sfx
60     if [ -e $MYOUTPUT ]; then
61     rm -rf $MYOUTPUT
62     fi
63     if [ -e $OUTFILE ]; then
64     rm -r $OUTFILE
65     fi
66 mlosch 1.7 gcmDIR="MITgcm_${sfx}"
67 mlosch 1.6 git_repo='MITgcm'
68     git_code='MITgcm'
69    
70     # checkOut determines how much checking out is being done
71     # checkOut = 3: new clone from GitHub and make a new copy
72     # checkOut = 2: update (git pull) existing repo and make a new copy
73     # checkOut = 1: skip update
74     # checkOut = 0: use existing test code (if available otherwise switch to 1)
75    
76     checkOut=2
77     tdir=${TST_DIR}
78     today=`date +%Y%m%d`
79     TODAY=`date +%d`
80     #tmpFil="/tmp/"`basename $0`".$$"
81     tmpFil=$TST_DIR/error.out
82    
83     if [ $checkOut -le 1 ] ; then
84     if test -e $TST_DIR/${gcmDIR}/doc ; then
85     echo $TST_DIR/${gcmDIR}/doc 'exist'
86     else
87     echo -n $TST_DIR/${gcmDIR} 'missing ; '
88     checkOut=2
89     echo "will make a new copy ( checkOut=$checkOut )"
90 mlosch 1.1 fi
91 mlosch 1.6 fi
92    
93     if [ $checkOut -ge 2 ] ; then
94     #---- cleaning:
95     cd $TST_DIR
96    
97     #---- Make a new clone or update existing one:
98     if test -e ${gcmDIR}/.git/config ; then
99     echo "${gcmDIR}/.git/config exist"
100     else
101 mlosch 1.8 echo -n "${gcmDIR}/.git/config 'missing "
102 mlosch 1.6 checkOut=3
103     echo "will get new clone ( checkOut=$checkOut )"
104     fi
105     if [ $checkOut -eq 3 ] ; then
106     echo -n "Removing old clone: $TST_DIR/${gcmDIR} ..."
107     test -e $TST_DIR/${gcmDIR} && rm -rf $TST_DIR/${gcmDIR}
108     echo " done"
109     echo -n "Make a new clone of $git_code from repo: $git_repo ..."
110     git clone https://github.com/$git_repo/${git_code}.git ${gcmDIR} 2> $tmpFil
111     retVal=$?
112     if test $retVal = 0 ; then
113     echo ' --> done!'
114     rm -f $tmpFil
115     else
116     echo " Error: 'git clone' returned: $retVal"
117     cat $tmpFil
118     rm -f $tmpFil
119     exit 2
120     fi
121     else
122     echo "Updating current clone ( $git_code ) ..."
123     ( cd ${gcmDIR}; git checkout master ; git pull )
124     echo ' --> done!'
125 mlosch 1.1 fi
126 mlosch 1.6 else
127     cd $TST_DIR
128 mlosch 1.1 fi
129    
130 mlosch 1.7 cd ${TST_DIR}/${gcmDIR}/verification
131 mlosch 1.1
132 mlosch 1.4 cwd=\`pwd\`
133 mlosch 1.3 SENDCMD="ssh ollie0 ${TST_DIR}/${gcmDIR}/tools/mpack-1.6/mpack"
134     runtestreport="./testreport $options -of $OPTFILE -command \"${EXE}\" -send \"${SENDCMD}\" -sd ${cwd}"
135 mlosch 1.8 emailaddress="-a jm_c@mitgcm.org"
136 mlosch 1.1
137     if [ ! -e $MYOUTPUT ]
138     then
139     touch $MYOUTPUT
140     fi
141    
142 mlosch 1.2 # echo "running testreport like this:"
143     # echo ${runtestreport} -norun
144     # eval "${runtestreport} -norun >> $MYOUTPUT 2>&1"
145 mlosch 1.1
146     # create batch script
147     #
148 mlosch 1.2 JOBNAME=tst$sfx
149 mlosch 1.1 echo "creating batch script $HERE/$RUNIT"
150     cat << EOF >| $HERE/$RUNIT
151 mlosch 1.3 #!/bin/bash
152 mlosch 1.1 #SBATCH --job-name=${JOBNAME}
153     #SBATCH -o ${OUTFILE}
154 mlosch 1.3 #SBATCH --time=6:00:00
155 mlosch 1.1 #SBATCH --ntasks=6
156    
157 mlosch 1.3 # still need this to be able to run a few experiments:
158     # cfc_example, fizhi, tutorial_deep_convection
159     ulimit -s unlimited
160 mlosch 1.1
161 mlosch 1.6 # binds OpenMP task to given cores
162     export OMP_PROC_BIND=TRUE
163    
164     # for debugging
165     export FLEXLM_DIAGNOSTICS=2
166     export FNP_IP_ENV=1
167     export LM_A_CONN_TIMEOUT=99
168    
169 mlosch 1.1 cd \${SLURM_SUBMIT_DIR}
170    
171 mlosch 1.3 cwd=`pwd`
172     echo "running testreport like this in \${cwd}:"
173     echo "${runtestreport} -devel -match 10"
174 mlosch 1.8 ${runtestreport} -devel -match 10 ${emailaddress} >> $MYOUTPUT 2>&1
175 mlosch 1.3
176     echo "running testreport like this in \${cwd}:"
177     echo "./testreport -clean"
178     ./testreport -clean
179    
180     echo "running testreport like this in \${cwd}:"
181     echo "${runtestreport} -fast -match 10"
182 mlosch 1.8 ${runtestreport} -fast -match 10 ${emailaddress} >> $MYOUTPUT 2>&1
183 mlosch 1.1
184     EOF
185    
186     chmod a+x $HERE/$RUNIT
187    
188     echo " " >> $MYOUTPUT
189     echo "***********************************************************" >> $MYOUTPUT
190     echo "Submitting this job script:" >> $MYOUTPUT
191     echo "***********************************************************" >> $MYOUTPUT
192     cat $HERE/$RUNIT >> $MYOUTPUT
193     echo "***********************************************************" >> $MYOUTPUT
194     echo "end of job script" >> $MYOUTPUT
195     echo "***********************************************************" >> $MYOUTPUT
196     echo " " >> $MYOUTPUT
197    
198 mlosch 1.6 echo "sbatch $HERE/$RUNIT"
199 mlosch 1.1 sbatch $HERE/$RUNIT
200    
201 mlosch 1.3 # # keep looking for the job in the job queues and wait until it has disappeared
202     # jobruns=somedummy
203     # while [ "${jobruns}"x != x ]
204     # do
205     # sleep 200
206     # jobruns=`squeue --noheader -u mlosch | grep "$JOBNAME" | awk '{print $1}'`
207     # echo "waiting for job ${jobruns%% *} ($JOBNAME) to complete"
208     # currentexp=`grep Experiment $MYOUTPUT | tail -1`
209     # echo "currently running $currentexp"
210     # done
211    
212     # # workaround for mailing the stuff
213     # echo "mail the stuff"
214    
215     # MPACKCMD=../tools/mpack-1.6/mpack
216     # fn=`ls -dtr tr_$dNam* | grep -v tar.gz | tail -1`
217     # echo "fname ${fn}"
218     # tar cf - $fn | gzip > "${fn}.tar.gz"
219 mlosch 1.6 # $MPACKCMD -s MITgcm-test -m 3555000 ${fn}.tar.gz jm_c@mitgcm.org
220 mlosch 1.3 # sleep 2
221     # rm -rf "${fn}.tar.gz"
222 mlosch 1.1
223     echo "end of mitgcmtestreport"
224    
225    
226    
227    
228    

  ViewVC Help
Powered by ViewVC 1.1.22