fix base dir
authorLaurent Mazet <mazet@softndesign.org>
Sat, 11 Oct 2025 19:06:34 +0000 (21:06 +0200)
committerLaurent Mazet <mazet@softndesign.org>
Sat, 11 Oct 2025 19:06:34 +0000 (21:06 +0200)
generatecandle.sh
generateplot.sh
gettable.sh
test.sh

index bd8d58480816f988d68bd6a24aa70b34c59fb122..adf1899f226591741e74120e1fb35a0b827a94f5 100755 (executable)
@@ -1,15 +1,19 @@
 #!/bin/sh
 
-tmp=$(mktemp)
+base=$(cd $(dirname $0); pwd)
 
 for csv; do
   core="any core"
-  sed 1d $csv | cut -d, -f1 | sort | uniq | while IFS=$'\n' read name; do
-    output=$(echo $name| awk '{ print tolower($1) }').pdf
-    awk -F, '$1 == "'"$name"'" { sub (/[^,]*,/, ""); gsub (/,/, " "); print }' $csv > $tmp
+  sed 1d $csv | cut -d, -f1 | sort | uniq | while IFS=$'\n' read title; do
 
-    cat candles.gp | \
-      m4 -D CORE="$core" -D DATA="$tmp" -D NAME="$name" | \
+    name=$($base/getname.sh "$title")
+
+    output=$name.pdf
+
+    awk -F, '$1 == "'"$title"'" { sub (/[^,]*,/, ""); gsub (/,/, " "); print }' $csv > $name.tab
+
+    cat $base/candles.gp | \
+      m4 -D CORE="$core" -D DATA="$name.tab" -D NAME="$name" | \
       gnuplot > "$output"
   done
 done
index 6af786f3a29e2d50ca32d4d1fbf81b34fca619aa..161710b4ffd58a84e661cbfae1bfc9301a49cba8 100755 (executable)
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+base=$(cd $(dirname $0); pwd)
+
 for data; do
   log=$(echo $data | sed 's/\.dat/.log/')
 
@@ -8,12 +10,12 @@ for data; do
   load=$(echo $data | sed 's/.*-\([0-9]*\)%.*/\1%/')
 
   output=$(echo $data | sed 's/\.dat/-raw.pdf/')
-  cat rawmeasures.gp | \
+  cat $base/rawmeasures.gp | \
     m4 -D CORE="$core" -D DATA="$data" -D LOAD="$load" -D NAME="$name" | \
     gnuplot > $output
 
   output=$(echo $data | sed 's/\.dat/-hist.pdf/')
-  cat histogram.gp | \
+  cat $base/histogram.gp | \
     m4 -D CORE="$core" -D DATA="$data" -D LOAD="$load" -D NAME="$name" | \
     gnuplot > $output
 done
index 5139c216e067c2b0a70ec96f276974886a2cbd0d..910f561de00d5843afe8d308026693bebc61b6a5 100755 (executable)
@@ -1,13 +1,15 @@
 #!/bin/sh
 
+base=$(cd $(dirname $0); pwd)
+
 echo "Test,Load (%),Minimum (us),Average (us),Maximun (us),Standard Dev. (us),25th % (us),Median (us),75th % (us)"
 
 nbcpu=$(grep -c processor /proc/cpuinfo)
 for t in *.exe; do
-  t=${t/.exe/};
+  t=$(echo $t | sed 's/\.exe//');
   for k in $(seq 0 $nbcpu); do
     p=$(expr $k \* 100 / $nbcpu)
     f=$t-$p%.log
-    [ -f $f ] && awk -f gettable.awk -v COMMENT=$p $f
+    [ -f $f ] && awk -f $base/gettable.awk -v COMMENT=$p $f
   done
 done
diff --git a/test.sh b/test.sh
index e9bdc789cb68fa528968318cb2ffa5358a75f748..9c871b9854f401dc26d8a7b75839904dac093999 100755 (executable)
--- a/test.sh
+++ b/test.sh
@@ -1,11 +1,11 @@
 #!/bin/sh
 
-function run() {
+run() {
   cpu=$1
   load=$2
   for exe in *.exe; do
-    test=${exe/.exe/}
-    echo -e "\033[0;1mTest $test\033[0;0m"
+    test=$(echo $exe | sed 's/\.exe//')
+    echo "\033[0;1mTest $test\033[0;0m"
     ./getinfo.sh | tee $test-$load.log
     { ./$exe -d 1 -n 10000 -s -o $test-$load.dat | tee -a $test-$load.log; \
       kill -2 $(ps -e | awk '/[l]oad/ || /[s]leep/ { print $1 }') 2>/dev/null; } &