[mpich-discuss] mpich-discuss Digest, Vol 47, Issue 29

toufik hadjazi h_toufik7 at hotmail.fr
Sun Aug 26 14:50:58 CDT 2012


yeah, sure; that's why I thought the two functions are uninterruptable.
 > From: mpich-discuss-request at mcs.anl.gov
> Subject: mpich-discuss Digest, Vol 47, Issue 29
> To: mpich-discuss at mcs.anl.gov
> Date: Sun, 26 Aug 2012 12:00:04 -0500
> 
> Send mpich-discuss mailing list submissions to
> 	mpich-discuss at mcs.anl.gov
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
> or, via email, send a message with subject or body 'help' to
> 	mpich-discuss-request at mcs.anl.gov
> 
> You can reach the person managing the list at
> 	mpich-discuss-owner at mcs.anl.gov
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of mpich-discuss digest..."
> 
> 
> Today's Topics:
> 
>    1. Re:  MPI_Comm_connect and MPI_Comm_accept running
>       simultaneously (Rajeev Thakur)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Sat, 25 Aug 2012 22:36:34 -0500
> From: Rajeev Thakur <thakur at mcs.anl.gov>
> To: mpich-discuss at mcs.anl.gov
> Subject: Re: [mpich-discuss] MPI_Comm_connect and MPI_Comm_accept
> 	running	simultaneously
> Message-ID: <56E942F2-C2BD-4AC5-9E79-EC775DBC911E at mcs.anl.gov>
> Content-Type: text/plain; charset=us-ascii
> 
> Did you call MPI_Init_thread with MPI_THREAD_MULTIPLE instead of MPI_Init?
> 
> On Aug 25, 2012, at 3:59 AM, toufik hadjazi wrote:
> 
> > Hi you all,
> > 
> > I'm working on a client server application, the architecture of the server and the client is pretty much the same; the scheme is : each application have three threads (receiver, worker and sender), the only difference between the two applications is in the worker thread(the processing), when I run only the two threads, the worker and (reciever or sender), it works fine, but when I start the third one, the program hangs on the instruction "MPI_Comm_connect" or "MPI_Comm_accept" with no error message just it indicates that "client.exe has stopped working".
> > I'm wondering if the problem is in "MPI_Comm_connect" and "MPI_Comm_accept" running in the same time, I thought that maybe when a thread is blocking on one of those functions, we can't switch to another thread even if his quantum is done. is it true? and is these functions can be interrupted safely?
> > P.S: I'm working with Visual C++ and QT.
> > 
> > the sender Thread:
> > while(true)
> >  {
> >  // wait up for a new message
> >  printf("receiver thread : waiting for connections...\n"); fflush(stdout);
> > 
> >  MPI_Comm_accept(localPort, MPI_INFO_NULL, 0, MPI_COMM_SELF, &client);
> >  
> >  MPI_Recv(&message, 1, MessageType, MPI_ANY_SOURCE, MPI_ANY_TAG, client, &status);
> >  
> >  //insert the message into the fifo
> >  DIH.InFifo.Insert(message);
> >  printf("A messaage has been received\n"); fflush(stdout);
> >  
> >  //disconnect from the current client
> >  MPI_Barrier(client);
> >  MPI_Comm_disconnect(&client);
> >  }
> >  
> > the sender Thread:
> > while(true)
> >  {
> >  message = DIH.OutFifo.Mov();
> >  
> >  // send a new message
> >  printf("Sender thread trying to connect to port <%s>...\n", port); fflush(stdout);
> >  MPI_Comm_connect(port, MPI_INFO_NULL, 0, MPI_COMM_SELF, &client);
> >  
> >  MPI_Send(&message, 1, MessageType, 0, 0, client);
> >  
> >  //insert the message into the fifo
> >  printf("the messaage has been sent\n"); fflush(stdout);
> >  
> >  //disconnect from the current client
> >  MPI_Barrier(client);
> >  MPI_Comm_disconnect(&client);
> >  }
> >  
> > the worker Thread:
> > while(true)
> >  {
> >  message = DIH.InFifo.Mov();
> > 
> >  printf("worker thread gonna treat a new message...\n"); fflush(stdout);
> >  switch (message.Command)
> >  {
> >  case Insertion : 
> > {
> >  printf("\ninsertion running...\n"); fflush(stdout);
> >  sleep(1);
> >  }
> >  break;
> >  case Suppression:
> >  break;
> >  case ExactMatchQuery:
> >  break;
> >  case RangeQuery:
> >  break;
> >  default:
> >  printf("command not recognized!\n");
> >  }
> >  DIH.OutFifo.Insert(message);
> >  }
> >  
> > _______________________________________________
> > mpich-discuss mailing list     mpich-discuss at mcs.anl.gov
> > To manage subscription options or unsubscribe:
> > https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> mpich-discuss mailing list
> mpich-discuss at mcs.anl.gov
> https://lists.mcs.anl.gov/mailman/listinfo/mpich-discuss
> 
> 
> End of mpich-discuss Digest, Vol 47, Issue 29
> *********************************************
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/mpich-discuss/attachments/20120826/e3617fd3/attachment.html>


More information about the mpich-discuss mailing list