Opened 12 years ago
Last modified 10 years ago
#5065 new Patches
Valgrind complaint when using Boost MPI
Reported by: | Owned by: | Douglas Gregor | |
---|---|---|---|
Milestone: | To Be Determined | Component: | mpi |
Version: | Boost 1.45.0 | Severity: | Cosmetic |
Keywords: | Boost MPI | Cc: |
Description
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.
Change History (2)
comment:1 by , 12 years ago
comment:2 by , 10 years ago
Is this still present? If so, do you have a test case that we can try to reproduce?
Actually, this does not solve the problem. I did not notice that the mutable keyword was already present for size_ member.