[Boost-bugs] [Boost C++ Libraries] #9502: Unexpected behaviour of boost::mpi::request::test()

Subject: [Boost-bugs] [Boost C++ Libraries] #9502: Unexpected behaviour of boost::mpi::request::test()
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-12-17 14:04:33


#9502: Unexpected behaviour of boost::mpi::request::test()
------------------------------+---------------------
 Reporter: ettersi@… | Owner: troyer
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: mpi
  Version: Boost 1.55.0 | Severity: Problem
 Keywords: request test |
------------------------------+---------------------
 The following code snippet shows that boost::mpi::request::test() behaves
 differently depending on whether we send a message of built-in type or a
 message of custom type:

 {{{
 struct custom_type {
     template<class Archive>
     void serialize(Archive& ar, const unsigned int version) {}
 };

 [...]

 int i;
 auto req = comm.irecv(0,0,i);
 req.wait();
 std::cout << "Did we receive the built in type message: " <<
 bool(req.test()) << std::endl;

 custom_type c;
 auto req = comm.irecv(0,0,c);
 req.wait();
 std::cout << "Did we receive the custom type message: " <<
 bool(req.test()) << std::endl;
 }}}

 Output:

 {{{
 Did we receive the built in type message: 1
 Did we receive the custom type message: 0
 }}}


 Similar behaviour is observed if you just repeatedly call req.test(): For
 the built-in type, the returned boost::optional switches from empty to
 non-empty once and then stays non-empty, whereas for the custom type it
 switches from empty to non-empty and in the next call goes back to empty
 again.

 For our application, it would be desirable if the custom type behaviour
 would be the same as the built-in type behaviour. If this is not possible
 or not advisable, then at least the documentation of boost::mpi::request
 should mention this difference in behaviour.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9502>
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:15 UTC