runAll.sh 1.38 KB
Newer Older
1
2
3
4
5
#!/bin/bash

partition="P1"
exclude="c00,c01,c02"

6
# Runs in a given current directory all .ini files with the aid of the RMS
7
# Parameter 1(Optional) - Amount of executions per file. Must be a positive number
8
# Parameter 2(Optional) - Maximum amount of time in seconds needed by a single execution. Default value is 0, which indicates infinite time. Must be a positive integer.
9
10
#====== Do not modify these values =======

11
12
scriptDir="$(dirname "$0")"
source $scriptDir/../Codes/build/config.txt
13
14
15
codeDir="/Codes/build"
execDir="/Exec"
ResultsDir="/Results"
16
cores=$(bash $dir$execDir/BashScripts/getCores.sh $partition)
17
18
19
20
21
22
23
24
use_extrae=0

qty=1
if [ $# -ge 1 ]
then
  qty=$1
fi

25
26
27
28
29
30
limit_time=$((0))
if [ $# -ge 2 ] #Max time per execution in seconds
then
  limit_time=$(($2 * $qty / 60 + 1))
fi

31
32
33
34
35
files="./*.ini"
internalIndex=$(echo $files | tr -cd ' ' | wc -c)
index=$((0))
for config_file in $files
do
36
  node_qty=$(bash $dir$execDir/BashScripts/getMaxNodesNeeded.sh $config_file $dir $cores)
37
38
39
40
41
42
43
44
45
46
47

  outFileIndex=$(echo $config_file | sed s/[^0-9]//g)
  if [[ $outFileIndex ]]; then 
    index=$outFileIndex
  else 
    index=$internalIndex
    ((internalIndex++))
  fi

  #Execute test
  echo "Execute job $index with Nodes=$node_qty and config_file=$config_file"
48
  sbatch -p $partition --exclude=$exclude -N $node_qty -t $limit_time $dir$execDir/generalRun.sh $dir $cores $config_file $use_extrae $index $qty
49
50
done
echo "End"