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