From 7b5e2944afcadffc255a765ee696e8df66ce9350 Mon Sep 17 00:00:00 2001
From: "nicolas.marie" <nicolas.marie@ensiie.eu>
Date: Thu, 21 Dec 2023 15:42:31 +0100
Subject: [PATCH] fixe benchmark

---
 Projet/CODE/apm/bench.sh | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/Projet/CODE/apm/bench.sh b/Projet/CODE/apm/bench.sh
index b78e145..49f4988 100755
--- a/Projet/CODE/apm/bench.sh
+++ b/Projet/CODE/apm/bench.sh
@@ -4,7 +4,7 @@
 files=("dna/vicPac2_1.fa" "dna/vicPac2_2.fa" "dna/vicPac2_3.fa")
 matches=("12345" "1234567890" "12345678901234567890")
 runs=("apm" "apm_omp" "apm_gpu")
-timeout=30
+timeout=3
 
 echo -n "# test iteration, file_size (o), match_size (o), version," >&2
 echo " time (s) (timeout = ${timeout})" >&2
@@ -17,15 +17,17 @@ do
 		do
 			for exe in ${runs[@]}
 			do
-				echo -n "${i}, $(stat -c %s ${f}), ${#m}, ${exe}, "
 				(
-					timeout --foreground ${timeout} ./${exe} 3 ${f} ${m}
-					if [ ${?} -eq 124 ]
-					then
-						echo "timeout"
-					fi
-				) >&1 \
-				| sed -n "s/APM done in \([0-9\.]*\) s\|\(timeout\)/\1\2/p"
+					echo -n "${i}, $(stat -c %s ${f}), ${#m}, ${exe}, "
+					(
+						timeout --foreground ${timeout} ./${exe} 3 ${f} ${m}
+						if [ ${?} -eq 124 ]
+						then
+							echo "timeout"
+						fi
+					) \
+					| sed -n "s/APM done in \([0-9\.]*\) s\|\(timeout\)/\1\2/p"
+				) 2>&1
 			done
 		done
 	done
-- 
GitLab