[mpich-discuss] How to terminate MPI_Comm_accept

Roy, Hirak Hirak_Roy at mentor.com
Wed Oct 8 14:36:56 CDT 2014


Hi Pavan,

I tried doing dup on both sides as well as on the client side only.
Both cases, it did not work.

Thanks,
Hirak

Here is the server-side

  MPI_Comm dupCom ;
  MPI_Comm_dup (MPI_COMM_SELF, &dupCom);
  do {
    MPI_Comm newComm ;
    MPI_Comm_accept (m_serverPort.c_str(), MPI_INFO_NULL, 0, dupCom, &newComm);
    int buf = 0 ;
    MPI_Status status ;
    Log ("Waiting on receive");
    MPI_Recv(&buf, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, newComm, &status);
    Log ("Receive complete");
    if (status.MPI_TAG == MPI_MSG_TAG_NEW_CONN) {
      m_clientComs[m_clientCount] = newComm ;
      m_clientCount++;
    } else if (status.MPI_TAG == MPI_MSG_TAG_SHUTDOWN) {
      Log ("Shutdown");
      MPI_Comm_disconnect (&newComm);
      Log ("Disconnect");
      break;
    } else {
      Log ("Unmatched Receive");
    }
  } while(1) ;




Are you doing MPI_Comm_dup while the other thread is doing MPI_Comm_accept?

  - Pavan


From: Roy, Hirak
Sent: Thursday, October 09, 2014 12:55 AM
To: discuss at mpich.org
Subject: Re: Re: Re: How to terminate MPI_Comm_accept


Hi Pavan,



Does not work.

Crash in nemesis.

Sock hangs in MPI_Recv/MPI_Send





Thanks,

Hirak



  MPI_Comm newComm ;

  MPI_Comm dupCom ;

  MPI_Comm_dup (MPI_COMM_SELF, &dupCom);

  MPI_Comm_connect (m_serverPort.c_str(), MPI_INFO_NULL, 0, dupCom, &newComm);

  Log ("Connect to Self");

  int val = 0 ;

  MPI_Request req ;

  MPI_Send(&val, 1, MPI_INT, 0, MPI_MSG_TAG_SHUTDOWN, newComm);

  Log ("Successful");

  MPI_Comm_disconnect(&newComm);









On Oct 8, 2014, at 11:41 AM, Roy, Hirak <Hirak_Roy at mentor.com<https://lists.mpich.org/mailman/listinfo/discuss>> wrote:

> Is there any way to come out of the blocking accept?



You can dup MPI_COMM_SELF and do the connect using that other communicator.



  - Pavan



--

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpich.org/pipermail/discuss/attachments/20141008/c99c5ef4/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