Hi Huiwei,

 

Thanks for your response.

 

I don’t think the solution you suggested will work.

MPI_Comm_accept is a blocking MPI call and the call does not return until there is a matching MPI_Comm_connect or implementation specified timeout ( the timeout can not be configured and reasonably high).

So when Thread2 is waiting on MPI_Comm_accept, it neither can receive any message nor can check any shared flag value.

 

That’s why I tried to terminate the accept by connecting from thread1.

 

Please let me know if you have any other suggestion.

 

Thanks,

Hirak