33 lines
608 B
Python
33 lines
608 B
Python
|
#!/usr/bin/env python3
|
||
|
|
||
|
import sys
|
||
|
import multiprocessing
|
||
|
import numpy as np
|
||
|
|
||
|
def doprocess(id):
|
||
|
|
||
|
import time
|
||
|
|
||
|
sys.argv.extend(["--node_id", "P{}".format(id)])
|
||
|
import latticex.rosetta as rtt
|
||
|
|
||
|
import tensorflow as tf
|
||
|
import numpy as np
|
||
|
|
||
|
rtt.activate("SecureNN")
|
||
|
|
||
|
p0 = multiprocessing.Process(target=doprocess, args=(0,))
|
||
|
p1 = multiprocessing.Process(target=doprocess, args=(1,))
|
||
|
p2 = multiprocessing.Process(target=doprocess, args=(2,))
|
||
|
|
||
|
p0.daemon = True
|
||
|
p0.start()
|
||
|
p1.daemon = True
|
||
|
p1.start()
|
||
|
p2.daemon = True
|
||
|
p2.start()
|
||
|
|
||
|
|
||
|
p0.join()
|
||
|
p1.join()
|
||
|
p2.join()
|