Opened 15 years ago

Closed 15 years ago

#1101 closed Bugs (fixed)

[MPI] Const-incorrectness in boost::mpi::status

Reported by: daniel_kruegler Owned by: Douglas Gregor
Milestone: To Be Determined Component: mpi
Version: Severity: Problem
Keywords: Cc:

Description

There are two member functions in class boost::mpi::status which lack const qualifications although they are immutable:

(a) bool cancelled(): The documentation says: "Determine whether the communication associated with this object has been successfully cancelled." The implementation delegates to MPI_Test_cancelled, which according to the internet documentation does use it's MPI_Status* argument is IN parameter.

(b) template<typename T> optional<int> count(): Here also the docs don't imply a mutable operation. The implementation delegates (under some circumstances) to MPI_Get_count, which also does not modify MPI_Status from a user perspective. The same function *caches* the result in the data member m_count, but this is the classic example where this member should be declared mutable therefore.

Change History (2)

comment:1 by René Rivera, 15 years ago

Component: Nonempi
Owner: set to Douglas Gregor

comment:2 by Douglas Gregor, 15 years ago

Resolution: fixed
Status: newclosed

(In [39052]) Constify status::count and status::cancelled. Fixes #1101

Note: See TracTickets for help on using tickets.