-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_experiments.sh
executable file
·121 lines (108 loc) · 2.76 KB
/
run_experiments.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
117
118
119
120
121
#!/bin/bash
distortion_type="distortion"
runtime_type="runtime"
scalability_type="scalability"
convergence_type="convergence"
num_fis_type="numFreqItemsets"
sig_fis_type="sigFreqItemsets"
all_type="all"
confs_dir=experiments/confs
figures_dir=experiments/figures
usage() {
echo "Usage ./$(basename "$0") [-ht]"
echo
echo "$(basename "$0") runs a specified type of experiment for ROhAN on"
echo "all configuration files in $confs_dir/<experiment_type> or all"
echo "experiments in $confs_dir"
echo
echo "-h display this help menu"
echo "-t experiment_type run the type of experiment"
echo " types: $distortion_type, $runtime_type,"
echo " $scalability_type, $convergence_type,"
echo " $num_fis_type, $sig_fis_type,"
echo " $all_type"
exit
}
while getopts :ht: options; do
case $options in
h) usage ;;
t) experiment_type=$OPTARG ;;
:)
echo "Argument needed for option -$OPTARG"
usage
;;
*)
echo "Invalid option -$OPTARG"
usage
;;
esac
done
run() {
experiment_class=$1
experiment_confs_dir=$2
for conf_file in "$confs_dir"/"$experiment_confs_dir"/*.json; do
java -cp target/ROhAN-1.0-SNAPSHOT-jar-with-dependencies.jar \
"rohan.experiments.$experiment_class" "$conf_file"
done
}
distortion() {
dir=$distortion_type
run "DistortionExperiment" $dir
}
runtime() {
dir=$runtime_type
run "RuntimeExperiment" $dir
}
scalability() {
dir=$scalability_type
run "RuntimeExperiment" $dir
cd $figures_dir || {
echo "Error changing directory to $figures_dir"
echo "Scalability figures were not be generated"
return
}
./gen_scalability_figs.py ../results/scalability
cd ../..
}
convergence() {
dir=$convergence_type
run "ConvergenceExperiment" $dir
cd $figures_dir || {
echo "Error changing directory to $figures_dir"
echo "Convergence figures were not be generated"
return
}
for result in ../results/convergence/*.json; do
./gen_convergence_fig.py "$result"
done
cd ../..
}
num_fis() {
dir=$num_fis_type
run "NumFreqItemsetsExperiment" $dir
}
sig_fis() {
dir=$sig_fis_type
run "SigFreqItemsetsExperiment" $dir
}
all() {
distortion
runtime
scalability
convergence
num_fis
sig_fis
}
case $experiment_type in
"$distortion_type") distortion ;;
"$runtime_type") runtime ;;
"$scalability_type") scalability ;;
"$convergence_type") convergence ;;
"$num_fis_type") num_fis ;;
"$sig_fis_type") sig_fis ;;
"$all_type") all ;;
*)
echo "Invalid experiment type: $experiment_type"
usage
;;
esac