/[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.13 - (hide annotations) (download)
Tue Apr 3 00:27:08 2018 UTC (7 years, 3 months ago) by jmc
Branch: MAIN
Changes since 1.12: +10 -6 lines
- change job name & job err + std outp file names
- list the 3 different ways to access GitHub repo

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

  ViewVC Help
Powered by ViewVC 1.1.22