Opened 17 years ago

Last modified 17 years ago

#27 closed defect

send-recv deadlock — at Initial Version

Reported by: Stephen Siegel Owned by: zirkel
Priority: major Milestone:
Component: examples Version: 1.0
Keywords: deadlock send recv message-passing diffusion Cc:

Description

To do a message-passing data exchange, you need to send first, receive second. Otherwise deadlock will ensue. In diffusion example, the receives happen first (check for this in other examples as well):

{{
void exchange_ghost_cells() {

if(left >= 0) send(v[1], left, 0);
if(right < nprocs){

recv(v[nxl+1], right, 0);

send(v[nxl], right, 0);

}
if(left >= 0) recv(v[0], left, 0);

}
}}

Change History (0)

Note: See TracTickets for help on using tickets.