6 |
#$Name$ |
#$Name$ |
7 |
|
|
8 |
# needed for cron-job |
# needed for cron-job |
9 |
source /usr/Modules/3.2.10/init/bash |
#source /usr/Modules/current/init/bash |
10 |
source /etc/profile.d/cray_pe.sh |
source /etc/profile.d/cray_pe.sh |
11 |
source /etc/profile.d/AWI.sh |
# this seems to be enough to make the module cmd work |
12 |
|
source /etc/profile.d/modules.sh |
13 |
# |
# |
|
|
|
14 |
module purge |
module purge |
|
module load craype-broadwell |
|
15 |
module load PrgEnv-cray |
module load PrgEnv-cray |
|
# to me this looks like a terrible hack, but that is what we are supposed |
|
|
# to use now |
|
|
module unload craype-network-infiniband cudatoolkit mvapich2_cce |
|
|
module load craype-network-opa |
|
|
module load mvapich2_cce |
|
16 |
module load netcdf |
module load netcdf |
17 |
#export LD_LIBRARY_PATH=${CRAY_LD_LIBRARY_PATH}:${LD_LIBRARY_PATH}: |
# set the netcdf root directory here, because the definitions always |
18 |
# not sure why I have set these paths here again |
# change with different "default" netcdf modules |
19 |
|
export NETCDF_ROOT=`nc-config --prefix` |
20 |
|
# not sure why I have to set these paths here again |
21 |
export MPI_ROOT=$(dirname $(dirname `which mpicc`)) |
export MPI_ROOT=$(dirname $(dirname `which mpicc`)) |
22 |
# $(dirname `echo $LD_LIBRARY_PATH | awk -F: '{print $1}'`) |
# $(dirname `echo $LD_LIBRARY_PATH | awk -F: '{print $1}'`) |
23 |
export MPI_INC_DIR=${MPI_ROOT}/include |
export MPI_INC_DIR=${MPI_ROOT}/include |
38 |
OPTFILE=../tools/build_options/linux_ia64_${sfx}_ollie |
OPTFILE=../tools/build_options/linux_ia64_${sfx}_ollie |
39 |
options="-MPI 6" |
options="-MPI 6" |
40 |
options="$options -odir ${dNam}-c" |
options="$options -odir ${dNam}-c" |
41 |
#options="$options -j 6" |
options="$options -j 6" |
42 |
#options="$options -t global_ocean.cs32x15" |
#options="$options -t global_ocean.cs32x15" |
43 |
|
|
44 |
#EXE='mpiexec.hydra -bootstrap slurm -n TR_NPROC ./mitgcmuv' |
#EXE='srun --mpi=pmi2 -n TR_NPROC ./mitgcmuv' |
45 |
EXE='srun --mpi=pmi2 -n TR_NPROC ./mitgcmuv' |
#EXE='srun -n TR_NPROC ./mitgcmuv' |
46 |
|
EXE='srun -n TR_NPROC --cpu_bind=cores ./mitgcmuv' |
47 |
|
|
48 |
if [ -e $TST_DIR ]; then |
if [ -e $TST_DIR ]; then |
49 |
echo "$TST_DIR exists" |
echo "$TST_DIR exists" |
50 |
else |
else |
51 |
mkdir $TST_DIR |
mkdir $TST_DIR |
52 |
fi |
fi |
53 |
cd $TST_DIR |
cd $TST_DIR |
54 |
HERE=$TST_DIR/output |
HERE=$TST_DIR/output |
55 |
if [ -e $HERE ]; then |
if [ -e $HERE ]; then |
56 |
echo "$HERE" |
echo "$HERE" |
57 |
else |
else |
58 |
mkdir $HERE |
mkdir $HERE |
59 |
fi |
fi |
60 |
OUTFILE=$HERE/slurm_${sfx}.out |
OUTFILE=$HERE/slurm_${sfx}.out |
65 |
if [ -e $OUTFILE ]; then |
if [ -e $OUTFILE ]; then |
66 |
rm -r $OUTFILE |
rm -r $OUTFILE |
67 |
fi |
fi |
68 |
gcmDIR="MITgcm_$sfx" |
gcmDIR="MITgcm_${sfx}" |
69 |
checkOut=1 |
git_repo='MITgcm' |
70 |
if [ $checkOut -eq 1 ] ; then |
git_code='MITgcm' |
71 |
if test -d $gcmDIR/CVS ; then |
|
72 |
/bin/rm -rf $gcmDIR/verification/??_${dNam}_????????_? |
# checkOut determines how much checking out is being done |
73 |
( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean ) |
# checkOut = 3: new clone from GitHub and make a new copy |
74 |
echo "cvs update of dir $gcmDIR :" |
# checkOut = 2: update (git pull) existing repo and make a new copy |
75 |
( cd $gcmDIR ; cvs -q -d :pserver:cvsanon@mitgcm.org:/u/gcmpack update -P -d ) 2>&1 |
# checkOut = 1: skip update |
76 |
RETVAL=$? |
# checkOut = 0: use existing test code (if available otherwise switch to 1) |
77 |
if test "x$RETVAL" != x0 ; then |
|
78 |
echo "cvs update on '"`hostname`"' failed (return val=$RETVAL) => exit" |
checkOut=2 |
79 |
exit |
tdir=${TST_DIR} |
80 |
|
today=`date +%Y%m%d` |
81 |
|
TODAY=`date +%d` |
82 |
|
#tmpFil="/tmp/"`basename $0`".$$" |
83 |
|
tmpFil=$TST_DIR/error.out |
84 |
|
|
85 |
|
if [ $checkOut -le 1 ] ; then |
86 |
|
if test -e $TST_DIR/${gcmDIR}/doc ; then |
87 |
|
echo $TST_DIR/${gcmDIR}/doc 'exist' |
88 |
|
else |
89 |
|
echo -n "$TST_DIR/${gcmDIR} missing ; " |
90 |
|
checkOut=2 |
91 |
|
echo "will make a new copy ( checkOut=$checkOut )" |
92 |
|
fi |
93 |
|
fi |
94 |
|
|
95 |
|
if [ $checkOut -ge 2 ] ; then |
96 |
|
#---- cleaning: |
97 |
|
cd $TST_DIR |
98 |
|
|
99 |
|
#---- Make a new clone or update existing one: |
100 |
|
if test -e ${gcmDIR}/.git/config ; then |
101 |
|
echo "${gcmDIR}/.git/config exist" |
102 |
|
else |
103 |
|
echo -n "${gcmDIR}/.git/config missing ; " |
104 |
|
checkOut=3 |
105 |
|
echo "will get new clone ( checkOut=$checkOut )" |
106 |
fi |
fi |
107 |
else |
if [ $checkOut -eq 3 ] ; then |
108 |
echo "no dir: $gcmDIR/CVS => try a fresh check-out" |
echo -n "Removing old clone: $TST_DIR/${gcmDIR} ..." |
109 |
checkOut=2 |
test -e $TST_DIR/${gcmDIR} && rm -rf $TST_DIR/${gcmDIR} |
110 |
fi |
echo " done" |
111 |
fi |
echo -n "Make a new clone of $git_code from repo: $git_repo ..." |
112 |
if [ $checkOut -eq 2 ] ; then |
git clone https://github.com/$git_repo/${git_code}.git ${gcmDIR} 2> $tmpFil |
113 |
if test -e $gcmDIR ; then |
retVal=$? |
114 |
rm -rf $gcmDIR |
if test $retVal = 0 ; then |
115 |
|
echo ' --> done!' |
116 |
|
rm -f $tmpFil |
117 |
|
else |
118 |
|
echo " Error: 'git clone' returned: $retVal" |
119 |
|
cat $tmpFil |
120 |
|
rm -f $tmpFil |
121 |
|
exit 2 |
122 |
|
fi |
123 |
|
else |
124 |
|
# echo "clean tst_2+2 + testreport output" |
125 |
|
( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean ) |
126 |
|
( cd $gcmDIR/verification ; ./testreport -clean ) |
127 |
|
echo "Updating current clone ( $git_code ) ..." |
128 |
|
( cd ${gcmDIR}; git checkout master ; git pull ; git ls-files -d | xargs git checkout -- ) |
129 |
|
echo ' --> done!' |
130 |
fi |
fi |
131 |
# cvs co MITgcm |
else |
132 |
cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack co -P -d $gcmDIR MITgcm > /dev/null 2>&1 |
cd $TST_DIR |
|
/usr/bin/find $gcmDIR -type d | xargs chmod g+rxs |
|
|
/usr/bin/find $gcmDIR -type f | xargs chmod g+r |
|
133 |
fi |
fi |
134 |
|
|
135 |
cd ${gcmDIR}/verification |
cd ${TST_DIR}/${gcmDIR}/verification |
136 |
|
|
137 |
cwd=\`pwd\` |
cwd=\`pwd\` |
138 |
SENDCMD="ssh ollie0 ${TST_DIR}/${gcmDIR}/tools/mpack-1.6/mpack" |
SENDCMD="ssh ollie0 ${TST_DIR}/${gcmDIR}/tools/mpack-1.6/mpack" |
139 |
runtestreport="./testreport $options -of $OPTFILE -command \"${EXE}\" -send \"${SENDCMD}\" -sd ${cwd}" |
runtestreport="./testreport $options -of $OPTFILE -command \"${EXE}\" -send \"${SENDCMD}\" -sd ${cwd}" |
140 |
|
emailaddress="-a jm_c@mitgcm.org" |
141 |
|
testrestart="../tools/do_tst_2+2 -mpi -exe \"${EXE}\" -o ${dNam}-c -send \"${SENDCMD}\" -sd ${cwd}" |
142 |
|
|
143 |
if [ ! -e $MYOUTPUT ] |
if [ ! -e $MYOUTPUT ] |
144 |
then |
then |
160 |
#SBATCH --time=12:00:00 |
#SBATCH --time=12:00:00 |
161 |
#SBATCH --ntasks=6 |
#SBATCH --ntasks=6 |
162 |
|
|
163 |
# still need this to be able to run a few experiments: |
# still need this to be able to run a few experiments: |
164 |
# cfc_example, fizhi, tutorial_deep_convection |
# cfc_example, fizhi, tutorial_deep_convection |
165 |
ulimit -s unlimited |
ulimit -s unlimited |
166 |
|
|
167 |
# # for debugging |
# binds OpenMP task to given cores |
168 |
|
export OMP_PROC_BIND=TRUE |
169 |
|
|
170 |
|
# for debugging |
171 |
# export FLEXLM_DIAGNOSTICS=2 |
# export FLEXLM_DIAGNOSTICS=2 |
172 |
# export FNP_IP_ENV=1 |
# export FNP_IP_ENV=1 |
173 |
# export LM_A_CONN_TIMEOUT=99 |
# export LM_A_CONN_TIMEOUT=99 |
177 |
cwd=`pwd` |
cwd=`pwd` |
178 |
echo "running testreport like this in \${cwd}:" |
echo "running testreport like this in \${cwd}:" |
179 |
echo "${runtestreport} -devel -match 10" |
echo "${runtestreport} -devel -match 10" |
180 |
${runtestreport} -devel -match 10 -a jmc@mitgcm.org >> $MYOUTPUT 2>&1 |
${runtestreport} -devel -match 10 ${emailaddress} >> $MYOUTPUT 2>&1 |
181 |
|
|
182 |
echo "running testreport like this in \${cwd}:" |
echo "running testreport like this in \${cwd}:" |
183 |
echo "./testreport -clean" |
echo "./testreport -clean" |
184 |
./testreport -clean |
./testreport -clean |
185 |
|
|
186 |
|
# Hack,hack,hack to avoid running dome: |
187 |
|
rm -f dome/results/output.txt |
188 |
echo "running testreport like this in \${cwd}:" |
echo "running testreport like this in \${cwd}:" |
189 |
echo "${runtestreport} -fast -match 10" |
echo "${runtestreport} -fast -match 10" |
190 |
${runtestreport} -fast -match 10 -a jmc@mitgcm.org >> $MYOUTPUT 2>&1 |
${runtestreport} -fast -match 10 ${emailaddress} >> $MYOUTPUT 2>&1 |
191 |
|
|
192 |
|
echo "running restart test like this in \${cwd}:" |
193 |
|
echo "${testrestart}" |
194 |
|
${testrestart} ${emailaddress} >> $MYOUTPUT 2>&1 |
195 |
|
|
196 |
EOF |
EOF |
197 |
|
|
207 |
echo "***********************************************************" >> $MYOUTPUT |
echo "***********************************************************" >> $MYOUTPUT |
208 |
echo " " >> $MYOUTPUT |
echo " " >> $MYOUTPUT |
209 |
|
|
210 |
|
echo "sbatch $HERE/$RUNIT" |
211 |
sbatch $HERE/$RUNIT |
sbatch $HERE/$RUNIT |
212 |
|
|
213 |
# # keep looking for the job in the job queues and wait until it has disappeared |
# # keep looking for the job in the job queues and wait until it has disappeared |
228 |
# fn=`ls -dtr tr_$dNam* | grep -v tar.gz | tail -1` |
# fn=`ls -dtr tr_$dNam* | grep -v tar.gz | tail -1` |
229 |
# echo "fname ${fn}" |
# echo "fname ${fn}" |
230 |
# tar cf - $fn | gzip > "${fn}.tar.gz" |
# tar cf - $fn | gzip > "${fn}.tar.gz" |
231 |
# $MPACKCMD -s MITgcm-test -m 3555000 ${fn}.tar.gz jmc@mitgcm.org |
# $MPACKCMD -s MITgcm-test -m 3555000 ${fn}.tar.gz jm_c@mitgcm.org |
232 |
# sleep 2 |
# sleep 2 |
233 |
# rm -rf "${fn}.tar.gz" |
# rm -rf "${fn}.tar.gz" |
234 |
|
|
235 |
echo "end of mitgcmtestreport" |
echo "end of mitgcmtestreport" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|