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

Annotation of /MITgcm_contrib/test_scripts/ollie/mitgcmtestreport_cray

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


Revision 1.9 - (hide annotations) (download)
Mon Apr 16 08:35:39 2018 UTC (7 years, 3 months ago) by mlosch
Branch: MAIN
Changes since 1.8: +2 -9 lines
change module from PrgEnv-cray/1.0.2_test to PrgEnv-cray/1.0.2_ollie,
loading module broadwell no longer required

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

  ViewVC Help
Powered by ViewVC 1.1.22