forked from krocki/LOGO-TSP-Solver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLOGO-test.sh
executable file
·36 lines (28 loc) · 1009 Bytes
/
LOGO-test.sh
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
#!/bin/bash
arg=${1:-1}
for x in $(seq 1 $arg) ; do
if [ -e "out.txt" ]; then rm out.txt; fi
if [ ! -d "results" ]; then mkdir results; fi
# iterate over files lists in "tsps"
for file in $(cat tsps); do
printf "file: $file\n"
let num=$(echo $file | sed "s/[a-zA-Z]*//g")
# execute on GPU
printf "GPU\n"
./logo --in=../tsplib/${file}.tsp --mode=cuda --err=0.05f \
--showLOInfo=1 --autoDevice \
> ./results/${num}_gpu
# iterate over desired core counts
for i in 64 32 16 8 4 2 1; do
printf "cores: $i\n"
./logo --in=../tsplib/${file}.tsp --mode=cpupar --err=0.05f \
--showLOInfo=1 --autoDevice --maxCoresCPU=$i \
> ./results/${num}_${i}_cpu
done
done
printf "\n ----- Saving $x -----\n\n"
./results.sh ${x}.csv
if [ $x -lt $arg ]; then
rm -r ./results/
fi
done