Skip to content

Commit

Permalink
sequential version of status
Browse files Browse the repository at this point in the history
refs #61
  • Loading branch information
aminiussi committed May 21, 2018
1 parent 318828c commit f2bee0b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions include/boost/mpi/status.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace boost { namespace mpi {
class request;
class communicator;

#ifndef BOOST_MPI_SEQ
/** @brief Contains information about a message that has been or can
* be received.
*
Expand Down Expand Up @@ -100,7 +101,25 @@ class BOOST_MPI_DECL status
friend class communicator;
friend class request;
};
#else // BOOST_MPI_SEQ
// Does not make much sense to asyncronously send message to self.
// So this will be short
class BOOST_MPI_DECL status
{
public:
status(int tag, int count) : m_tag(tag), m_count(count) { }

int source() const { return 0; }
int tag() const { return m_tag; }
int error() const { return MPI_SUCCESS; }
bool cancelled() const { false;}
template<typename T> optional<int> count() const { return m_count; }

private:
int m_tag;
int m_count;
};
#endif // BOOST_MPI_SEQ

} } // end namespace boost::mpi

Expand Down

0 comments on commit f2bee0b

Please sign in to comment.