MPyC command line

An MPyC program is a Python program that uses the MPyC runtime, typically by including from mpyc.runtime import mpc. A range of options is available to control the MPyC program and its runtime from the command line.

To get help about the MPyC options, use switch -H (or, --HELP) like in these examples:

$ python -m mpyc -H
$ python helloworld.py -H
$ python -c "from mpyc.runtime import mpc" -H

In addition, an MPyC program may have its own command line interface, on top of the MPyC interface, accessible through switch -h (or, --help) like in this example:

$ python bnnmnist.py -h
Showing help message for bnnmnist.py, if available:

usage: bnnmnist.py [-h] [-b B] [-o O] [-d D] [--no-legendre] [--no-vectorization]

options:
  -h, --help            show this help message and exit
  -b B, --batch-size B  number of images to classify
  -o O, --offset O      offset for batch (otherwise random in [0,10000-B])
  -d D, --d-k-star D    k=D=0,1,2 for Legendre-based comparison using d_k^*
  --no-legendre         disable Legendre-based comparison
  --no-vectorization    disable vectorization of comparisons

It is useful to note that an MPyC program is not required to provide help via -h, hence -h may simply be ignored, or the program is not able to handle it.

The command line options for the MPyC runtime generally use upper case for single-letter options, reserving lower case for the single-letter options of MPyC programs:

usage: mpycprog.py [-V] [-H] [-h] [-C ini] [-P addr] [-M m] [-I i] [-T t]
                   [-B b] [--ssl] [-W w] [-L l] [-K k] [--log-level ll]
                   [--no-log] [--no-async] [--no-barrier] [--no-gmpy2]
                   [--no-numpy] [--no-uvloop] [--no-prss] [--mix32-64bit]
                   [--output-windows] [--output-file] [-f F]

MPyC help

-V, --VERSION

print MPyC version number and exit

Default: False

-H, --HELP

print this help message for MPyC and exit

Default: False

-h, --help

print help message for this MPyC program (if any)

Default: False

MPyC configuration

To set up the parties and network connections.

-C, --config

use ini file, defining all m parties

-P

use addr=host:port per party (repeat m times)

-M

use m local parties (and run all m, if i is not set)

-I, --index

set index of this local party to i, 0<=i<m

-T, --threshold

threshold t, 0<=t<m/2

-B, --base-port

use port number b+i for party i

--ssl

enable SSL connections

Default: False

-W, --workers

maximum number of worker threads per party

MPyC parameters

To control the secure computation and underlying protocols.

-L, --bit-length

default bit length l for secure numbers

Default: 32

-K, --sec-param

security parameter k, leakage probability 2**-k

Default: 30

--log-level

logging level ll=debug/info(default)/warning/error

Default: “info”

--no-log

disable logging messages

Default: False

--no-async

disable asynchronous evaluation

Default: False

--no-barrier

disable barriers

Default: False

--no-gmpy2

disable use of gmpy2 package

Default: False

--no-numpy

disable use of numpy package

Default: False

--no-uvloop

disable use of uvloop (winloop) package

Default: False

--no-prss

disable use of PRSS (pseudorandom secret sharing)

Default: False

--mix32-64bit

enable mix of 32-bit and 64-bit platforms

Default: False

MPyC misc

--output-windows

screen output for parties 0<i<m (one window each)

Default: False

--output-file

append output of parties 0<i<m to party{m}_{i}.log

Default: False

-f

consume IPython’s -f argument F

Default: “”