-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathrun-profile
executable file
·75 lines (63 loc) · 1.95 KB
/
run-profile
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
#!/usr/bin/env bash
set -x
set -e
# Assume that assignments have been generated into ../zeth/build
ASSIGNMENTS_DIR=../zeth/build
ZETH_TOOL=../zeth/build/zeth_tool/zeth-tool
# 1 - jsin/jsout value
function setup_files() {
# Unpack data from the archive, either from
# ${STORE_HOST}:${STORE_PATH}, or the local ${ASSIGNMENTS_DIR}
if ! [ -e assignment_$1_$1.bin ] ; then
if [ "${STORE_HOST}" != "" ] ; then
ssh ${STORE_HOST} cat ${STORE_PATH}/zeth_assignment_$1_$1.tar.bz2 |
tar -vxjf -
else
tar -vxjf ${ASSIGNMENTS_DIR}/zeth_assignment_$1_$1.tar.bz2
fi
fi
if ! [ -e assignment_$1_$1.bin ] ; then
echo no file assignment_$1_$1.bin
exit 1
fi
# If necessary, extract vk from the keypair
if ! [ -e pk_$1_$1.bin ] ; then
${ZETH_TOOL} split-keypair --pk-file pk_$1_$1.bin keypair_$1_$1.bin
fi
if ! [ -e pk_$1_$1.bin ] ; then
echo no file pk_$1_$1.bin
exit 1
fi
}
# 1 - jsin/jsout value
function remove_files() {
rm *_$1_$1.bin
}
# 1 - jsin/jsout value
# 2 - iteration
function profile_for_jsinout_iteration() {
echo "=============================================="
echo " PROFILE: $1_$1 ITERATION: $2"
echo "=============================================="
time ./run-prover pk_$1_$1.bin assignment_$1_$1.bin > profile_$1_$1_$2.txt 2>&1
}
# 1 - jsin/jsout value
function profile_for_jsinout() {
echo "=============================================="
echo " PROFILE: $1_$1"
echo "=============================================="
setup_files $1
profile_for_jsinout_iteration $1 1
profile_for_jsinout_iteration $1 2
profile_for_jsinout_iteration $1 3
remove_files $1
}
# Run for a single JSIN/OUT value, or run over all values.
if [ "" != "$1" ] ; then
profile_for_jsinout $1
else
profile_for_jsinout 8
profile_for_jsinout 16
profile_for_jsinout 32
profile_for_jsinout 64
fi