LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Brian Barrett (brbarret_at_[hidden])
Date: 2007-12-16 22:39:19


On Dec 12, 2007, at 1:09 AM, Rayne wrote:

> I'm getting segmentation fault errors when I try to
> send/receive 2 rows of a matrix as a block, and I
> can't figure out why.
>
> Basically, I have a 4x5 matrix with an extra top row
> and an extra leftmost column, making it a (4+1)x(5+1)
> matrix stored in P0. I'm trying to send the 2nd and
> 3rd row as a block to P1, print out the contents, send
> the 4th and 5th row as a block to P1, then print out
> the contents again. I have dynamically allocated a
> (4+1)x(5+1) memory block to cellblock, then used the
> pointers cell[i] to point to each "row" of cellblock,
> so I can access the 2D array by cell[i][j].
>
> I get the correct output, but with segmentation fault
> at the end.

You have an error in your allocation / setup of the cell array. We've
found that basic questions like this from yahoo e-mail addresses tend
to be from students doing homework, so generally don't completely
solve the problem on this list. It's pretty easy to figure out if you
use a debugger -- the problem has nothing to do with MPI and would be
a problem in a serial code as well. I'd recommend using a debugger to
track the problem down -- have a look at the LAM/MPI FAQ:

   http://www.lam-mpi.org/faq/category6.php3

Hope this helps,

Brian

-- 
   Brian Barrett
   LAM/MPI Developer
   Make today a LAM/MPI day!