Communication two machines
Closed this issue · 6 comments
I'm trying to communicate between two machines with SPDZ-2 but I have a problem. When I launch in both terminals, the program stops at:
Bound on port 4999
Waiting for player 0
pspdz/SPDZ-2/Player-Online.x -pn 5000 -h abcd3.joacia3.pt 0 test_io
Sent 0 to abcd3.joacia3.pt:4999
Connected to player 0
Waiting for player 1
Connected to player 1
Player 0 started.
My Name = patriciarvsousa
My number = 0
Player 0 is on machine patriciarvsousa
Player 1 started.
Player 1 is on machine patriciarvsousa
2 players
Player 0 is running on machine patriciarvsousa
Player 1 is running on machine patriciarvsousa
Bound on port 5000
loading params from: Player-Data/2-128-40/Params-Data
MAC Key p = 8449384940157956195745248785771718138
MAC Key 2 = 0x27328a009e
Opening file Programs/Schedules/test_io.sch
Number of threads I will run in parallel = 1
Number of program sequences I need to load = 1
Loading program 0 from Programs/Bytecode/test_io-0.bc
test_io-0 needs more secret mod2 memory, resizing to 8192
test_io-0 needs more secret modp memory, resizing to 8192
test_io-0 needs more clear mod2 memory, resizing to 8192
test_io-0 needs more clear modp memory, resizing to 8192
test_io-0 needs more clear integer memory, resizing to 8192
Cost of first tape:
Type p
0 = 23 Triples à 0
0 = 0 Squares à 0
0 = 30 Bits à 0
0 = 0 Inverses à 0
0 = 0 BitTriples à 0
0 = 0 BitGF2NTriples à 0
Type 2
0 = 0 Triples à 0
0 = 0 Squares à 0
0 = 0 Bits à 0
0 = 0 Inverses à 0
0 = 0 BitTriples à 0
0 = 0 BitGF2NTriples à 0
Total cost: 0
Waiting for thread 0 to be ready
I am in thread 0
Using single-threaded receiving
Setting up client to patriciarvsousa:5000 with id 0x0
Setting up client to patriciarvsousa:5001 with id 0x2
^C
And doesn't advance...
In the other terminal it stucks at "Setting up server with id 0x2"
Sent 1 to abcd3.joacia3.pt:4999
My Name = patriciarvsousa
My number = 1
2 players
Player 0 is running on machine patriciarvsousa
Player 1 is running on machine patriciarvsousa
Bound on port 5001
loading params from: Player-Data/2-128-40/Params-Data
MAC Key p = 1457053910485109919283954298759726
MAC Key 2 = 0x5f48642e76
Opening file Programs/Schedules/test_io.sch
Number of threads I will run in parallel = 1
Number of program sequences I need to load = 1
Loading program 0 from Programs/Bytecode/test_io-0.bc
test_io-0 needs more secret mod2 memory, resizing to 8192
test_io-0 needs more secret modp memory, resizing to 8192
test_io-0 needs more clear mod2 memory, resizing to 8192
test_io-0 needs more clear modp memory, resizing to 8192
test_io-0 needs more clear integer memory, resizing to 8192
Cost of first tape:
Type p
0 = 23 Triples à 0
0 = 0 Squares à 0
0 = 30 Bits à 0
0 = 0 Inverses à 0
0 = 0 BitTriples à 0
0 = 0 BitGF2NTriples à 0
Type 2
0 = 0 Triples à 0
0 = 0 Squares à 0
0 = 0 Bits à 0
0 = 0 Inverses à 0
0 = 0 BitTriples à 0
0 = 0 BitGF2NTriples à 0
Total cost: 0
Waiting for thread 0 to be ready
I am in thread 0
Using single-threaded receiving
Setting up client to patriciarvsousa:5001 with id 0x3
Setting up server with id 0x2
^C
What is my problem?
Some debug indicates to me that:
while (clients.find(id)==clients.end())
data_signal.wait();
The program stucks in this line of the file Networking/ServerSockets.cpp
Any idea?=
You have to make sure that your machines can be reached by the official hostname (as delivered by hostname
in a terminal). If ping patriciarvsousa
doesn't work, SPDZ won't work either.
I have the hostname in the etc/hosts... The machines have the same name, there are any problem?
/etc/hosts is only for hostnames of other machines, the hostname of the local machine has to be set by using the hostname
command.