/[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.3 - (hide annotations) (download)
Tue Jun 21 09:43:58 2016 UTC (9 years, 4 months ago) by mlosch
Branch: MAIN
Changes since 1.2: +45 -38 lines
further improvements:
- send emails directly from script via -send option
- run test twice: once with -devel, once with -fast

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     #$Header: /u/gcmpack/MITgcm_contrib/test_scripts/ollie/mitgcmtestreport_ifort,v 1.2 2016/06/10 07:55:29 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 slurm
15     module load intel.compiler
16     module load intel.mpi
17     module load netcdf/4.4.0_intel
18     export LD_LIBRARY_PATH=${CRAY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}:
19    
20     export MPI_ROOT=$(dirname $(dirname `which mpiifort`))
21     export MPI_INC_DIR=${MPI_ROOT}/include64
22    
23     dNam='ollie'
24     TST_DIR="/work/ollie/mlosch/test_$dNam"
25     echo "start from TST_DIR='$TST_DIR' at: "`date`
26    
27     umask 0022
28    
29     sfx='ifort'
30     RUNIT="runit_"$sfx
31    
32 mlosch 1.2 OPTFILE=../tools/build_options/linux_ia64_${sfx}_ollie
33 mlosch 1.1 options="-MPI 6"
34 mlosch 1.2 options="$options -odir ${dNam}-i"
35 mlosch 1.1 options="$options -j 6"
36     #options="$options -t global_ocean.90x40x15"
37 mlosch 1.3
38 mlosch 1.1 EXE='mpiexec.hydra -bootstrap slurm -n TR_NPROC ./mitgcmuv'
39     #EXE='srun --mpi=pmi2 -n TR_NPROC ./mitgcmuv'
40    
41     if [ -e $TST_DIR ]; then
42     echo "$TST_DIR exists"
43     else
44     mkdir $TST_DIR
45     fi
46     cd $TST_DIR
47     HERE=$TST_DIR/output
48     if [ -e $HERE ]; then
49     echo "$HERE"
50     else
51     mkdir $HERE
52     fi
53 mlosch 1.2 OUTFILE=$HERE/slurm_${sfx}.out
54 mlosch 1.1 MYOUTPUT=$HERE/out_$sfx
55     if [ -e $MYOUTPUT ]; then
56     rm -rf $MYOUTPUT
57     fi
58     if [ -e $OUTFILE ]; then
59     rm -r $OUTFILE
60     fi
61     gcmDIR="MITgcm_$sfx"
62     checkOut=1
63     if [ $checkOut -eq 1 ] ; then
64     if test -d $gcmDIR/CVS ; then
65     /bin/rm -rf $gcmDIR/verification/??_${dNam}_????????_?
66     ( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean )
67     echo "cvs update of dir $gcmDIR :"
68     ( cd $gcmDIR ; cvs -q -d :pserver:cvsanon@mitgcm.org:/u/gcmpack update -P -d ) 2>&1
69     RETVAL=$?
70     if test "x$RETVAL" != x0 ; then
71     echo "cvs update on '"`hostname`"' failed (return val=$RETVAL) => exit"
72     exit
73     fi
74     else
75     echo "no dir: $gcmDIR/CVS => try a fresh check-out"
76     checkOut=2
77     fi
78     fi
79     if [ $checkOut -eq 2 ] ; then
80     if test -e $gcmDIR ; then
81     rm -rf $gcmDIR
82     fi
83     # cvs co MITgcm
84     cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co -P -d $gcmDIR MITgcm > /dev/null 2>&1
85     /usr/bin/find $gcmDIR -type d | xargs chmod g+rxs
86     /usr/bin/find $gcmDIR -type f | xargs chmod g+r
87     fi
88    
89     cd ${gcmDIR}/verification
90    
91 mlosch 1.3 cwd=`pwd`
92     SENDCMD="ssh ollie0 ${TST_DIR}/${gcmDIR}/tools/mpack-1.6/mpack"
93     runtestreport="./testreport $options -of $OPTFILE -command \"${EXE}\" -send \"${SENDCMD}\" -sd ${cwd}"
94 mlosch 1.1
95     if [ ! -e $MYOUTPUT ]
96     then
97     touch $MYOUTPUT
98     fi
99    
100 mlosch 1.2 # echo "running testreport like this:"
101     # echo ${runtestreport} -norun
102     # eval "${runtestreport} -norun >> $MYOUTPUT 2>&1"
103 mlosch 1.1
104     # create batch script
105     #
106 mlosch 1.2 JOBNAME=tst$sfx
107 mlosch 1.1 echo "creating batch script $HERE/$RUNIT"
108     cat << EOF >| $HERE/$RUNIT
109 mlosch 1.3 #!/bin/bash
110 mlosch 1.1 #SBATCH --job-name=${JOBNAME}
111     #SBATCH -o ${OUTFILE}
112 mlosch 1.3 #SBATCH --time=6:00:00
113 mlosch 1.1 #SBATCH --ntasks=6
114    
115 mlosch 1.3 # still need this to be able to run a few experiments:
116     # cfc_example, fizhi, tutorial_deep_convection
117     ulimit -s unlimited
118 mlosch 1.1
119     cd \${SLURM_SUBMIT_DIR}
120    
121 mlosch 1.3 cwd=`pwd`
122     echo "running testreport like this in \${cwd}:"
123     echo "${runtestreport} -devel -match 10"
124     ${runtestreport} -devel -match 10 -a jmc@mitgcm.org >> $MYOUTPUT 2>&1
125    
126     echo "running testreport like this in \${cwd}:"
127     echo "./testreport -clean"
128     ./testreport -clean
129    
130     echo "running testreport like this in \${cwd}:"
131     echo "${runtestreport} -fast -match 10"
132     ${runtestreport} -fast -match 10 -a jmc@mitgcm.org >> $MYOUTPUT 2>&1
133 mlosch 1.1
134     EOF
135    
136     chmod a+x $HERE/$RUNIT
137    
138     echo " " >> $MYOUTPUT
139     echo "***********************************************************" >> $MYOUTPUT
140     echo "Submitting this job script:" >> $MYOUTPUT
141     echo "***********************************************************" >> $MYOUTPUT
142     cat $HERE/$RUNIT >> $MYOUTPUT
143     echo "***********************************************************" >> $MYOUTPUT
144     echo "end of job script" >> $MYOUTPUT
145     echo "***********************************************************" >> $MYOUTPUT
146     echo " " >> $MYOUTPUT
147    
148     sbatch $HERE/$RUNIT
149    
150 mlosch 1.3 # # keep looking for the job in the job queues and wait until it has disappeared
151     # jobruns=somedummy
152     # while [ "${jobruns}"x != x ]
153     # do
154     # sleep 200
155     # jobruns=`squeue --noheader -u mlosch | grep "$JOBNAME" | awk '{print $1}'`
156     # echo "waiting for job ${jobruns%% *} ($JOBNAME) to complete"
157     # currentexp=`grep Experiment $MYOUTPUT | tail -1`
158     # echo "currently running $currentexp"
159     # done
160    
161     # # workaround for mailing the stuff
162     # echo "mail the stuff"
163    
164     # MPACKCMD=../tools/mpack-1.6/mpack
165     # fn=`ls -dtr tr_$dNam* | grep -v tar.gz | tail -1`
166     # echo "fname ${fn}"
167     # tar cf - $fn | gzip > "${fn}.tar.gz"
168     # $MPACKCMD -s MITgcm-test -m 3555000 ${fn}.tar.gz jmc@mitgcm.org
169     # sleep 2
170     # rm -rf "${fn}.tar.gz"
171 mlosch 1.1
172     echo "end of mitgcmtestreport"
173    
174    
175    
176    
177    

  ViewVC Help
Powered by ViewVC 1.1.22