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

Contents of /MITgcm_contrib/test_scripts/ollie/mitgcmtestreport_cray

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


Revision 1.4 - (show annotations) (download)
Tue Jun 21 09:44:26 2016 UTC (9 years ago) by mlosch
Branch: MAIN
Changes since 1.3: +2 -2 lines
oh my ...

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

  ViewVC Help
Powered by ViewVC 1.1.22