FAQ  •  Login

Assignment 11: Problem 2

Moderators: Dan Negrut, ME964 Spring 2012

<<

S12klhaney

Newbie
Newbie

Posts: 32

Joined: Mon Jan 23, 2012 9:07 pm

Unread post Wed Apr 18, 2012 4:20 pm

Assignment 11: Problem 2

So for this problem ALL processes need to send data to the next process before they can receive new data from the previous process, if I am understanding this problem correctly. How can we set up the send/recv pairs so that this won't cause the code to hang for larger sizes of N due to deadlock with the plain vanilla MPI_Send? For smaller values of N the eager mode kicks in and so it seems to work fine. I understand why it is hanging for larger sizes of N, but am not sure how to fix it so that it will work properly. Thanks!

EDIT: I can get it to work using the MPI_Bsend, but are we allowed to use this version?
<<

Dan Negrut

Global Moderator
Global Moderator

Posts: 833

Joined: Wed Sep 03, 2008 12:24 pm

Unread post Fri Apr 20, 2012 8:41 am

Re: Assignment 11: Problem 2

Using the buffered send is not what i had in mind, but it's ok to implement the solution that way.

Going back to what I had in mind when I said to use MPI_Send, please see the attached pic, called "even.png". The idea was to pair processes, and have one send and one receive first. This would be the "Tic" operation. Then the process that received on Tic will send on "Toc".
In other words, during Tic, all even processes do an MPI_Send and all the odd process do an MPI_Receive. On Toc, all the even processes do an MPI_Receive and all the odd processes do an MPI_Send. This will prevent the job from hanging.

Think for a second if this works as well for the case when you launch a job with an odd number of processes (like you have in the problem -np 13). Take a piece of paper and think through the Tic/Toc scheme when you launch wiht -np 3. That should shed light on it.
I hope this helps.
Dan
even.png
even.png (143.44 KiB) Viewed 4070 times
<<

S12hatt

Newbie
Newbie

Posts: 47

Joined: Mon Jan 23, 2012 9:07 pm

Unread post Sun Apr 22, 2012 8:56 pm

Re: Assignment 11: Problem 2

This requires the use of a dummy array so that the first receive (the odd rank processes) doesn't over write the data, right?
<<

S12xlu

Newbie
Newbie

Posts: 18

Joined: Mon Jan 23, 2012 9:07 pm

Unread post Sun Apr 22, 2012 10:40 pm

Re: Assignment 11: Problem 2

S12hatt wrote:This requires the use of a dummy array so that the first receive (the odd rank processes) doesn't over write the data, right?

Yes, we do need a temporary array.

Return to ME964 Spring 2012: High Performance Computing

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software.