1 |
jmc |
1.1 |
#!/bin/bash |
2 |
|
|
#SBATCH -J tst_ifcMpi |
3 |
|
|
#SBATCH -p sched_mit_hill |
4 |
|
|
#SBATCH --mem-per-cpu 4000 |
5 |
|
|
#SBATCH -N 2 |
6 |
|
|
#SBATCH --tasks-per-node 4 |
7 |
|
|
#SBATCH -e /home/jm_c/test_engaging/output/tst_ifcMpi.stderr |
8 |
|
|
#SBATCH -o /home/jm_c/test_engaging/output/tst_ifcMpi.stdout |
9 |
|
|
#SBATCH --no-requeue --constraint=centos6 |
10 |
|
|
|
11 |
|
|
# $Header: /u/gcmpack/MITgcm_contrib/test_scripts/engaging/test_engag_ifort_mpi,v 1.7 2017/02/11 16:51:10 jmc Exp $ |
12 |
|
|
# $Name: $ |
13 |
|
|
|
14 |
|
|
if test -f /etc/profile.d/modules.sh ; then |
15 |
|
|
. /etc/profile.d/modules.sh |
16 |
|
|
fi |
17 |
|
|
# Note: added "ulimit -s unlimited" in file "~/.bashrc" |
18 |
|
|
# to pass big test (the 2 fizhi-cs-* test & adjoint tests) with MPI |
19 |
|
|
|
20 |
|
|
umask 0022 |
21 |
|
|
#- to get case insensitive "ls" (and order of tested experiments) |
22 |
|
|
export LC_ALL="en_US.UTF-8" |
23 |
|
|
echo " running on: "`hostname` |
24 |
|
|
|
25 |
|
|
dNam='engaging' |
26 |
|
|
HERE="$HOME/test_$dNam" |
27 |
|
|
OUTP="$HERE/output"; SavD="$HERE/send" |
28 |
|
|
SEND="ssh eofe4 $SavD/mpack" |
29 |
|
|
TST_DIR="/pool001/jm_c/test_$dNam" |
30 |
|
|
|
31 |
|
|
if test -d $TST_DIR ; then |
32 |
|
|
echo "start from TST_DIR='$TST_DIR' at: "`date` |
33 |
|
|
else |
34 |
|
|
#if test ! -d /scratch/jm_c ; then mkdir /scratch/jm_c ; fi |
35 |
|
|
#if test ! -d $TST_DIR ; then mkdir $TST_DIR ; fi |
36 |
|
|
#if test ! -d $TST_DIR ; then |
37 |
|
|
# echo "ERROR: Can't create directory \"$TST_DIR\"" |
38 |
|
|
# exit 1 |
39 |
|
|
#fi |
40 |
|
|
#echo "start in new dir TST_DIR='$TST_DIR' at: "`date` |
41 |
|
|
echo "ERROR: missing directory \"$TST_DIR\"" |
42 |
|
|
exit 1 |
43 |
|
|
fi |
44 |
|
|
|
45 |
|
|
sfx='ifcMpi'; typ='' |
46 |
|
|
addExp='global_oce_cs32 global_oce_llc90' |
47 |
|
|
module add slurm |
48 |
|
|
module add gcc |
49 |
|
|
module add engaging/intel/2013.1.046 |
50 |
|
|
#export MPI_INC_DIR="$MPI_HOME/include" |
51 |
|
|
OPTFILE="../tools/build_options/linux_amd64_ifort+impi" |
52 |
|
|
mpiCMD="mpirun -env I_MPI_DEBUG 2 -n TR_NPROC ./mitgcmuv" #- currently not used |
53 |
|
|
options="-j 4 $typ -MPI 8" |
54 |
|
|
#export OMP_NUM_THREADS=2 |
55 |
|
|
#export KMP_SLAVE_STACK_SIZE=400m |
56 |
|
|
#options="$options -gsl" |
57 |
|
|
#export GSL_IEEE_MODE=double-precision,mask-underflow,mask-denormalized |
58 |
|
|
ulimit -s unlimited |
59 |
|
|
#- need this to get "staf" & "do_make_syntax.sh": |
60 |
|
|
export PATH="$PATH:$HOME/bin" |
61 |
|
|
|
62 |
|
|
dAlt=`date +%d` ; dAlt=`expr $dAlt % 3` |
63 |
|
|
if [ $dAlt -eq 1 ] ; then options="$options -ur4 -match 5" ; fi |
64 |
|
|
options="$options -devel" |
65 |
|
|
|
66 |
|
|
checkOut=1 ; #options="$options -do" |
67 |
|
|
#options="$options -nc" ; checkOut=1 |
68 |
|
|
#options="$options -q" ; checkOut=0 |
69 |
|
|
|
70 |
|
|
NSLOTS=$SLURM_NTASKS |
71 |
|
|
THEDATE=`date` |
72 |
|
|
echo '********************************************************************************' |
73 |
|
|
echo 'Start job '$THEDATE |
74 |
|
|
echo 'NSLOTS = '$NSLOTS |
75 |
|
|
echo '======= NODELIST ===============================================================' |
76 |
|
|
echo $SLURM_NODELIST |
77 |
|
|
cat /etc/redhat-release |
78 |
|
|
echo '======= env ====================================================================' |
79 |
|
|
env | grep SLURM |
80 |
|
|
echo '======= modules ================================================================' |
81 |
|
|
module list 2>&1 |
82 |
|
|
echo '================================================================================' |
83 |
|
|
|
84 |
|
|
#- |
85 |
|
|
MPI_MFile="${OUTP}/mf_${sfx}" #- currently not used |
86 |
|
|
#mpiCMD="mpirun -hostfile TR_MFILE -n TR_NPROC ./mitgcmuv" |
87 |
|
|
#- make the testreport MPI_MFILE: |
88 |
|
|
listNODES=`echo $SLURM_NODELIST | sed -e 's/\[/ /' -e 's/\]//' -e 's/,/ /' -e 's/-/ /'` |
89 |
|
|
# duplicate the 2 listed nodes into a 6 list file: |
90 |
|
|
/bin/rm -f $MPI_MFile ; touch $MPI_MFile |
91 |
|
|
for nc in `seq 1 4` ; do pfx='' |
92 |
|
|
for nd in $listNODES ; do |
93 |
|
|
if test "x$pfx" = x ; then pfx=$nd ; else |
94 |
|
|
echo "${pfx}${nd}" >> $MPI_MFile |
95 |
|
|
fi |
96 |
|
|
done |
97 |
|
|
done |
98 |
|
|
|
99 |
|
|
cmdCVS='cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack -q' |
100 |
|
|
gcmDIR="MITgcm_$sfx" |
101 |
|
|
cd $TST_DIR |
102 |
|
|
#- check for disk space: relative space (99%) or absolute (10.G): |
103 |
|
|
dsp=`df -P . | tail -1 | awk '{print $5}' | sed 's/%$//'` |
104 |
|
|
if [ $dsp -gt 99 ] ; then |
105 |
|
|
#dsp=`df -P . | tail -1 | awk '{print $4}'` |
106 |
|
|
#if [ $dsp -le 100000000 ] ; then |
107 |
|
|
echo 'Not enough space on this disk => do not run testreport.' |
108 |
|
|
df . |
109 |
|
|
exit |
110 |
|
|
fi |
111 |
|
|
if [ $checkOut -eq 1 ] ; then |
112 |
|
|
if test -d $gcmDIR/CVS ; then |
113 |
|
|
echo "cleaning output from $gcmDIR/verification :" |
114 |
|
|
#- remove previous output tar files and tar & remove previous output-dir |
115 |
|
|
/bin/rm -f $gcmDIR/verification/??_${dNam}-${sfx}_????????_?.tar.gz |
116 |
|
|
( cd $gcmDIR/verification |
117 |
|
|
listD=`ls -1 -d ??_${dNam}-${sfx}_????????_? 2> /dev/null` |
118 |
|
|
for dd in $listD |
119 |
|
|
do |
120 |
|
|
if test -d $dd ; then |
121 |
|
|
tar -cf ${dd}".tar" $dd > /dev/null 2>&1 && gzip ${dd}".tar" && /bin/rm -rf $dd |
122 |
|
|
RETVAL=$? |
123 |
|
|
if test "x$RETVAL" != x0 ; then |
124 |
|
|
echo "ERROR in tar+gzip prev outp-dir: $dd" |
125 |
|
|
echo " on '"`hostname`"' (return val=$RETVAL) but continue" |
126 |
|
|
fi |
127 |
|
|
fi |
128 |
|
|
done ) |
129 |
|
|
echo "clean tst_2+2 + testreport output (+ Makefile_syntax files)" |
130 |
|
|
( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean ) |
131 |
|
|
( cd $gcmDIR/verification ; ./testreport $typ -clean ) |
132 |
|
|
( cd $gcmDIR/verification ; rm -f */build/Makefile_syntax ) |
133 |
|
|
( cd $gcmDIR/verification ; rm -f */build/port_rand.i */build/ptracers_set_iolabel.i ) |
134 |
|
|
echo "cvs update of dir $gcmDIR :" |
135 |
|
|
( cd $gcmDIR ; $cmdCVS update -P -d ) 2>&1 |
136 |
|
|
RETVAL=$? |
137 |
|
|
if test "x$RETVAL" != x0 ; then |
138 |
|
|
echo "cvs update on '"`hostname`"' fail (return val=$RETVAL) => exit" |
139 |
|
|
exit |
140 |
|
|
fi |
141 |
|
|
else |
142 |
|
|
echo "no dir: $gcmDIR/CVS => try a fresh check-out" |
143 |
|
|
checkOut=2 |
144 |
|
|
fi |
145 |
|
|
fi |
146 |
|
|
if [ $checkOut -eq 2 ] ; then |
147 |
|
|
if test -e $gcmDIR ; then |
148 |
|
|
echo -n "Removing working copy: $gcmDIR ..." |
149 |
|
|
rm -rf $gcmDIR |
150 |
|
|
echo " done" |
151 |
|
|
fi |
152 |
|
|
# cvs co MITgcm |
153 |
|
|
echo "Downloading using '$cmdCVS co -P -d $gcmDIR MITgcm' ..." |
154 |
|
|
$cmdCVS co -P -d $gcmDIR MITgcm > /dev/null |
155 |
|
|
RETVAL=$? |
156 |
|
|
if test "x$RETVAL" != x0 ; then |
157 |
|
|
echo "cvs co on '"`hostname`"' fail (return val=$RETVAL) => exit" |
158 |
|
|
exit |
159 |
|
|
else echo " done" ; fi |
160 |
|
|
if test -d $gcmDIR/verification ; then |
161 |
|
|
/usr/bin/find $gcmDIR -type d | xargs chmod g+rxs |
162 |
|
|
/usr/bin/find $gcmDIR -type f | xargs chmod g+r |
163 |
|
|
fi |
164 |
|
|
fi |
165 |
|
|
|
166 |
|
|
# -change dir to $gcmDIR/verification dir + add additional experiments: |
167 |
|
|
if test -e $gcmDIR/verification ; then |
168 |
|
|
if [ $checkOut -lt 2 ] ; then |
169 |
|
|
echo " dir $gcmDIR/verification exist" ; fi |
170 |
|
|
cd $gcmDIR/verification |
171 |
|
|
for exp2add in $addExp ; do |
172 |
|
|
if test -d ${exp2add}/CVS ; then |
173 |
|
|
echo " assumes dir: $exp2add has been updated" |
174 |
|
|
else |
175 |
|
|
test -r $exp2add && /bin/rm -rf $exp2add |
176 |
|
|
echo " add dir: $exp2add (from Contrib:verification_other)" |
177 |
|
|
( $cmdCVS co -P -d $exp2add \ |
178 |
|
|
MITgcm_contrib/verification_other/$exp2add > /dev/null ) |
179 |
|
|
if test $exp2add = 'global_oce_cs32' ; then |
180 |
|
|
echo " link dir 'other_input/core2_cnyf' in here" |
181 |
|
|
( cd ${exp2add} ; ln -s ../../../other_input/core2_cnyf . ) |
182 |
|
|
fi |
183 |
|
|
if test $exp2add = 'global_oce_llc90' ; then |
184 |
|
|
echo " link dir 'other_input/gael_oce_llc90_input' to 'input_fields'" |
185 |
|
|
( cd ${exp2add} ; ln -s ../../../other_input/gael_oce_llc90_input input_fields ) |
186 |
|
|
echo " link dirs: 'core2_cnyf' & 'global_oce_input_fields/*' in input_verifs" |
187 |
|
|
( test ! -e ${exp2add}/input_verifs && mkdir ${exp2add}/input_verifs |
188 |
|
|
cd ${exp2add}/input_verifs |
189 |
|
|
ln -s ../../../../other_input/core2_cnyf . |
190 |
|
|
ln -s ../../../../other_input/global_oce_input_fields/* . ) |
191 |
|
|
fi |
192 |
|
|
/usr/bin/find $exp2add -type d | xargs chmod g+rxs |
193 |
|
|
/usr/bin/find $exp2add -type f | xargs chmod g+r |
194 |
|
|
fi |
195 |
|
|
done |
196 |
|
|
else |
197 |
|
|
echo "no dir: $gcmDIR/verification => exit" |
198 |
|
|
exit |
199 |
|
|
fi |
200 |
|
|
|
201 |
|
|
echo '' |
202 |
|
|
echo ./testreport $options -of $OPTFILE -odir ${dNam}-$sfx \ |
203 |
|
|
-nc -repl_mk do_make_syntax.sh -obj -dd |
204 |
|
|
./testreport $options -of $OPTFILE -odir ${dNam}-$sfx \ |
205 |
|
|
-nc -repl_mk do_make_syntax.sh -obj -dd |
206 |
|
|
|
207 |
|
|
echo '' |
208 |
|
|
echo ./testreport $options -of $OPTFILE -odir ${dNam}-$sfx \ |
209 |
|
|
-q -send \"$SEND\" -sd $SavD -a jmc@mitgcm.org |
210 |
|
|
# -command \"$mpiCMD\" -mf $MPI_MFile \ |
211 |
|
|
./testreport $options -of $OPTFILE -odir ${dNam}-$sfx \ |
212 |
|
|
-q -send "$SEND" -sd $SavD -a jmc@mitgcm.org |
213 |
|
|
# -command "$mpiCMD" -mf $MPI_MFile \ |
214 |
|
|
|
215 |
|
|
echo '' |
216 |
|
|
echo ../tools/do_tst_2+2 -mpi -o ${dNam}-$sfx \ |
217 |
|
|
-send \"$SEND\" -sd $SavD -a jmc@mitgcm.org |
218 |
|
|
# -exe \"$mpiCMD\" -mf $MPI_MFile \ |
219 |
|
|
../tools/do_tst_2+2 -mpi -o ${dNam}-$sfx \ |
220 |
|
|
-send "$SEND" -sd $SavD -a jmc@mitgcm.org |
221 |
|
|
# -exe "$mpiCMD" -mf $MPI_MFile \ |
222 |
|
|
|