Boost C++ Libraries: Ticket #5966: Cannot send std::map with more than 1 key/value pair https://svn.boost.org/trac10/ticket/5966 <p> Sending a std::map (or std::set) of size greater than 1 causes an MPI_ERR_TRUNCATE error. The following code reproduces this error: </p> <pre class="wiki">#include &lt;boost/mpi.hpp&gt; #include &lt;boost/serialization/map.hpp&gt; int main( int argc, char * argv [] ) { boost::mpi::environment env(argc, argv); boost::mpi::communicator world; if(world.rank()==0){ std::map&lt;int,int&gt; test; test[1]=50; test[2]=100; world.send(1, 1, boost::mpi::skeleton(test)); world.send(1, 1, boost::mpi::get_content(test)); std::cout &lt;&lt; "sent" &lt;&lt; std::endl; } else{ std::map&lt;int,int&gt; test; world.recv(0,1,boost::mpi::skeleton(test)); world.recv(0,1,boost::mpi::get_content(test)); std::cout &lt;&lt; test.size() &lt;&lt; std::endl; } } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5966 Trac 1.4.3 Matthias Troyer Tue, 01 Jan 2013 11:33:11 GMT owner changed https://svn.boost.org/trac10/ticket/5966#comment:1 https://svn.boost.org/trac10/ticket/5966#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Douglas Gregor</span> to <span class="trac-author">Matthias Troyer</span> </li> </ul> <p> You cannot send sets and maps by skeleton &amp; content, since you need the key values to build the data structure. We should make this give a compile time error. </p> Ticket