/[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.8 - (hide annotations) (download)
Tue Apr 3 12:58:37 2018 UTC (7 years, 3 months ago) by mlosch
Branch: MAIN
Changes since 1.7: +81 -39 lines
update code from git-repository
first version that seems work with new cray compiler of Jan 2018

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

  ViewVC Help
Powered by ViewVC 1.1.22