/[MITgcm]/MITgcm_contrib/test_scripts/engaging/test_engag_op64_adm
ViewVC logotype

Annotation of /MITgcm_contrib/test_scripts/engaging/test_engag_op64_adm

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


Revision 1.12 - (hide annotations) (download)
Fri Feb 9 17:33:41 2018 UTC (7 years, 5 months ago) by jmc
Branch: MAIN
Changes since 1.11: +2 -2 lines
add "git checkout masteri" before "git pull" (safer this way).

1 jmc 1.1 #!/bin/bash
2     #SBATCH -J tst_o64Adm
3     #SBATCH -p sched_mit_hill
4     #SBATCH --mem-per-cpu 4000
5     #SBATCH -n 6
6     #SBATCH -N 2
7 jmc 1.10 #SBATCH -x node[016,030,031,073,125,198,332]
8 jmc 1.1 #SBATCH -e /home/jm_c/test_engaging/output/tst_o64Adm.stderr
9     #SBATCH -o /home/jm_c/test_engaging/output/tst_o64Adm.stdout
10 jmc 1.6 #SBATCH --no-requeue --constraint=centos6
11 jmc 1.1
12 jmc 1.12 # $Header: /u/gcmpack/MITgcm_contrib/test_scripts/engaging/test_engag_op64_adm,v 1.11 2018/02/07 19:39:19 jmc Exp $
13 jmc 1.1 # $Name: $
14    
15     if test -f /etc/profile.d/modules.sh ; then
16     . /etc/profile.d/modules.sh
17     fi
18 jmc 1.3 # Note: added "ulimit -s unlimited" in file "~/.bashrc"
19 jmc 1.1 # to pass big test (the 2 fizhi-cs-* test & adjoint tests) with MPI
20    
21     umask 0022
22     #- to get case insensitive "ls" (and order of tested experiments)
23     export LC_ALL="en_US.UTF-8"
24     echo " running on: "`hostname`
25    
26     dNam='engaging'
27     HERE="$HOME/test_$dNam"
28     OUTP="$HERE/output"; SavD="$HERE/send"
29     SEND="ssh eofe4 $SavD/mpack"
30     TST_DIR="/pool001/jm_c/test_$dNam"
31 jmc 1.11 tmpFil="/tmp/"`basename $0`".$$"
32     cmdCVS='cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack -q'
33     #- and which GitHub repository to use:
34     git_repo='MITgcm'; git_code='MITgcm'
35     #git_repo='altMITgcm'; #git_code='MITgcm66h'
36 jmc 1.1
37 jmc 1.8 typ='' ; addExp='' ; skipExp=''
38 jmc 1.1 sfx='o64Adm'; typ='-adm'
39     module add open64
40     module add mvapich2/open64/64/2.0b
41     export MPI_INC_DIR="$MPI_HOME/include"
42     OPTFILE="../tools/build_options/linux_amd64_open64"
43     #options="-j 2 -devel -gsl"
44     options="$typ -MPI 6"
45     #export OMP_NUM_THREADS=2
46     #export OMP_SLAVE_STACK_SIZE=400m
47     #export GSL_IEEE_MODE=double-precision,mask-underflow,mask-denormalized
48     ulimit -s unlimited
49     #- need this to get "staf":
50     export PATH="$PATH:$HOME/bin"
51    
52 jmc 1.11 gcmDIR="MITgcm_$sfx"
53 jmc 1.1 dAlt=`date +%d` ; dAlt=`expr $dAlt % 3`
54     if [ $dAlt -eq 1 ] ; then options="$options -fast"
55     else options="$options -devel" ; fi
56    
57 jmc 1.3 checkOut=1 ; #options="$options -do"
58 jmc 1.1 #options="$options -nc" ; checkOut=1
59     #options="$options -q" ; checkOut=0
60    
61 jmc 1.11 if test -d $TST_DIR ; then
62     echo "start from TST_DIR='$TST_DIR' at: "`date`
63     else
64     #if test ! -d $TST_DIR ; then mkdir $TST_DIR ; fi
65     #if test ! -d $TST_DIR ; then
66     # echo "ERROR: Can't create directory \"$TST_DIR\""
67     # exit 1
68     #fi
69     #echo "start in new dir TST_DIR='$TST_DIR' at: "`date`
70     echo "ERROR: missing directory \"$TST_DIR\""
71     exit 1
72     fi
73     cd $TST_DIR
74     pwd
75    
76 jmc 1.1 NSLOTS=$SLURM_NTASKS
77 jmc 1.2 THEDATE=`date`
78 jmc 1.1 echo '********************************************************************************'
79     echo 'Start job '$THEDATE
80     echo 'NSLOTS = '$NSLOTS
81     echo '======= NODELIST ==============================================================='
82     echo $SLURM_NODELIST
83 jmc 1.4 cat /etc/redhat-release
84 jmc 1.1 echo '======= env ===================================================================='
85 jmc 1.2 env | grep SLURM
86     echo '======= modules ================================================================'
87     module list 2>&1
88 jmc 1.1 echo '================================================================================'
89    
90     #- keep a copy of MPI_MFILE:
91     #cp -p $PBS_NODEFILE $OUTP"/mf_"$sfx
92    
93     #- check for disk space: relative space (99%) or absolute (10.G):
94     dsp=`df -P . | tail -1 | awk '{print $5}' | sed 's/%$//'`
95     if [ $dsp -gt 99 ] ; then
96     #dsp=`df -P . | tail -1 | awk '{print $4}'`
97     #if [ $dsp -le 100000000 ] ; then
98     echo 'Not enough space on this disk => do not run testreport.'
99     df .
100     exit
101     fi
102     if [ $checkOut -eq 1 ] ; then
103 jmc 1.11 if test -e $gcmDIR/.git/config ; then
104 jmc 1.1 echo "cleaning output from $gcmDIR/verification :"
105     #- remove previous output tar files and tar & remove previous output-dir
106     /bin/rm -f $gcmDIR/verification/??_${dNam}-${sfx}_????????_?.tar.gz
107     ( cd $gcmDIR/verification
108     listD=`ls -1 -d ??_${dNam}-${sfx}_????????_? 2> /dev/null`
109     for dd in $listD
110     do
111     if test -d $dd ; then
112     tar -cf ${dd}".tar" $dd > /dev/null 2>&1 && gzip ${dd}".tar" && /bin/rm -rf $dd
113 jmc 1.11 retVal=$?
114     if test "x$retVal" != x0 ; then
115 jmc 1.1 echo "ERROR in tar+gzip prev outp-dir: $dd"
116 jmc 1.11 echo " on '"`hostname`"' (return val=$retVal) but continue"
117 jmc 1.1 fi
118     fi
119     done )
120     # ( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean )
121     ( cd $gcmDIR/verification ; ./testreport $typ -clean )
122 jmc 1.11 echo "Update MITgcm code in dir $gcmDIR :"
123 jmc 1.12 ( cd $gcmDIR ; git checkout master ; git pull ) 2>&1
124 jmc 1.11 retVal=$?
125     if test "x$retVal" != x0 ; then
126     echo "git pull on '"`hostname`"' fail (return val=$retVal) => exit"
127 jmc 1.1 exit
128     fi
129     else
130 jmc 1.11 echo "no file: $gcmDIR/.git/config => try to download a fresh clone"
131 jmc 1.1 checkOut=2
132     fi
133     fi
134     if [ $checkOut -eq 2 ] ; then
135     if test -e $gcmDIR ; then
136 jmc 1.3 echo -n "Removing working copy: $gcmDIR ..."
137     rm -rf $gcmDIR
138     echo " done"
139 jmc 1.1 fi
140 jmc 1.11 echo -n "Make a clone of $git_code from repo: $git_repo ..."
141     git clone https://github.com/$git_repo/${git_code}.git $gcmDIR 2> $tmpFil
142     retVal=$?
143     if test $retVal = 0 ; then
144     echo ' done' ; rm -f $tmpFil
145     else
146     echo " Error: 'git clone' returned: $retVal"
147     cat $tmpFil ; rm -f $tmpFil
148 jmc 1.1 exit
149 jmc 1.11 fi
150 jmc 1.1 if test -d $gcmDIR/verification ; then
151     /usr/bin/find $gcmDIR -type d | xargs chmod g+rxs
152     /usr/bin/find $gcmDIR -type f | xargs chmod g+r
153     fi
154     fi
155    
156     #- change dir to $gcmDIR/verification dir:
157     if test -e $gcmDIR/verification ; then
158     if [ $checkOut -lt 2 ] ; then
159     echo " dir $gcmDIR/verification exist" ; fi
160     cd $gcmDIR/verification
161 jmc 1.7 for exp2add in $addExp ; do
162     if test -d ${exp2add}/CVS ; then
163 jmc 1.11 echo " update dir: $exp2add (from Contrib:verification_other)"
164     ( cd $exp2add ; $cmdCVS update -P -d ) 2>&1
165     retVal=$?
166     if test "x$retVal" != x0 ; then
167     echo "cvs update on '"`hostname`"' fail (return val=$retVal)"
168     #exit
169     fi
170 jmc 1.7 else
171     test -r $exp2add && /bin/rm -rf $exp2add
172     echo " add dir: $exp2add (from Contrib:verification_other)"
173     ( $cmdCVS co -P -d $exp2add \
174     MITgcm_contrib/verification_other/$exp2add > /dev/null )
175     /usr/bin/find $exp2add -type d | xargs chmod g+rxs
176     /usr/bin/find $exp2add -type f | xargs chmod g+r
177     fi
178     done
179 jmc 1.1 else
180     echo "no dir: $gcmDIR/verification => exit"
181     exit
182     fi
183    
184 jmc 1.8 echo ''
185     echo ./testreport $options -of $OPTFILE \
186 jmc 1.10 -odir ${dNam}-$sfx -send \'$SEND\' -sd $SavD -a jm_c@mitgcm.org
187 jmc 1.8 ./testreport $options -of $OPTFILE \
188 jmc 1.10 -odir ${dNam}-$sfx -send "$SEND" -sd $SavD -a jm_c@mitgcm.org
189 jmc 1.8
190     # echo ''
191     # echo ../tools/do_tst_2+2 -mpi \
192 jmc 1.10 # -o ${dNam}-$sfx -send \'$SEND\' -sd $SavD -a jm_c@mitgcm.org
193 jmc 1.8 # ../tools/do_tst_2+2 -mpi \
194 jmc 1.10 # -o ${dNam}-$sfx -send "$SEND" -sd $SavD -a jm_c@mitgcm.org
195 jmc 1.1

  ViewVC Help
Powered by ViewVC 1.1.22