Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.

Function template get_content

boost::mpi::get_content — Returns the content of an object, suitable for transmission via Boost.MPI.


// In header: <boost/mpi/skeleton_and_content.hpp>

template<typename T> const content get_content(const T & x);


The function creates an absolute MPI datatype for the object, where all offsets are counted from the address 0 (a.k.a. MPI_BOTTOM) instead of the address &x of the object. This allows the creation of MPI data types for complex data structures containing pointers, such as linked lists or trees.

The disadvantage, compared to relative MPI data types is that for each object a new MPI data type has to be created.

The contents of an object can only be transmitted when the receiver already has an object with the same structure or shape as the sender. To accomplish this, first transmit the skeleton of the object using, e.g., skeleton() or skeleton_proxy.

The type T has to allow creation of an absolute MPI data type (content).



the object for which the content will be transmitted.


the content of the object x, which can be used for transmission via send, recv, or broadcast.