Sorry for the delay in replying.

If you have non-contiguous buffers, you might want to investigate using MPI 
datatypes to describe the memory that you want to send/receive.  Google around; 
you'll find bunches of tutorials on these kinds of things.

However, be aware that for a large 2D array, this generally only works well if 
your 2D array is uniformly distributed throughout memory.

It would be best if you could actually malloc/new your 2D array as one giant 1D 
array and then setup the 2nd dimension/row pointers to point to the Right 
Places in that 1D array.  Then you can both treat it as a large, contiguous 
buffer as well as make your own custom datatypes (e.g., a datatype for columns 
in the array).


On Apr 2, 2013, at 3:28 AM, Ng Shi Wei <nsw_1...@hotmail.com> wrote:

> Dear all,
> 
> I am new in OpenMPI and writing a parallel processing program using openmpi 
> in C++ language. I would like to use the function MPI_Allreduce() but my 
> sendbuf and recvbuf datatype are pointers/arrays (2D). 
> 
> Is it possible to pass in and out the pointers/arrays using the 
> MPI_Allreduce() ?
> 
> If yes, hope can have some guidelines provided on how to write the command.
> 
> Thanks in advance.
> 
> Best Regards,
> Shi Wei
> _______________________________________________
> users mailing list
> us...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/users


-- 
Jeff Squyres
jsquy...@cisco.com
For corporate legal information go to: 
http://www.cisco.com/web/about/doing_business/legal/cri/


Reply via email to