-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdebug_single_run.sh
More file actions
executable file
·79 lines (57 loc) · 2 KB
/
debug_single_run.sh
File metadata and controls
executable file
·79 lines (57 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/sh -e
export SIM_ROOT_DIR=`pwd`
if [ "$1" = "" ]; then
echo "Usage: $0 <simparameter string> <designname> <num_processes>"
echo ""
echo "possible design names:"
ls designs/
exit
fi
num_processes=17
if [ "$3" != "" ]; then
num_processes=$3
fi
echo "Num Processes: $num_processes"
echo "Design Name: $2"
design_dir=$SIM_ROOT_DIR/designs/$2
gen_dir=$design_dir/generated_files
exp_file=$gen_dir/experiments.txt
echo ""
echo "====================="
echo "Preparing simulation:"
echo "====================="
$SIM_ROOT_DIR/helper_scripts/prepare_sim.sh $2 $exp_file
echo ""
args=$1
scenario=`mktemp`
echo "Scenario file: $scenario"
echo "==================="
echo "Scenario generation"
echo "==================="
packetlength=`cut -d' ' -f1 <<< "$args"`
framelength=`cut -d' ' -f2 <<< "$args"`
minpacketsize=`cut -d',' -f1 <<< "$args"`
echo $packetlength
echo $framelength
echo $minpacketsize
python3 $SIM_ROOT_DIR/simulator/prepare_sim/scenario_gen/frame_based.py --packetlength $packetlength --timeframe $framelength > $scenario
echo "=================="
echo "Running simulation"
echo "=================="
./run_sim.sh $scenario $2 $exp_file $num_processes;
foldername=$gen_dir/`ls -t $gen_dir/results | head -n1` #select newest
echo "=========="
echo "Evaluation"
echo "=========="
echo "evaluating $foldername"
echo "Eval start:" >> $foldername/"stats.txt"
echo `date +%Y-%m-%d.%H:%M:%S` >> $foldername/"stats.txt"
python3 $SIM_ROOT_DIR/simulator/eval_sim/eval.py --write-results $foldername/all.intmdtresults.gz --output-type key-value-pairs $foldername/all.results.gz > $foldername/eval.log
# echo "=========="
# echo "Statistics"
# echo "=========="
# echo "Eval end:" >> results/$foldername/"stats.txt"
# echo "packetlength : $packetlength" >> results/$foldername/"eval.log"
# echo "framelength : $framelength" >> results/$foldername/"eval.log"
# echo "packetlength : $minpacketsize" >> results/$foldername/"eval.log"
# echo `date +%Y-%m-%d.%H:%M:%S` >> results/$foldername/"stats.txt"