-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserial_test.sh
More file actions
executable file
·61 lines (55 loc) · 1.29 KB
/
serial_test.sh
File metadata and controls
executable file
·61 lines (55 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
#SBATCH --job-name=serial
#SBATCH --output=results-serial.log
#SBATCH --ntasks=1
#SBATCH --nodes=1
#SBATCH --cpus-per-task=1
#SBATCH --time=02:00:00
#SBATCH --reservation=fri
while [[ $# -gt 0 ]]; do
case $1 in
-i|--input)
INPUT="$2"
shift # past argument
shift # past value
;;
-k|--kluster)
KLUSTERS="$2"
shift # past argument
shift # past value
;;
-t|--iterations)
ITERATIONS="$2"
shift # past argument
shift # past value
;;
-r|--repeat)
REPEAT="$2"
shift # past argument
shift # past value
;;
-*|--*)
echo "Unknown option $1"
exit 1
;;
*)
POSITIONAL_ARGS+=("$1") # save positional arg
shift # past argument
;;
esac
done
set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters
rm serial_out*
for ((i = 1 ; i <= $REPEAT ; i++)); do
./serial.out ~/Stiskanje-Slike-PS/images/png/bird.png -k $KLUSTERS -i $ITERATIONS -s 12345 > serial_out${i}.txt
done
SUM=0
rm times.txt
for ((i = 1 ; i <= $REPEAT ; i++)); do
TEMP=$(awk -F':' '{print $2}' serial_out${i}.txt | grep -o '[0-9.]\+' | awk 'NR==9 {print $1}')
echo $TEMP >> times.txt
#SUM=$(($SUM + $TEMP))
done
sed -i 's/./,/' times.txt
#OUT=$(($SUM / $REPEAT))
#echo $OUT