2021-04-09 17:21:31 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
## IMPORTANT: start cycle will always be 1 because of the intention of this
|
|
|
|
## script and the way it is written now. In fact, var. $START is not used at
|
|
|
|
## the moment.
|
|
|
|
|
|
|
|
## Call: $ ./run_test.sh <{sm1|sm2|sm3|maponia3}> <start cycle> <stop cycle>
|
|
|
|
## Example: ./run_test.sh sm2 1 500
|
|
|
|
|
2021-06-21 14:29:24 +02:00
|
|
|
TEST=test_h5.O2
|
2021-04-09 17:21:31 +02:00
|
|
|
ALGO=$1
|
|
|
|
START=$2
|
|
|
|
STOP=$3
|
|
|
|
BLOCKSIZE=329
|
2021-05-07 17:11:04 +02:00
|
|
|
#TOLERANCE=1e-3
|
|
|
|
TOLERANCE=$4
|
2021-04-09 17:21:31 +02:00
|
|
|
|
|
|
|
BLOCKS=$((STOP / BLOCKSIZE))
|
|
|
|
LEFT=$((STOP % BLOCKSIZE))
|
|
|
|
|
|
|
|
if [[ $LEFT -ne 0 ]]
|
|
|
|
then
|
|
|
|
BSTART=0
|
|
|
|
BSTOP=0
|
|
|
|
LAST=0
|
|
|
|
for ((i=1; i<=$BLOCKS; i++))
|
|
|
|
do
|
|
|
|
BSTART=$(((i-1)*BLOCKSIZE+1))
|
|
|
|
BSTOP=$((i*BLOCKSIZE-1))
|
2021-05-05 11:51:22 +02:00
|
|
|
$TEST $ALGO $BSTART $BSTOP $TOLERANCE
|
2021-04-09 17:21:31 +02:00
|
|
|
LAST=$i
|
|
|
|
done
|
|
|
|
LSTART=$((LAST*BLOCKSIZE+1))
|
|
|
|
LSTOP=$((LSTART+LEFT-1))
|
2021-05-05 11:51:22 +02:00
|
|
|
$TEST $ALGO $LSTART $LSTOP $TOLERANCE
|
2021-04-09 17:21:31 +02:00
|
|
|
else
|
|
|
|
for ((i=1; i<=$BLOCKS; i++))
|
|
|
|
do
|
|
|
|
BSTART=$(((i-1)*BLOCKSIZE+1))
|
|
|
|
BSTOP=$((i*BLOCKSIZE-1))
|
2021-05-05 11:51:22 +02:00
|
|
|
$TEST $ALGO $BSTART $BSTOP $TOLERANCE
|
2021-04-09 17:21:31 +02:00
|
|
|
done
|
|
|
|
fi
|