-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLinear-FDT.sh
executable file
·63 lines (51 loc) · 1.35 KB
/
Linear-FDT.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
#!/bin/bash
###########################################################
### VESPo benchmarks with increasing degrees
### Copyright(c) 2023 Jean-Guillaume Dumas
### usage: Linear-FDT.sh [threads] [maxlogdeg] [iterations]
###########################################################
# Number of threads
if [ $# -lt 1 ]; then
NBTHREADS=8
else
NBTHREADS=$1
fi
# Maximal degree log
if [ $# -lt 2 ]; then
MAXLD=12
else
MAXLD=$2
fi
# Number of iterations
if [ $# -lt 3 ]; then
ITER=3
else
ITER=$3
fi
# Paillier security
SECU=2048
# Polynomial degrees from 2^8 to 2^MAXLD
BEGLD=8
ENDLD=$MAXLD
SIZLD=$((ENDLD - BEGLD + 1))
LINFIL=bench_lin_vespo_P254.txt
echo "##### VESPO linear benchmarks"
echo "##### Doubling degrees from $((2**BEGLD)) to $((2**ENDLD))"
PINIT=0
if [ -e ${LINFIL} ]
then
PINIT=`grep VAUDIT ${LINFIL} | grep OK | wc -l`
fi
PASSED=0
PERCEN=0
TOTALT=$((SIZLD * ITER))
for (( LogDeg=$BEGLD; LogDeg<=$ENDLD; LogDeg++ ))
do
DEGREE=$((2**LogDeg))
echo -ne "##### Passed: \e[32m${PERCEN}%\e[0m, current degree: ${DEGREE} ...\r"
# Actual benchmark:
OMP_NUM_THREADS=${NBTHREADS} ./vespo_bench ${DEGREE} ${SECU} ${ITER} &>> ${LINFIL}
PASSED=`grep VAUDIT ${LINFIL} | grep OK | wc -l`
PERCEN=$(( (100 * (PASSED - PINIT)) / TOTALT ))
done
echo -ne "##### Passed: \e[32m${PERCEN}%\e[0m \n"