Previous | Next --- Slide 6 of 64
Back to Lecture Thumbnails
TJ

Let me summarize how this program is broken and how to fix it.

Assumption: synchronous communication

  1. Row 0 is sending downwards. Row 1-N is sending upwards. Nobody is actually receiving the msg. So nobody gets an ACK from others. Everybody simply gets stuck on the first sending.

  2. A simple way to fix this is to let the Row 0 receives the msg downwards first. The rest rows(1-N) send upwards first. After this is done, Row N receives the msg upwards first. The rest rows(0-(N-1)) send first downwards. In this way, there will be no deadlock. But the problem is the execution is cascading in the process. The process is totally sequential.

  3. A good way to explore parallelism is to pair up two consecutive rows as shown a couple slides later.