knapsack MPI recursion question

11 views
Skip to first unread message

Tan Wu

unread,
Dec 2, 2008, 8:13:47 PM12/2/08
to cse6230-hpcta-fa08
Hello,

I would think that for this homework, we need to write some sort of
recursive function, which is not present in the serial code, to
calculate the values in the result matrix, am I right?

For example, if we have this 80x80 matrix and want to distribute work
evenly among 4 nodes, then each node gets a 20x80 matrix. Then the 2nd
node would get rows 20-39. In order to calculate values for row 20, we
need to know values for row 19, so we write a recursive function to
calculate values for row 19, which in turn calculates row 18, then 17,
etc... am I correct?

What I basically mean is that, each node will have to recursively
compute values for its very first row, then the rest of rows can be
built on that. Well except for the very first node.

I am just getting really bad performance with my recursion done this
way. I think I am doing it wrong, but do not see any other way of
doing it...

Thanks a lot.

Reply all
Reply to author
Forward
0 new messages