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

Annotation of /MITgcm_contrib/test_scripts/engaging/test_engag_ifort_mpi

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


Revision 1.4 - (hide annotations) (download)
Sat Dec 3 15:21:36 2016 UTC (9 years, 9 months ago) by jmc
Branch: MAIN
Changes since 1.3: +2 -1 lines
improve cleaning

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

  ViewVC Help
Powered by ViewVC 1.1.22