
Hello, Not a review, just a quick question: If I have a large array to send over MPI, and both processors know the size/shape (i.e., it doesn't have to be sent), I can send it via the C++ bindings like this: // rank 0 std::vector<int> huge(N); MPI::Datatype datatype=MPI::INT.Create_vector(N,1,1); comm.Send(&huge[0],datatype,1,1); // rank 1 std::vector<int> huge(N); MPI::Datatype datatype=MPI::INT.Create_vector(N,1,1); comm.Recv(&huge[0],datatype,0,1); The call to Create_vector takes constant time. The analogous Boost.MPI code runs serialization on huge, and seems to take linear time. Is there any way to avoid this performance hit? Thanks, Geoffrey

Oops. I found the new array optimizations in serialization CVS. It might be worth adding a note in the MPI documentation to this effect, especially since the current serialization documentation says that serializing an array translates directly into a for loop outside of the archive classes. Would it be straightforward to extend the array optimizations to handle run-time strided arrays (which are necessary to send slices of multidimensional arrays)? If simple array support required modifying (improving) serialization, would strides require it as well? Thanks, Geoffrey On Thu, Sep 07, 2006 at 10:15:56AM -0700, Geoffrey Irving wrote:
Hello,
Not a review, just a quick question:
If I have a large array to send over MPI, and both processors know the size/shape (i.e., it doesn't have to be sent), I can send it via the C++ bindings like this:
// rank 0 std::vector<int> huge(N); MPI::Datatype datatype=MPI::INT.Create_vector(N,1,1); comm.Send(&huge[0],datatype,1,1);
// rank 1 std::vector<int> huge(N); MPI::Datatype datatype=MPI::INT.Create_vector(N,1,1); comm.Recv(&huge[0],datatype,0,1);
The call to Create_vector takes constant time. The analogous Boost.MPI code runs serialization on huge, and seems to take linear time. Is there any way to avoid this performance hit?
Thanks, Geoffrey

On Sep 7, 2006, at 9:52 PM, Geoffrey Irving wrote:
Oops. I found the new array optimizations in serialization CVS. It might be worth adding a note in the MPI documentation to this effect, especially since the current serialization documentation says that serializing an array translates directly into a for loop outside of the archive classes.
Would it be straightforward to extend the array optimizations to handle run-time strided arrays (which are necessary to send slices of multidimensional arrays)? If simple array support required modifying (improving) serialization, would strides require it as well?
It will not require modifications of the serialization library if - if you just want to optimize a specific data structure of which you can control the serialization - and if you just want it for one particular archive The reason why we modified serialization, introducing the array wrapper was because - several archive types could optimize for unit stride arrays - the serialization function of a number of classes could profit With the exception of modifying the serialization of builtin arrays, the archives did not have to be touched. Thus, extending array wrapper to non unit stride arrays would be straightforward and, as far as I can see now, not require a change to the serialization library. Matthias
participants (2)
-
Geoffrey Irving
-
Matthias Troyer