| 1 |
#!/bin/bash -e |
#!/bin/bash -e |
| 2 |
# new script for running testreport on ollie.awi.de |
# new script for running testreport on ollie.awi.de |
| 3 |
# - split the testreport into 2 steps: |
p# - compile and run on compute nodes |
| 4 |
# 1/ compiling on head node, with -norun option |
# - use ssh to call mpack command from the head node ollie0 |
|
# 2/ running on compute node (using SBATCH), with -runonly option |
|
| 5 |
#$Header$ |
#$Header$ |
| 6 |
#$Name$ |
#$Name$ |
| 7 |
|
|
| 31 |
OPTFILE=../tools/build_options/linux_ia64_${sfx}_ollie |
OPTFILE=../tools/build_options/linux_ia64_${sfx}_ollie |
| 32 |
options="-MPI 6" |
options="-MPI 6" |
| 33 |
options="$options -odir ${dNam}-c" |
options="$options -odir ${dNam}-c" |
| 34 |
options="$options -devel" |
p#options="$options -j 6" |
| 35 |
#options="$options -j 2" |
#options="$options -t global_ocean.cs32x15" |
| 36 |
#options="$options -j 6" |
|
|
#options="$options -t global_ocean.cs32x15 -q" |
|
| 37 |
#EXE='mpiexec.hydra -bootstrap slurm -n TR_NPROC ./mitgcmuv' |
#EXE='mpiexec.hydra -bootstrap slurm -n TR_NPROC ./mitgcmuv' |
| 38 |
EXE='srun --mpi=pmi2 -n TR_NPROC ./mitgcmuv' |
EXE='srun --mpi=pmi2 -n TR_NPROC ./mitgcmuv' |
| 39 |
|
|
| 58 |
rm -r $OUTFILE |
rm -r $OUTFILE |
| 59 |
fi |
fi |
| 60 |
gcmDIR="MITgcm_$sfx" |
gcmDIR="MITgcm_$sfx" |
|
#gcmDIR="MITgcm" |
|
| 61 |
checkOut=1 |
checkOut=1 |
| 62 |
if [ $checkOut -eq 1 ] ; then |
if [ $checkOut -eq 1 ] ; then |
| 63 |
if test -d $gcmDIR/CVS ; then |
if test -d $gcmDIR/CVS ; then |
| 87 |
|
|
| 88 |
cd ${gcmDIR}/verification |
cd ${gcmDIR}/verification |
| 89 |
|
|
| 90 |
runtestreport="./testreport $options -of $OPTFILE -command \"${EXE}\"" |
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 ] |
if [ ! -e $MYOUTPUT ] |
| 95 |
then |
then |
| 105 |
JOBNAME=tst$sfx |
JOBNAME=tst$sfx |
| 106 |
echo "creating batch script $HERE/$RUNIT" |
echo "creating batch script $HERE/$RUNIT" |
| 107 |
cat << EOF >| $HERE/$RUNIT |
cat << EOF >| $HERE/$RUNIT |
| 108 |
#!/bin/bash -x |
#!/bin/bash |
| 109 |
#SBATCH --job-name=${JOBNAME} |
#SBATCH --job-name=${JOBNAME} |
| 110 |
#SBATCH -o ${OUTFILE} |
#SBATCH -o ${OUTFILE} |
| 111 |
#SBATCH --time=6:00:00 |
#SBATCH --time=12:00:00 |
| 112 |
#SBATCH --ntasks=6 |
#SBATCH --ntasks=6 |
|
#SBATCH -p smp |
|
| 113 |
|
|
| 114 |
ulimit -s 1048576 |
# 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} |
cd \${SLURM_SUBMIT_DIR} |
| 119 |
|
|
| 120 |
echo "running testreport like this:" |
cwd=`pwd` |
| 121 |
echo "${runtestreport} -runonly" |
echo "running testreport like this in \${cwd}:" |
| 122 |
#${runtestreport} -runonly -match 10 -a 'Martin.Losch@awi.de' >> $MYOUTPUT |
echo "${runtestreport} -devel -match 10" |
| 123 |
#${runtestreport} -runonly -match 10 -a 'jmc@mitcm.org' >> $MYOUTPUT |
${runtestreport} -devel -match 10 -a jmc@mitgcm.org >> $MYOUTPUT 2>&1 |
| 124 |
${runtestreport} -match 10 >> $MYOUTPUT |
|
| 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 |
EOF |
| 134 |
|
|
| 146 |
|
|
| 147 |
sbatch $HERE/$RUNIT |
sbatch $HERE/$RUNIT |
| 148 |
|
|
| 149 |
# keep looking for the job in the job queues and wait until has disappeared |
# # keep looking for the job in the job queues and wait until it has disappeared |
| 150 |
jobruns=somedummy |
# jobruns=somedummy |
| 151 |
while [ "${jobruns}"x != x ] |
# while [ "${jobruns}"x != x ] |
| 152 |
do |
# do |
| 153 |
sleep 200 |
# sleep 200 |
| 154 |
jobruns=`squeue --noheader -u mlosch | grep "$JOBNAME" | awk '{print $1}'` |
# jobruns=`squeue --noheader -u mlosch | grep "$JOBNAME" | awk '{print $1}'` |
| 155 |
echo "waiting for job ${jobruns%% *} ($JOBNAME) to complete" |
# echo "waiting for job ${jobruns%% *} ($JOBNAME) to complete" |
| 156 |
currentexp=`grep Experiment $MYOUTPUT | tail -1` |
# currentexp=`grep Experiment $MYOUTPUT | tail -1` |
| 157 |
echo "currently running $currentexp" |
# echo "currently running $currentexp" |
| 158 |
done |
# done |
| 159 |
|
|
| 160 |
# workaround for mailing the stuff |
# # workaround for mailing the stuff |
| 161 |
echo "mail the stuff" |
# echo "mail the stuff" |
| 162 |
|
|
| 163 |
MPACKCMD=../tools/mpack-1.6/mpack |
# MPACKCMD=../tools/mpack-1.6/mpack |
| 164 |
fn=`ls -dtr tr_$dNam* | grep -v tar.gz | tail -1` |
# fn=`ls -dtr tr_$dNam* | grep -v tar.gz | tail -1` |
| 165 |
echo "fname ${fn}" |
# echo "fname ${fn}" |
| 166 |
tar cf - $fn | gzip > "${fn}.tar.gz" |
# tar cf - $fn | gzip > "${fn}.tar.gz" |
| 167 |
$MPACKCMD -s MITgcm-test -m 3555000 ${fn}.tar.gz jmc@mitgcm.org |
# $MPACKCMD -s MITgcm-test -m 3555000 ${fn}.tar.gz jmc@mitgcm.org |
| 168 |
sleep 2 |
# sleep 2 |
| 169 |
rm -rf "${fn}.tar.gz" |
# rm -rf "${fn}.tar.gz" |
| 170 |
|
|
| 171 |
echo "end of mitgcmtestreport" |
echo "end of mitgcmtestreport" |
| 172 |
|
|