uwhpsc-2016 / syllabus

Spring 2016 Course Syllabus and Information
15 stars 20 forks source link

Quiz #8 questions 3 & 4: Language Confusion on Deadlock #42

Open ckchmod opened 8 years ago

ckchmod commented 8 years ago

Questions 3 and 4 asked about the deadlocking issue when either MPI_Recv() or MPI_Send() is called. In 5/17 lecture, when we were going over why we need MPI_Isend(), it was mentioned that "every processor would want to send data simultaneously, and nobody is going to get to [this] receive."

Yes, the solution is to use MPI_Isend() (so data is sent one by one), but doesn't the actual deadlocking occur at the MPI_Recv() stage? Technically, if MPI_Send() is used, there is no issue sending data. It's just MPI_Receive() can't receive data. (Hence, the shouldn't the quiz answers be "Because each process would deadlock at the MPI_Recv() calls."?)

I pretty much got confused on the "subtlety" of the language used for the answer choices. (and got destroyed on this quiz).

cswiercz commented 8 years ago

I can see the issue with the language.

Each of the processes would get stuck at the MPI_Send() call because no process will have accessed the corresponding MPI_Recv() call. In this situation I would say that the deadlock occurred at the MPI_Send() since that is where all of the processes are sitting.

Because of this confusion I will give everyone credit for the third question.

The following two questions are about the array shifting code we worked with in class in Lecture #15.

As usual, assume MPI_Send( ) and MPI_Recv( ) are blocking calls. Recall that the array shift program took a long array, split up between several processes, and shifted the data in the array to the right one step at a time sending the "boundary data" from Process K to Process (K+1).

Why did we need to use the non-blocking Send / Recv variants in the array shift program?

The final question does not deadlock so I think it's fair to say that the ambiguity of terminology is irrelevant.

ckchmod commented 8 years ago

Thank you @cswiercz !