singleRun.sh 1.11 KB
Newer Older
1
2
#!/bin/bash

3
#SBATCH --exclude=c02,c01,c00
4
#SBATCH -p P1
5

6
dir="/home/martini/malleability_benchmark"
7
codeDir="/Codes/build"
8

9
10
11
nodelist=$SLURM_JOB_NODELIST
nodes=$SLURM_JOB_NUM_NODES

12
13
14
15
16
17
18
if [ $# -lt 1 ]
then
  echo "Not enough arguments. Usage:"
  echo "singleRun.sh config.ini [outFileIndex] [Qty] [Output path]"
  exit 1
fi

19
20
echo "START TEST"

21
22
#$1 == configFile
#$2 == outFileIndex
23
24
25
26
27
28
#$3 == Qty of repetitions
#$4 == Output path

configFile=$1
outFileIndex=$2
qty=1
29
30
31
32

if [ $# -gt 2 ]
then
  qty=$3
33
34
35
36
  if [ $# -gt 3 ]
  then
    output=$4
  fi
37
38
fi

39
40
41
42
43
aux=$(grep "\[resize0\]" -n $configFile | cut -d ":" -f1)
read -r ini fin <<<$(echo $aux)
diff=$(( fin - ini ))
numP=$(head -$fin $configFile | tail -$diff | cut -d ';' -f1 | grep Procs | cut -d '=' -f2)

44
45
for ((i=0; i<qty; i++))
do
46
  echo "Iter $i -- numP=$numP"
47
  mpirun $dir$codeDir/a.out $configFile $outFileIndex $nodelist $nodes 
48
done
49
50

echo "END TEST"
51
sed -i 's/application called MPI_Abort(MPI_COMM_WORLD, -100) - process/shrink cleaning/g' slurm-$SLURM_JOB_ID.out
52
53
54
55
56
57
58

if [ $# -gt 3 ]
then
  echo "Moving data to $output\nMoved files:"
  ls R${outFileIndex}_G*
  mv R${outFileIndex}_G* $output
fi