-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun_benchmark_ext_dendrites_desktop
68 lines (54 loc) · 2.28 KB
/
run_benchmark_ext_dendrites_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
63
64
65
66
67
68
#!/bin/sh
# build necessary catalogue (also sets the environment to run custom Arbor installation)
#source build_catalogue
source build_catalogue_simd
benchmark () {
# name of the benchmark
name=$1
# script and arguments to be used for the benchmark
# if not existing, create a specific python version via `sudo ln -s /usr/bin/python3 /usr/bin/python3-benchmarking"
python_version="python3-benchmarking-mc"
cmd="$python_version $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 .
if [[ -n ${conn_file} ]]; then
cp ../${conn_file} .
fi
# 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 $python_version $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" "./arborNetworkConsolidationMultiComp.py -s_desc='net CA200 8h-recall (ext. dendrites, 1e-6)' -N_CA=200 -D_pc=1e-6 -runtime=28820 -recall='{\"time_start\": 28810, \"scheme\": \"ONEPULSE\", \"freq\": 100, \"N_stim\": 25}' -config_file='../config_defaultnet-like_ext_dendrites.json' -output_period=10" "" 10 "15m"
benchmark "CA200_10s-recall" "./arborNetworkConsolidationMultiComp.py -s_desc='net CA200 10s-recall' -N_CA=200 -runtime=25 -recall='{\"time_start\": 20, \"scheme\": \"ONEPULSE\", \"freq\": 100, \"N_stim\": 25}' -config_file='../config_defaultnet-like_ext_dendrites.json' -output_period=10" "" 10 "2m"