Only in the plain array benchmark I don't measure memory allocation. For both the skeleton and plain array sending of a std::vector, the memory allocation (and zero initialization) is included in the benchmark. Since I am interested in the performance of sending an amount of data not previously known by the receiver, I would rather include the memory allocation also for the plain array benchmark. However, the plain array benchmark is only there to give an upper bound. To make my point, comparing the three benchmarks involving std::vectors is sufficient, and these three benchmarks should be equivalent in terms of the work that is done.

On 20/01/14 15:37, Gonzalo Brito Gadeschi wrote:
You should call vector.reserve(n) before you call recv and benchmark again 
because otherwise you are timing a memory allocation in the vector
benchmarks that isn't there in the array benchmarks.

Bests,
Gonzalo



On Mon, Jan 20, 2014 at 3:24 PM, Simon Etter <[email protected] 
<mailto:[email protected]>> wrote:

    Hi!

    When benchmarking the performance of sending a std::vector<double> with 
Boost.MPI, I noticed that you can gain several factors of speedup if
    you replace

    std::vector<double> data(n);
    comm.send(0,0,data);

    by e.g.

    std::vector<double> data(n);
    comm.send(0,0, boost::mpi::skeleton(data));
    comm.send(0,0, boost::mpi::get_content(data))__;

    The code to benchmark, the measured data as well as a plot thereof are 
attached. Further parameters were:

    MPI implementation: Open MPI 1.6.5
    C++ compiler: gcc 4.8.2
    Compiler flags: -O3 -std=c++11
    mpirun parameter: --bind-to-core
    CPU model: AMD Opteron(tm) Processor 6174

    Why is it/what am I doing wrong that the default sending of 
std::vector<double> performs so badly?

    Best regards,
    Simon Etter

    _______________________________________________
    Boost-mpi mailing list
    [email protected] <mailto:[email protected]>
    http://lists.boost.org/mailman/listinfo.cgi/boost-mpi




--
Dipl.-Ing. Gonzalo Brito Gadeschi
Institute of Aerodynamics and Chair of Fluid Mechanics
RWTH Aachen University
Wuellnerstraße 5a
D-52062 Aachen
Germany
Phone: ++49-(0)241-80-94821
Fax: ++49-(0)241-80-92257
E-mail: [email protected] <mailto:[email protected]>
Internet: www.aia.rwth-aachen.de <http://www.aia.rwth-aachen.de>


_______________________________________________
Boost-mpi mailing list
[email protected]
http://lists.boost.org/mailman/listinfo.cgi/boost-mpi

_______________________________________________
Boost-mpi mailing list
[email protected]
http://lists.boost.org/mailman/listinfo.cgi/boost-mpi

Reply via email to