[mpich-discuss] Multithread server using MPICH-2

Rob Latham robl at mcs.anl.gov
Fri Sep 19 09:20:48 CDT 2008


Gisele Machado de Souza wrote:
> For do that I used MPI(mpich2-1.1.0a1.tar.gz) and pthreads.
> The problem I'm having is that the server and the thread are not working 
> in parallel successfully. Sometimes, the program hangs, do nothing, and 
> in another times a fatal error appears (Assertion failed in file 
> sock_wait.i at line 236: (pollfd->events & (0x001 | 0x004)) || 
> pollfd->fd == -1).

Hi. I'm afraid I don't have a good answer for you, other than we've seen 
similar problems when we try to use dynamic processes in 
MPI_THREAD_MULTIPLE environments.

Unfortunately, I can't tell you to try your code out with OpenMPI: often 
different MPI implementations can help make sure you are following the 
spec, but in this case you'll get an assertion almost immediately.

> When I put the server to sleep for a moment, before he will wait another 
> connection, during the time he was sleeping the created thread works 
> fine. Once the server wakes up and starts to wait for a connection, 
> things stop working.

That does point to some kind of race condition.

> A peace of my code (Server):

These classes of problems are quite tricky to work out.  It would be a 
huge help if you could cut down your program to the smallest possible 
test case.   I know that's a lot of work, but it would really help us 
pinpoint the problem.

==rob




More information about the mpich-discuss mailing list