From 2f631b8d00c05476c7d5b87271944e1d8ca23383 Mon Sep 17 00:00:00 2001 From: Erwan Jahier <erwan.jahier@univ-grenoble-alpes.fr> Date: Fri, 22 Jul 2022 16:30:49 +0200 Subject: [PATCH] Cycle_unison: split Sh/search_config.sh to produce .org files afterwards --- test/Cycle_unison/Sh/do_org_lines.sh | 58 +++++++++++++++++++++++++++ test/Cycle_unison/Sh/search_config.sh | 27 +------------ test/unison/Makefile | 14 ++++++- 3 files changed, 71 insertions(+), 28 deletions(-) create mode 100644 test/Cycle_unison/Sh/do_org_lines.sh diff --git a/test/Cycle_unison/Sh/do_org_lines.sh b/test/Cycle_unison/Sh/do_org_lines.sh new file mode 100644 index 00000000..cdfb1a0c --- /dev/null +++ b/test/Cycle_unison/Sh/do_org_lines.sh @@ -0,0 +1,58 @@ +#!/bin/bash +# Prends en argument k n topologie +# Exemple : ./search_config.sh 3 7 ring + + +set -x +if [ $# -ne 3 ] + then echo "3 arguments are expected" + echo "$0 <k> <n> <topology filename without extension" + echo "Exemple : ./search_config.sh 3 7 ring" + exit 1 +fi + +k=$1 +n=$2 +topology=$3 +log=Log/$topology${k}_$n.log + + +############################################################## +# building the org table of results using the Log/*.log files + +valid="" +invalid="" +timeout="" + +grep "ok: valid" $log && valid="true" +grep "ok: invalid" $log && invalid="true" +grep "Wallclock timeout" $log && timeout="true" + + +time=`grep "total runtime" $log | cut -d ' ' -f5` + +if [ $valid = "true" ] + then resultat="legitimate" + step=`grep "ok: " $log | cut -d ' ' -f4 | tr -d ')'` + +else if [ $invalid = "true" ] + then resultat="cycle found" + step=`grep "ok: " $log | cut -d ' ' -f4` +else if [ $timeout = "true" ] + then resultat="Timeout (${TIMEOUT})" + step=`grep "ok: " $log | cut -d ' ' -f5` + time="-" +else + resultat="..." +fi +fi +fi + +# d=$(expr $n / 2) +d=$(expr $n / 2) +dx2m1=$(expr $d \* 2 - 1) +dx3m1=$(expr $d \* 3 - 1) + + +echo "| $topology | $n | $k | $dx2m1 | $dx3m1 | $step | $resultat | $time |" > $log.org + diff --git a/test/Cycle_unison/Sh/search_config.sh b/test/Cycle_unison/Sh/search_config.sh index 037b8be1..67048aaa 100644 --- a/test/Cycle_unison/Sh/search_config.sh +++ b/test/Cycle_unison/Sh/search_config.sh @@ -40,30 +40,5 @@ mv $topology${n}_check_cycles.noexpand.lv4.tmp $topology${n}_check_cycles.noexpa [ -d Log ] || mkdir Log time kind2 --timeout ${TIMEOUT} --color false --modular true --compositional true $topology${n}_check_cycles.noexpand.lv4 > $log -d=$(expr $n / 2 \* 2 - 1) - - - -grep "ok: valid" $log && valid="true" -grep "ok: invalid" $log && invalid="true" - -time=`grep "total runtime" $log | cut -d ' ' -f5` - -if [ $valid = "true" ] - then resultat="legitimate" - step=`grep "ok: " $log | cut -d ' ' -f4 | tr -d ')'` - -else if [ $invalid = "true" ] - then resultat="cycle found" - step=`grep "ok: " $log | cut -d ' ' -f4` -else - resultat="Timeout (${TIMEOUT})" - step=`grep "ok: " $log | cut -d ' ' -f5` - time="-" -fi -fi - - -echo "| $topology | $n | $k | $d | $step | $resultat | $time |" > $log.org - +############################################################## clean $topology$n diff --git a/test/unison/Makefile b/test/unison/Makefile index 696e9a1c..13c77c70 100644 --- a/test/unison/Makefile +++ b/test/unison/Makefile @@ -37,7 +37,17 @@ kind2: $(TOPOLOGY).kind2 lesar: $(TOPOLOGY).lesar org: - echo "| Topology | n | k | inutile (car faux) | step | Resultat | time |" > resultat.org + echo "| Topology | n | k | 2xD-1 | 3xD-1 | step | Resultat | time |" > resultat.org echo "|-|" >> resultat.org - cat Log/*.org >> resultat.org + for n in `seq 3 35`; \ + do for k in `seq 3 2 35`; do \ + [ -f Log/ring$${k}_$${n}.log ] && sh Sh/do_org_lines.sh $${k} $${n} ring && \ + cat Log/ring$${k}_$${n}.log.org >> resultat.org; \ + done; \ + echo "|-|" >> resultat.org ;\ + done echo "|-|" >> resultat.org + + +RUN: + for i in `seq 3 35`; do sleep 2; sh Sh/search_config.sh 11 $i ring &; done -- GitLab