On 1 March 2016 at 23:15, Allan <
mahe...@gmail.com> wrote:
> I just tried out the socket and MPI.Comm.Join() method. The MPI.Comm.Join()
> function works when the server and client run on the same node. However, the
> MPI.Comm.Join() keeps waiting when server and client run on two separate
> nodes.
>
> fd = client.fileno()
>
> intercomm = MPI.Comm.Join(fd) <- blocked here on both the
> server and client side
At this point, I'm not sure what you are actually trying to do. You
simply cannot create a new communicator with accept/connect/join in a
non-blocking way, and unfortunatelly MPI does not have any polling
mechanism to check about requests for connection.
My suggestion about using sockets (or other mechanisms, you could use
POSIX FIFO , that could be made to work) is that now you have an
option to implement your OWN non-blocking logic. Look at this example
from the Python docs:
https://docs.python.org/2/library/socket.html#example
That way that code works is almost the same as an MPI version using
Accept()/Connect(). They are blocking, both the client and the server
block at the accept/connect call. HOWEVER, you can add more logic, e.g
making the accept() call in a separate thread and block for a
connection, while your main code is free to do other work (BTW, while
connect() blocks, Python will release the GIL, so you are fine, your
main thread will not be harmed).
At this point, it would be better if you provide us with some more
details about your actual application.