mirror of
https://github.com/data61/MP-SPDZ.git
synced 2026-01-09 13:37:58 -05:00
Maintenance.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
import os, sys
|
||||
|
||||
sys.path.append('.')
|
||||
sys.path.insert(0, os.path.dirname(sys.argv[0]) + '/..')
|
||||
|
||||
from Compiler.compilerLib import Compiler
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
import os, sys
|
||||
|
||||
sys.path.append('.')
|
||||
sys.path.insert(0, os.path.dirname(sys.argv[0]) + '/..')
|
||||
|
||||
from Compiler.compilerLib import Compiler
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
. $(dirname $0)/run-common.sh
|
||||
dir="$(dirname $0)"
|
||||
. "$dir"/run-common.sh
|
||||
prog=${1%.sch}
|
||||
prog=${prog##*/}
|
||||
shift
|
||||
$prefix ./emulate.x $prog $* 2>&1 | tee logs/emulate-$prog
|
||||
mkdir logs 2> /dev/null
|
||||
$prefix "$dir"/../emulate.x $prog $* 2>&1 | tee logs/emulate-$prog
|
||||
|
||||
4
Scripts/list-field-protocols.sh
Executable file
4
Scripts/list-field-protocols.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo rep-field shamir mal-rep-field ps-rep-field sy-rep-field \
|
||||
atlas mal-shamir sy-shamir semi hemi temi mascot cowgear chaigear
|
||||
4
Scripts/list-ring-protocols.sh
Executable file
4
Scripts/list-ring-protocols.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo ring semi2k brain mal-rep-ring ps-rep-ring sy-rep-ring \
|
||||
spdz2k rep4-ring
|
||||
@@ -20,7 +20,7 @@ def process(tapename, res, regs):
|
||||
t = inst.type
|
||||
if issubclass(t, DirectMemoryInstruction):
|
||||
res[t.arg_format[0]] = max(inst.args[1].i + inst.size,
|
||||
res[t.arg_format[0]])
|
||||
res[t.arg_format[0]]) + 1
|
||||
for arg in inst.args:
|
||||
if isinstance(arg, RegisterArgFormat):
|
||||
regs[type(arg)] = max(regs[type(arg)], arg.i + inst.size)
|
||||
@@ -36,6 +36,27 @@ reverse_formats = dict((v, k) for k, v in ArgFormats.items())
|
||||
|
||||
regout = lambda regs: dict((reverse_formats[t], n) for t, n in regs.items())
|
||||
|
||||
print ('Memory:', dict(res))
|
||||
print ('Registers in main thread:', regout(regs))
|
||||
print ('Registers in other threads:', regout(thread_regs))
|
||||
def output(data):
|
||||
for t, n in data.items():
|
||||
if n:
|
||||
try:
|
||||
print('%10d %s' % (n, ArgFormats[t.removesuffix('w')].name))
|
||||
except:
|
||||
pass
|
||||
|
||||
total = 0
|
||||
for x in res, regs, thread_regs:
|
||||
total += sum(x.values())
|
||||
|
||||
print ('Memory:')
|
||||
output(res)
|
||||
|
||||
print ('Registers in main thread:')
|
||||
output(regout(regs))
|
||||
|
||||
if thread_regs:
|
||||
print ('Registers in other threads:')
|
||||
output(regout(thread_regs))
|
||||
|
||||
print ('The program requires at the very least %f GB of RAM per party.' % \
|
||||
(total * 8e-9))
|
||||
|
||||
@@ -31,8 +31,8 @@ run_player() {
|
||||
prog=${prog##*/}
|
||||
prog=${prog%.sch}
|
||||
shift
|
||||
if ! test -e $SPDZROOT/logs; then
|
||||
mkdir $SPDZROOT/logs
|
||||
if ! test -e logs; then
|
||||
mkdir logs
|
||||
fi
|
||||
params="$prog $* -pn $port -h localhost"
|
||||
if $SPDZROOT/$bin 2>&1 | grep -q '^-N,'; then
|
||||
@@ -47,7 +47,7 @@ run_player() {
|
||||
set -o pipefail
|
||||
for i in $(seq 0 $[players-1]); do
|
||||
>&2 echo Running $prefix $SPDZROOT/$bin $i $params
|
||||
log=$SPDZROOT/logs/$log_prefix$i
|
||||
log=logs/$log_prefix$i
|
||||
$prefix $SPDZROOT/$bin $i $params 2>&1 |
|
||||
{
|
||||
if test "$BENCH"; then
|
||||
@@ -58,11 +58,27 @@ run_player() {
|
||||
} &
|
||||
codes[$i]=$!
|
||||
done
|
||||
ctrlc()
|
||||
{
|
||||
pkill -P $$
|
||||
}
|
||||
trap ctrlc SIGINT
|
||||
for i in $(seq 0 $[players-1]); do
|
||||
wait ${codes[$i]} || return 1
|
||||
if ! wait ${codes[$i]}; then
|
||||
for i in $(seq 1 $[players-1]); do
|
||||
echo === Party $i
|
||||
tail -n 3 logs/$log_prefix$i
|
||||
done
|
||||
return 1
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
getopts N: opt $(getopt N: $* 2>/dev/null)
|
||||
if test "$opt" = N; then
|
||||
PLAYERS=$OPTARG
|
||||
fi
|
||||
|
||||
players=${PLAYERS:-2}
|
||||
|
||||
SPDZROOT=${SPDZROOT:-.}
|
||||
|
||||
Reference in New Issue
Block a user