LAM/MPI logo

LAM/MPI General User's Mailing List Archives

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

From: Nihar Sanghvi (nsanghvi_at_[hidden])
Date: 2003-10-30 19:41:44


- I have dynamically allocated 2D array for my program.I could not pass
- it to MPI_Scatter.Anyone know about passing pointer to pointers to the
- function , which expects array as an argument.
-

You can definitely use the function. The problem would be made easier if
you are allocating contiguous memory for this 2D array. In which case you
can solve your problem by calling MPI_Scatter multiple times or by
defining an MPI_Datatype that takes into account the data pattern of
the 2D array.

If memory is not allocated contigously then it gets a little difficult
since the 1D arrays can be anywhere relative to each other.

You may also read MPI_Scatter and MPI_Scatterv documentation for this.

Powered by LAM/MPI...
---------------------------------------
Nihar Sanghvi
LAM/MPI Team
Graduate Student (Indiana University)
http://www.lam-mpi.org
--------------------------------------