I tried to do : pthread_cancel(thread2).
This terminates the blocking accept.
However, MPI_Finalize hangs.
Regards,
Hirak
From: Roy, Hirak
Sent: Wednesday, October 08, 2014 9:28 AM
To: discuss@mpich.org
Subject: Re: How to terminate MPI_Comm_accept
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