singleRunCostum.sh 1.64 KB
Newer Older
1
2
3
4
5
6
7
8
9
#!/bin/bash

cores=20

# Executes a given configuration file. This script can be called with Slurm commands to 
#   choose the desired user configuration.
# Parameter 1: Configuration file name for the emulation.
# Parameter 2(Optional): Index to use for the output files. Must be a positive integer.
# Parameter 3(Optional): Number of repetitions to perform. Must be a positive integer.
10
# Parameter 4(Optional): Use Valgrind(1), Extrae(2) or nothing(0).
11
12
13
# Parameter 5(Optional): Path where the output files should be saved. 
#====== Do not modify these values =======

14
15
scriptDir="$(dirname "$0")"
source $scriptDir/../Codes/build/config.txt
16
17
18
19
20
21
22
23
24
25
26
27
28
29
codeDir="/Codes/build"
execDir="/Exec"
ResultsDir="/Results"

if [ $# -lt 1 ]
then
  echo "Not enough arguments. Usage:"
  echo "singleRunCostum.sh config.ini [outFileIndex] [Qty] [Use Extrae] [Output path]"
  exit 1
fi

#$1 == configFile
#$2 == outFileIndex
#$3 == Qty of repetitions
30
#$4 == Use external NO(0) Valgrind(1), Extrae(2)
31
32
33
34
35
#$5 == Output path

config_file=$1
outFileIndex=0
qty=1
36
use_external=0
37
38
39
40
41
42
43
44
45
46
47

if [ $# -ge 2 ]
then
  outFileIndex=$2
fi
if [ $# -ge 3 ]
then
  qty=$3
fi
if [ $# -ge 4 ]
then
48
  use_external=$4
49
50
51
52
53
54
fi
if [ $# -ge 5 ]
then
  output=$5
fi

55
bash $dir$execDir/generalRunCostum.sh $dir $cores $config_file $use_external $outFileIndex $qty
56
57
58
59
60
61
62

if ! [ -z "$output" ]
then
  mkdir -p $output
  echo "Moving data to $output\nMoved files:"
  ls R${outFileIndex}_G*
  mv R${outFileIndex}_G* $output
63
  if [ "$use_external" -eq 2 ] # Extrae additional output
64
65
66
67
  then
    mv a.out.* $output
    mv TRACE* $output
    mv set-0/ $output
68
69
70
  elif [ "$use_external" -eq 1 ] # Valgrind additional output
  then
    mv vg.* $output
71
72
  fi
fi