Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ckchmod opened this issue May 24, 2016 · 2 comments
Open

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

ckchmod opened this issue May 24, 2016 · 2 comments
Labels

Comments

@ckchmod
Copy link

ckchmod commented May 24, 2016

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
Copy link
Member

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
Copy link
Author

ckchmod commented May 24, 2016

Thank you @cswiercz !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants