Subject: [Boost-bugs] [Boost C++ Libraries] #5065: Valgrind complaint when using Boost MPI
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-01-13 02:54:13
#5065: Valgrind complaint when using Boost MPI
------------------------------------+---------------------------------------
Reporter: dongryel@⦠| Owner: dgregor
Type: Patches | Status: new
Milestone: To Be Determined | Component: mpi
Version: Boost 1.45.0 | Severity: Cosmetic
Keywords: Boost MPI |
------------------------------------+---------------------------------------
I am using the latest Boost library (version 1.45.0) on Ubuntu. I have
built
Boost from the source using the bjam.
boost::mpi::all_reduce uses boost::mpi::broadcast which seems to generate
annoying invalid write errors under valgrind. The problem points to the
line 47 in boost/mpi/detail/packed_oprimitive.hpp in const std::size_t
&size() const
function. I changed the function to:
const std::size_t& size() const
{
const_cast<std::size_t &>(size_) = buffer_.size();
return size_;
}
and the valgrind complaint seems to be gone. Const_cast seems less than
ideal, but
it fixes the problem.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5065> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:05 UTC