forked from iliastsa/img_convolution
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtime.sh
More file actions
executable file
·54 lines (32 loc) · 1003 Bytes
/
time.sh
File metadata and controls
executable file
·54 lines (32 loc) · 1003 Bytes
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
#!/bin/bash
if (( $# != 4 )); then
echo "Bad number of arguments supplied..."
exit 1
fi
input_file=$(realpath $1)
file_metadata=$(echo $1 | rev | cut -d "." -f 2 | rev)
proc_limit=$2
procs_per_machine=$3
subdir=$4
LOOPS=30 #CHANGE THIS IF NEEDED
color=$(echo $file_metadata | cut -d "_" -f 2)
color=${color^^}
width=$(echo $file_metadata | cut -d "_" -f 3)
height=$(echo $file_metadata | cut -d "_" -f 4)
prog_args="-f "$input_file" -w "$width" -h "$height" -c "$color" -l "$LOOPS
output_filename="results.csv"
for (( i=1; i*i <= proc_limit; i++ )); do
bash machines.sh $((i*i)) $procs_per_machine
cd $subdir
time=$(bash run.sh ../machines$((i*i))-$procs_per_machine $prog_args | cut -d ' ' -f 8)
if (( (i+1)*(i+1) > proc_limit )); then
echo -n $time >> $output_filename
else
echo -n $time", " >> $output_filename
fi
cd ..
done
echo "" >> $subdir/$output_filename
mv $subdir/$output_filename .
rm -f machines*-*
#echo $input_file $color $width $height $proc_limit