[MPI] Efficient way to have views on arrays
Hi, I've started to use the MPI Boost library in conjunction with the usual C library. I'lm trying to get as much as possible done with Boost directly. I'd like to use it in a parallel finite difference loop. This means that before each iteration I have to send a strip of my computed data to each neighbor (getting the neighbors is done through a C MPI function). This can be done with MPI_Type_vector (constant-stride data) in C. Does someone know how it can be done with Boost.MPI ? Matthieu -- Information System Engineer, Ph.D. Website: http://matthieu-brucher.developpez.com/ Blogs: http://matt.eifelle.com and http://blog.developpez.com/?blog=92 LinkedIn: http://www.linkedin.com/in/matthieubrucher
On Dec 19, 2008, at 9:30 PM, Matthieu Brucher wrote:
Hi,
I've started to use the MPI Boost library in conjunction with the usual C library. I'lm trying to get as much as possible done with Boost directly. I'd like to use it in a parallel finite difference loop. This means that before each iteration I have to send a strip of my computed data to each neighbor (getting the neighbors is done through a C MPI function). This can be done with MPI_Type_vector (constant-stride data) in C. Does someone know how it can be done with Boost.MPI ?
This is not directly supported but will be easy to add by overloading the get_mpi_datatype function and specializing the is_mpi_datatype traits class for your type. get_mpi_datatype should create the appropriate MPI Datatype using MPI_Type_vector. The nicer way will be to make tis more general by creating a strided_array wrapper for Boost.Serialization and to overload get_mpi_datatype for that wrapper - this will make it more useful for other classes. Matthias
2008/12/21 Matthias Troyer
On Dec 19, 2008, at 9:30 PM, Matthieu Brucher wrote:
Hi,
I've started to use the MPI Boost library in conjunction with the usual C library. I'lm trying to get as much as possible done with Boost directly. I'd like to use it in a parallel finite difference loop. This means that before each iteration I have to send a strip of my computed data to each neighbor (getting the neighbors is done through a C MPI function). This can be done with MPI_Type_vector (constant-stride data) in C. Does someone know how it can be done with Boost.MPI ?
This is not directly supported but will be easy to add by overloading the get_mpi_datatype function and specializing the is_mpi_datatype traits class for your type. get_mpi_datatype should create the appropriate MPI Datatype using MPI_Type_vector.
OK, I will have to create a new wrapper class over my data for this. I would like to define the underlying MPI_Type_vector only once (besides, the documentation says it is automatically used somewhere, but where?), in case the MPI library uses some optimizations.
The nicer way will be to make tis more general by creating a strided_array wrapper for Boost.Serialization and to overload get_mpi_datatype for that wrapper - this will make it more useful for other classes.
This would be outside my current knowledge of both Boost.Serialization and Boost.MPI. But indeed, it would be great. Matthieu -- Information System Engineer, Ph.D. Website: http://matthieu-brucher.developpez.com/ Blogs: http://matt.eifelle.com and http://blog.developpez.com/?blog=92 LinkedIn: http://www.linkedin.com/in/matthieubrucher
(besides, the documentation says it is automatically used somewhere, but where?)
Hi, The tutorial says that MPI_Type_vector is automatically used by Boost.MPI, but where ? I've searched through the whole source code, and MPI_Type_vector only appears in the documentation ! Matthieu -- Information System Engineer, Ph.D. Website: http://matthieu-brucher.developpez.com/ Blogs: http://matt.eifelle.com and http://blog.developpez.com/?blog=92 LinkedIn: http://www.linkedin.com/in/matthieubrucher
participants (2)
-
Matthias Troyer
-
Matthieu Brucher