CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Code parallelization using Pstream: simultaneous send/receive deadlocking

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By wyldckat

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   July 9, 2012, 06:14
Question Code parallelization using Pstream: simultaneous send/receive deadlocking
  #1
Senior Member
 
Tomislav Maric
Join Date: Mar 2009
Location: Darmstadt, Germany
Posts: 284
Blog Entries: 5
Rep Power: 21
tomislav_maric is on a distinguished road
Hi everyone,

I am trying to write the simplest parallel code that involves simultaneous communication accross processes:

Proc1: Send(0),Receive(0)

Proc2: Send(1),Receive(1)

Of course, such code will experience a deadlock. There are multiple solutions for this beginner problem: exchanging the order of Send/Receive based on the process rank, using non-blocking communication, using buffered communication (bSend, bRecv), etc.

Both the problem and possible solutions are explained here (Note: if the links don't work by clicking, copy/paste them):

http://www.ncsa.illinois.edu/UserInf...IDeadlock.html

and here:

http://www.cs.ucsb.edu/~hnielsen/cs140/mpi-deadlocks.html

So. I have tried to use these solutions in OpenFOAM, sending/receiving a scalarField around, and I keep getting errors. I linked the application source below, where you can uncomment parts of the code to get specific solutions (described in the links above). What I find strange is:

  • the code deadlocks when I properly combine blocking send/receive and receive/send
  • the code experiences FoamFatalError when I use nonBlocking communication: UPstream::waitRequests() is an empty function, Pstream::nRequests() returns 0 regardless of the number of outstanding nonBlocking requests in the program


I am not sure if I am missing something obvious, but it seems strange that every option I try, fails.


Also: I've switched on the Pstream debugSwitch in etc/controlDict, but I still don't see the debug info comming from the UPstream.C in the Pstream/mpi folder. This looks like my application is using the dummy implementation of UPstream and its children, instead of linking with stuff from Pstream/mpi.



Download link (OpenFOAM 2.0.x):


http://dl.dropbox.com/u/3316983/pStr...leExchange.tgz


Tomislav

Last edited by tomislav_maric; July 9, 2012 at 06:31.
tomislav_maric is offline   Reply With Quote

 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is the Better Way to Do CFD? John C. Chien Main CFD Forum 54 April 23, 2001 08:10
Open source CFD code development, possible? Dr. Yazid Bindar Main CFD Forum 27 July 18, 2000 00:18
State of the art in CFD technology Juan Carlos GARCIA SALAS Main CFD Forum 39 November 1, 1999 14:34
public CFD Code development Heinz Wilkening Main CFD Forum 38 March 5, 1999 11:44
What kind of Cmmercial CFD code you feel well? Lans Main CFD Forum 13 October 27, 1998 10:20


All times are GMT -4. The time now is 10:48.