-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·48 lines (35 loc) · 892 Bytes
/
setup.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
#!/bin/bash
srcdir="$(dirname "$0")/src"
cmd=sed
function getp {
eval $1=\${$1:-$2}
val=$(eval echo \$$1)
cmd="$cmd -e s|@$1@|$val|"
}
function setp {
eval $1=$2
cmd="$cmd -e s|@$1@|$2|"
}
getp srcdir $srcdir
getp LOG_N 7
getp DILUTE 1
getp Z 6
getp Z_MAX 24
getp NUM_REPLICAS 50
getp REPLICA_EXCHANGE 1
getp LOG_WARMUP_UPDATES 3
getp LOG_NUM_UPDATES 10
getp LOG_UPDATES_PER_MEAS 3
getp FULL_OUTPUT 0
getp RNG "RNG_MT19937"
log_min_meas_per_bin=${log_min_meas_per_bin:-7}
# compute derived constants
setp N $((2**LOG_N))
setp NUM_UPDATES $((2**LOG_NUM_UPDATES))
setp UPDATES_PER_MEAS $((2**LOG_UPDATES_PER_MEAS))
log_num_meas=$((LOG_NUM_UPDATES - LOG_UPDATES_PER_MEAS))
setp LOG_MAX_HIST_SIZE $(((LOG_N + log_num_meas - log_min_meas_per_bin)/2))
setp MAX_HIST_SIZE $((2**LOG_MAX_HIST_SIZE))
for f in $srcdir/*.in; do
$cmd $f > $(basename "${f%.in}")
done