-
Notifications
You must be signed in to change notification settings - Fork 2
/
start-args-gips.sh
executable file
·117 lines (91 loc) · 3.76 KB
/
start-args-gips.sh
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/bin/bash
set -e
function setup {
# Make sure that folder for hipe-network exists
mkdir -p bin
mkdir -p metrics
mkdir -p resources
# Get resources from scenario project
if ! [[ "$(find ./resources -maxdepth 3 -type f -iname \*.json)" ]];
then
rsync -a ../vne.scenarios/resources .
fi
# Extract hipe-network.xmi file
unzip -o $JAR "network/model/rules/*/hipe-network.xmi"
rsync -a ./network ./bin
rm -r ./network
mkdir -p logs
}
function run {
# Execute the program itself and save its output to logfile
java -Xmx120g -jar $JAR $ARGS 2>&1 | tee "./logs/$RUN_NAME.log"
}
# Set env vars
source env.sh
# Config
export JAR="iflye.jar"
setup
# Example arguments:
# pm two-tier-4-pods 4 1 3
# $1 $2 $3 $4 $5
# pm two-tier-4-pods auto 1 3
export a=$1 # algorithm
export s=$2 # scenario
export l=$3 # maximum path length
export k=$4 # k fastest paths to generate
export r=$5 # number of runs
# GIPS workaround for all needed xmi files
if [ $a = "gips" ]; then
echo "=> Applying GIPS hipe-network.xmi workaround."
# Extract hipe-network.xmi file
unzip -o $JAR "org/emoflon/gips/gipsl/examples/mdvne/hipe/*/hipe-network.xmi"
unzip -o $JAR "org/emoflon/gips/gipsl/examples/mdvne/api/*/gips-model.xmi"
unzip -o $JAR "org/emoflon/gips/gipsl/examples/mdvne/api/ibex-patterns.xmi"
mkdir -p ../org.emoflon.gips.gipsl.examples.mdvne/src-gen/
mkdir -p C%3A/Users/mkratz/git/gips-examples/org.emoflon.gips.gipsl.examples.mdvne/src-gen
rsync -a ./org ./bin
rsync -a ./org ../org.emoflon.gips.gipsl.examples.mdvne/src-gen
rsync -a ./org ./C%3A/Users/mkratz/git/gips-examples/org.emoflon.gips.gipsl.examples.mdvne/src-gen
rm -r ./org
fi
# GIPS-migration workaround for all needed xmi files
if [ $a = "gips-mig" ]; then
echo "=> Applying GIPS-migration hipe-network.xmi workaround."
# Extract hipe-network.xmi file
unzip -o $JAR "org/emoflon/gips/gipsl/examples/mdvne/migration/hipe/*/hipe-network.xmi"
unzip -o $JAR "org/emoflon/gips/gipsl/examples/mdvne/migration/api/*/gips-model.xmi"
unzip -o $JAR "org/emoflon/gips/gipsl/examples/mdvne/migration/api/ibex-patterns.xmi"
mkdir -p ../org.emoflon.gips.gipsl.examples.mdvne.migration/src-gen/
mkdir -p C%3A/Users/mkratz/git/gips-examples/org.emoflon.gips.gipsl.examples.mdvne.migration/src-gen
rsync -a ./org ./bin
rsync -a ./org ../org.emoflon.gips.gipsl.examples.mdvne.migration/src-gen
rsync -a ./org ./C%3A/Users/mkratz/git/gips-examples/org.emoflon.gips.gipsl.examples.mdvne.migration/src-gen
rm -r ./org
fi
# GIPS-sequence workaround for all needed xmi files
if [ $a = "gips-seq" ]; then
echo "=> Applying GIPS-seq hipe-network.xmi workaround."
# Extract hipe-network.xmi file
unzip -o $JAR "org/emoflon/gips/gipsl/examples/mdvne/seq/hipe/*/hipe-network.xmi"
unzip -o $JAR "org/emoflon/gips/gipsl/examples/mdvne/seq/api/*/gips-model.xmi"
unzip -o $JAR "org/emoflon/gips/gipsl/examples/mdvne/seq/api/ibex-patterns.xmi"
mkdir -p ../org.emoflon.gips.gipsl.examples.mdvne.seq/src-gen/
mkdir -p C%3A/Users/mkratz/git/gips-examples/org.emoflon.gips.gipsl.examples.mdvne.seq/src-gen
rsync -a ./org ./bin
rsync -a ./org ../org.emoflon.gips.gipsl.examples.mdvne.seq/src-gen
rsync -a ./org ./C%3A/Users/mkratz/git/gips-examples/org.emoflon.gips.gipsl.examples.mdvne.seq/src-gen
rm -r ./org
fi
for ((i=1;i<=$r;i++));
do
# Without memory measurement
export RUN_NAME="${a}_${s}_l${l}_k${k}_run${i}"
export ARGS="-a $a -o total-comm-c -e emoflon_wo_update -l $l -k $k -s resources/$s/snet.json -v resources/40-vnets/vnets.json -c ./metrics/$RUN_NAME.csv -i 600"
echo "#"
echo "# => Using ARGS: $ARGS"
echo "#"
run
done
echo "#"
echo "# => Arg script done."
echo "#"