1 |
jmc |
1.1 |
#!/bin/bash |
2 |
|
|
#SBATCH -J tst_pgiAdm |
3 |
|
|
#SBATCH -p fdr |
4 |
|
|
#SBATCH -t 6:00:00 |
5 |
|
|
#SBATCH --mem-per-cpu 4000 |
6 |
|
|
#SBATCH -N 1 |
7 |
|
|
#SBATCH --tasks-per-node 6 |
8 |
|
|
#SBATCH -e /home/jm_c/test_svante/output/tst_pgiAdm.stderr |
9 |
|
|
#SBATCH -o /home/jm_c/test_svante/output/tst_pgiAdm.stdout |
10 |
|
|
|
11 |
jmc |
1.2 |
# $Header: /u/gcmpack/MITgcm_contrib/test_scripts/svante/run_tst_pgiAdm.slurm,v 1.1 2017/01/13 22:40:45 jmc Exp $ |
12 |
jmc |
1.1 |
# $Name: $ |
13 |
|
|
|
14 |
|
|
if test -f /etc/profile.d/modules.sh ; then . /etc/profile.d/modules.sh ; fi |
15 |
|
|
if test -f /etc/profile.d/zz_modules.sh ; then . /etc/profile.d/zz_modules.sh ; 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 |
|
|
headNode='svante-login' |
24 |
|
|
|
25 |
|
|
dNam='svante' |
26 |
|
|
HERE="$HOME/test_${dNam}" |
27 |
|
|
OUTP="$HERE/output"; SavD="$HERE/send" |
28 |
|
|
SEND="ssh $headNode $SavD/mpack" |
29 |
|
|
TST_DISK="/net/fs09/d0/jm_c" |
30 |
|
|
TST_DIR="$TST_DISK/test_${dNam}" |
31 |
|
|
|
32 |
|
|
cd $TST_DISK ; pwd |
33 |
|
|
if test -d $TST_DIR ; then |
34 |
|
|
echo "start from TST_DIR='$TST_DIR' at: "`date` |
35 |
|
|
else |
36 |
|
|
echo "ERROR: missing directory \"$TST_DIR\"" |
37 |
|
|
exit 1 |
38 |
|
|
fi |
39 |
|
|
|
40 |
|
|
sfx='pgiAdm'; typ='-adm' |
41 |
|
|
addExp='' |
42 |
|
|
module add pgi/16.9 |
43 |
|
|
module add openmpi |
44 |
|
|
module add netcdf |
45 |
|
|
OPTFILE="../tools/build_options/linux_amd64_pgf77" |
46 |
|
|
#- needed for DIVA with MPI: |
47 |
|
|
export MPI_INC_DIR="/home/software/pgi/16.9/linux86-64/2016/mpi/openmpi-1.10.2/include" |
48 |
|
|
options="$typ -MPI 6" |
49 |
|
|
#- need this to get "staf": |
50 |
|
|
#export PATH="$PATH:$HOME/bin" |
51 |
|
|
|
52 |
|
|
#dAlt=`date +%d` ; dAlt=`expr $dAlt % 3` |
53 |
|
|
#if [ $dAlt -eq 1 ] ; then options="$options -fast" |
54 |
|
|
#else options="$options -devel" ; fi |
55 |
|
|
|
56 |
|
|
NSLOTS=$SLURM_NTASKS |
57 |
|
|
THEDATE=`date` |
58 |
|
|
echo '********************************************************************************' |
59 |
|
|
echo 'Start job '$THEDATE |
60 |
|
|
echo 'NSLOTS = '$NSLOTS |
61 |
|
|
echo '======= NODELIST ===============================================================' |
62 |
|
|
echo $SLURM_NODELIST |
63 |
|
|
cat /etc/redhat-release |
64 |
|
|
echo '======= env ====================================================================' |
65 |
|
|
env | grep SLURM |
66 |
|
|
echo '======= modules ================================================================' |
67 |
|
|
module list 2>&1 |
68 |
|
|
echo '================================================================================' |
69 |
|
|
|
70 |
|
|
gcmDIR="MITgcm_$sfx" |
71 |
|
|
cd $TST_DIR |
72 |
|
|
|
73 |
|
|
#- check for disk space: relative space (99%) or absolute (10.G): |
74 |
|
|
dsp=`df -P . | tail -1 | awk '{print $5}' | sed 's/%$//'` |
75 |
|
|
if [ $dsp -gt 99 ] ; then |
76 |
|
|
#dsp=`df -P . | tail -1 | awk '{print $4}'` |
77 |
|
|
#if [ $dsp -le 100000000 ] ; then |
78 |
|
|
echo 'Not enough space on this disk => do not run testreport.' |
79 |
|
|
df . |
80 |
|
|
exit |
81 |
|
|
fi |
82 |
|
|
|
83 |
|
|
#- change dir to $gcmDIR/verification dir: |
84 |
|
|
if test -e $gcmDIR/verification ; then |
85 |
|
|
if [ $checkOut -lt 2 ] ; then |
86 |
|
|
echo " dir $gcmDIR/verification exist" ; fi |
87 |
|
|
cd $gcmDIR/verification |
88 |
|
|
else |
89 |
|
|
echo "no dir: $gcmDIR/verification => exit" |
90 |
|
|
exit |
91 |
|
|
fi |
92 |
|
|
|
93 |
|
|
#- get option -devel/-fast from head-node testreport output: |
94 |
|
|
options="$options -q" |
95 |
|
|
prevName=`grep '^on :' tr_out.txt | awk '{print $4}'` |
96 |
|
|
if test "x$prevName" = "x$headNode" ; then |
97 |
|
|
dev_Opt=`grep '^run:' tr_out.txt | grep -c ' -devel'` |
98 |
|
|
fastOpt=`grep '^run:' tr_out.txt | grep -c ' -fast'` |
99 |
|
|
if test $dev_Opt = 1 -a $fastOpt = 0 ; then |
100 |
|
|
options="$options -devel" |
101 |
|
|
fi |
102 |
|
|
if test $dev_Opt = 0 -a $fastOpt = 1 ; then |
103 |
|
|
options="$options -fast" |
104 |
|
|
fi |
105 |
|
|
else |
106 |
|
|
echo " missing previous testreport output "tr_out.txt" from $headNode" |
107 |
|
|
echo ' skip addition of -devel/-fast to $options' |
108 |
|
|
fi |
109 |
|
|
|
110 |
|
|
echo '' |
111 |
|
|
echo ./testreport $options -of $OPTFILE -odir ${dNam}-$sfx \ |
112 |
|
|
-send \"$SEND\" -sd $SavD -a jmc@mitgcm.org |
113 |
|
|
./testreport $options -of $OPTFILE -odir ${dNam}-$sfx \ |
114 |
|
|
-send "$SEND" -sd $SavD -a jmc@mitgcm.org |
115 |
|
|
|
116 |
|
|
#echo '' |
117 |
|
|
#echo ../tools/do_tst_2+2 -mpi -o ${dNam}-$sfx \ |
118 |
|
|
# -send \"$SEND\" -sd $SavD -a jmc@mitgcm.org |
119 |
|
|
#../tools/do_tst_2+2 -mpi -o ${dNam}-$sfx \ |
120 |
|
|
# -send "$SEND" -sd $SavD -a jmc@mitgcm.org |
121 |
|
|
|