/
run_benchmark_desktop
62 lines (48 loc) · 1.62 KB
/
run_benchmark_desktop
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
#!/bin/sh
# set environment variables required to run custom Arbor installation
source set_arbor_env_dev
benchmark () {
# name of the benchmark
name=$1
# script and arguments to be used for the benchmark
cmd="python3 $2"
echo -e "Benchmark for:\n $cmd"
# connectivity file
conn_file=$3
# number of trials to run
num_trials=$4
# sleep interval for memory tracking
slpintv=$5
# directory for storing the results
bmdir='benchmark_'$name
# create and enter directory for the results
if [[ -d $bmdir ]]; then
# ask for confirmation to remove
echo "Remove existing directory '$bmdir' (y/n)?"
read answer
if [[ $answer == "y" ]]; then
sudo rm -R -f $bmdir
mkdir $bmdir
fi
else
mkdir $bmdir
fi
cd $bmdir
# copy program files
cp -r ../*.py .
cp ../custom-catalogue.so .
cp ../${conn_file} .
# save system information
uname -a > sys_info.log
echo "---" >> sys_info.log
lscpu >> sys_info.log
echo "---" >> sys_info.log
sudo dmidecode >> sys_info.log
# start tracking the memory
sudo screen -d -m /bin/bash ../track_allocated_memory "python3" $slpintv
# use hyperfine for running the simulation trials and tracking the runtime
screen -d -m hyperfine --runs ${num_trials} --export-json 'benchmark_hyperfine.json' "$cmd"
cd ..
}
#benchmark "2N1S_basic_late" "./arborNetworkConsolidation.py -config_file='../config_smallnet2_basic_late.json' -sample_curr=1" "connections_smallnet2.txt" 10 "20s"
benchmark "CA200" "./arborNetworkConsolidation.py -s_desc='net CA200 8h-recall' -N_CA=200 -runtime=28820 -config_file='../config_defaultnet_8h-recall.json' -output_period=10" "connections_default.txt" 10 "15m"