[mpich-discuss] How to terminate MPI_Comm_accept

Roy, Hirak Hirak_Roy at mentor.com
Tue Oct 7 06:17:41 CDT 2014


Hi All,

I am working on a MPI based server-client application.
The number of clients are not fixed.
The clients can come up at any time and will connect to server.

The server runs two threads.

Thread 1: opens a port, calls MPI_Comm_accept on a loop on MPI_COMM_SELF.
Thread 2: Distributes works among the clients.

When the client comes up, it calls MPI_Comm_connect to server.

The problem I am facing is : how to terminate the blocking MPI_Comm_accept of Therad 1, once Thread2 is done with all the work?

I tried the following thing which might not be legal to do:

Thread2 calls MPI_Comm_connect (MPI_COMM_SELF) to Thread1's port. (created a new inter-communicator newComm)
However, when I tried to send a non-blocking message to close the port from Thread2 (MPI_Isend, MPI_Wait)  to Thread1 (MPI_Irecv, MPI_Wait)  using newComm, the two threads wait forever.

Any help regarding the termination of MPI_Comm_accept will be appreciated.

Regards,
Hirak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpich.org/pipermail/discuss/attachments/20141007/5ec0db44/attachment.html>
-------------- next part --------------
_______________________________________________
discuss mailing list     discuss at mpich.org
To manage subscription options or unsubscribe:
https://lists.mpich.org/mailman/listinfo/discuss


More information about the discuss mailing list