Opened 17 years ago
Closed 17 years ago
#27 closed defect (fixed)
send-recv deadlock
| Reported by: | Stephen Siegel | Owned by: | zirkel |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | examples | Version: | 1.0 |
| Keywords: | deadlock send recv message-passing diffusion | Cc: |
Description (last modified by )
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);
}
I guess in this case it won't deadlock because of the boundaries, but it will force sequentialization.
Change History (3)
comment:1 by , 17 years ago
| Description: | modified (diff) |
|---|
comment:2 by , 17 years ago
| Status: | new → accepted |
|---|
comment:3 by , 17 years ago
| Resolution: | → fixed |
|---|---|
| Status: | accepted → closed |
Note:
See TracTickets
for help on using tickets.

Changed.