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

Contents of /MITgcm_contrib/test_scripts/engaging/test_engag_gfo_mp2

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


Revision 1.6 - (show annotations) (download)
Mon Feb 5 17:00:11 2018 UTC (8 years, 6 months ago) by jmc
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +1 -1 lines
FILE REMOVED
has not been used for a long time

1 #!/bin/bash
2 #SBATCH -J tst_gfoMp2
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_gfoMp2.stderr
8 #SBATCH -o /home/jm_c/test_engaging/output/tst_gfoMp2.stdout
9 #SBATCH --no-requeue --constraint=centos6
10
11 # $Header: /u/gcmpack/MITgcm_contrib/test_scripts/engaging/test_engag_gfo_mp2,v 1.5 2017/05/11 22:51:45 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 typ='' ; addExp='' ; skipExp=''
46 sfx='gfoMp2'
47 module add slurm
48 module add gcc
49 module add mvapich2/gcc/64/2.0b
50 #module add openmpi/gcc
51 export MPI_INC_DIR="$MPI_HOME/include"
52 #- for NetCDF:
53 module add harvard/centos6/hdf5-1.8.11_gcc-4.4.7
54 module add harvard/centos6/netcdf-4.3.0_gcc-4.4.7
55 OPTFILE="../tools/build_options/linux_amd64_gfortran"
56 options="$typ -MPI 4 -mth"
57 ulimit -s unlimited
58 #- need this to get "staf":
59 export PATH="$PATH:$HOME/bin"
60 #- note: with mpich1, need to set these 2 vars in .tcshrc
61 export OMP_NUM_THREADS=2
62 export GOMP_STACKSIZE=400m
63
64 dAlt=`date +%d` ; dAlt=`expr $dAlt % 3`
65 #if [ $dAlt -eq 1 ] ; then options="$options -fast"
66 #else options="$options -devel" ; fi
67 options="$options -devel"
68
69 checkOut=1 ; #options="$options -do"
70 #options="$options -nc" ; checkOut=1
71 #options="$options -q" ; checkOut=0
72
73 NSLOTS=$SLURM_NTASKS
74 THEDATE=`date`
75 echo '********************************************************************************'
76 echo 'Start job '$THEDATE
77 echo 'NSLOTS = '$NSLOTS
78 echo '======= NODELIST ==============================================================='
79 echo $SLURM_NODELIST
80 cat /etc/redhat-release
81 echo '======= env ===================================================================='
82 env | grep SLURM
83 echo '======= modules ================================================================'
84 module list 2>&1
85 echo '================================================================================'
86
87 #-
88 MPI_MFile="${OUTP}/mf_${sfx}"
89 mpiCMD="mpirun -hostfile TR_MFILE ./mitgcmuv"
90 #- make the testreport MPI_MFILE:
91 listNODES=`echo $SLURM_NODELIST | sed -e 's/\[/ /' -e 's/\]//' -e 's/,/ /' -e 's/-/ /'`
92 # duplicate the 2 listed nodes into a 4 list file:
93 /bin/rm -f $MPI_MFile ; touch $MPI_MFile ; pfx=''
94 for nd in $listNODES
95 do
96 if test "x$pfx" = x ; then pfx=$nd ; else
97 echo "${pfx}${nd}" >> $MPI_MFile
98 echo "${pfx}${nd}" >> $MPI_MFile
99 fi
100 done
101
102 cmdCVS='cvs -d :pserver:cvsanon@mitgcm.org:/u/gcmpack -q'
103 gcmDIR="MITgcm_$sfx"
104 cd $TST_DIR
105 #- check for disk space: relative space (99%) or absolute (10.G):
106 dsp=`df -P . | tail -1 | awk '{print $5}' | sed 's/%$//'`
107 if [ $dsp -gt 99 ] ; then
108 #dsp=`df -P . | tail -1 | awk '{print $4}'`
109 #if [ $dsp -le 100000000 ] ; then
110 echo 'Not enough space on this disk => do not run testreport.'
111 df .
112 exit
113 fi
114 if [ $checkOut -eq 1 ] ; then
115 if test -d $gcmDIR/CVS ; then
116 echo "cleaning output from $gcmDIR/verification :"
117 #- remove previous output tar files and tar & remove previous output-dir
118 /bin/rm -f $gcmDIR/verification/??_${dNam}-${sfx}_????????_?.tar.gz
119 ( cd $gcmDIR/verification
120 listD=`ls -1 -d ??_${dNam}-${sfx}_????????_? 2> /dev/null`
121 for dd in $listD
122 do
123 if test -d $dd ; then
124 tar -cf ${dd}".tar" $dd > /dev/null 2>&1 && gzip ${dd}".tar" && /bin/rm -rf $dd
125 RETVAL=$?
126 if test "x$RETVAL" != x0 ; then
127 echo "ERROR in tar+gzip prev outp-dir: $dd"
128 echo " on '"`hostname`"' (return val=$RETVAL) but continue"
129 fi
130 fi
131 done )
132 ( cd $gcmDIR/verification ; ../tools/do_tst_2+2 -clean )
133 ( cd $gcmDIR/verification ; ./testreport $typ -clean )
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 for exp2add in $addExp ; do
162 echo " add dir: $exp2add (from Contrib:verification_other)"
163 ( cd $gcmDIR/verification ; $cmdCVS co -P -d $exp2add \
164 MITgcm_contrib/verification_other/$exp2add > /dev/null )
165 done
166 /usr/bin/find $gcmDIR -type d | xargs chmod g+rxs
167 /usr/bin/find $gcmDIR -type f | xargs chmod g+r
168 fi
169 fi
170
171 #- change dir to $gcmDIR/verification dir:
172 if test -e $gcmDIR/verification ; then
173 if [ $checkOut -lt 2 ] ; then
174 echo " dir $gcmDIR/verification exist" ; fi
175 cd $gcmDIR/verification
176 else
177 echo "no dir: $gcmDIR/verification => exit"
178 exit
179 fi
180
181 echo ''
182 echo ./testreport $options -of $OPTFILE -command \'$mpiCMD\' -mf $MPI_MFile \
183 -odir ${dNam}-$sfx -send \'$SEND\' -sd $SavD -a jmc@mitgcm.org
184 ./testreport $options -of $OPTFILE -command "$mpiCMD" -mf $MPI_MFile \
185 -odir ${dNam}-$sfx -send "$SEND" -sd $SavD -a jmc@mitgcm.org
186
187 echo ''
188 echo ../tools/do_tst_2+2 -mpi -exe \'$mpiCMD\' -mf $MPI_MFile \
189 -o ${dNam}-$sfx -send \'$SEND\' -sd $SavD -a jmc@mitgcm.org
190 ../tools/do_tst_2+2 -mpi -exe "$mpiCMD" -mf $MPI_MFile \
191 -o ${dNam}-$sfx -send "$SEND" -sd $SavD -a jmc@mitgcm.org

  ViewVC Help
Powered by ViewVC 1.1.22