Skip to content
Snippets Groups Projects
Commit 2f631b8d authored by erwan's avatar erwan
Browse files

Cycle_unison: split Sh/search_config.sh to produce .org files afterwards

parent 6d5453fb
No related branches found
No related tags found
No related merge requests found
#!/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
......@@ -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
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment