TIMPI
Public Member Functions | Private Attributes | List of all members
TIMPI::Status Class Reference

Encapsulates the MPI_Status struct. More...

#include <status.h>

Public Member Functions

 Status ()=default
 
 ~Status ()=default
 
 Status (const Status &)=default
 
 Status (Status &&)=default
 
Statusoperator= (const Status &)=default
 
Statusoperator= (Status &&)=default
 
 Status (const data_type &type)
 
 Status (const status &status)
 
 Status (const status &status, const data_type &type)
 
 Status (const Status &status, const data_type &type)
 
statusget ()
 
status const * get () const
 
int source () const
 
int tag () const
 
data_typedatatype ()
 
const data_typedatatype () const
 
CountType size (const data_type &type) const
 
CountType size () const
 

Private Attributes

status _status
 
data_type _datatype
 

Detailed Description

Encapsulates the MPI_Status struct.

Allows the source and size of the message to be determined.

Definition at line 75 of file status.h.

Constructor & Destructor Documentation

◆ Status() [1/7]

TIMPI::Status::Status ( )
default

◆ ~Status()

TIMPI::Status::~Status ( )
default

◆ Status() [2/7]

TIMPI::Status::Status ( const Status )
default

◆ Status() [3/7]

TIMPI::Status::Status ( Status &&  )
default

◆ Status() [4/7]

TIMPI::Status::Status ( const data_type type)
inlineexplicit

Definition at line 120 of file status.h.

120  :
121  _status(),
122  _datatype(type)
123 {}
status _status
Definition: status.h:113
data_type _datatype
Definition: status.h:114

◆ Status() [5/7]

TIMPI::Status::Status ( const status status)
inlineexplicit

Definition at line 125 of file status.h.

125  :
126  _status(stat),
127  _datatype()
128 {}
status _status
Definition: status.h:113
data_type _datatype
Definition: status.h:114

◆ Status() [6/7]

TIMPI::Status::Status ( const status status,
const data_type type 
)
inline

Definition at line 130 of file status.h.

131  :
132  _status(stat),
133  _datatype(type)
134 {}
status _status
Definition: status.h:113
data_type _datatype
Definition: status.h:114

◆ Status() [7/7]

TIMPI::Status::Status ( const Status status,
const data_type type 
)
inline

Definition at line 136 of file status.h.

137  :
138  _status(stat._status),
139  _datatype(type)
140 {}
status _status
Definition: status.h:113
data_type _datatype
Definition: status.h:114

Member Function Documentation

◆ datatype() [1/2]

data_type& TIMPI::Status::datatype ( )
inline

Definition at line 103 of file status.h.

References _datatype.

Referenced by size().

103 { return _datatype; }
data_type _datatype
Definition: status.h:114

◆ datatype() [2/2]

const data_type& TIMPI::Status::datatype ( ) const
inline

Definition at line 105 of file status.h.

References _datatype.

105 { return _datatype; }
data_type _datatype
Definition: status.h:114

◆ get() [1/2]

status* TIMPI::Status::get ( )
inline

Definition at line 95 of file status.h.

References _status.

Referenced by TIMPI::Communicator::packed_range_probe(), TIMPI::Communicator::possibly_receive(), and TIMPI::Communicator::receive().

95 { return &_status; }
status _status
Definition: status.h:113

◆ get() [2/2]

status const* TIMPI::Status::get ( ) const
inline

Definition at line 97 of file status.h.

References _status.

97 { return &_status; }
status _status
Definition: status.h:113

◆ operator=() [1/2]

Status& TIMPI::Status::operator= ( const Status )
default

◆ operator=() [2/2]

Status& TIMPI::Status::operator= ( Status &&  )
default

◆ size() [1/2]

CountType TIMPI::Status::size ( const data_type type) const
inline

Definition at line 161 of file status.h.

References _status, and TIMPI::ignore().

Referenced by TIMPI::Communicator::nonblocking_receive_packed_range(), and TIMPI::Communicator::possibly_receive().

162 {
163  ignore(type); // We don't use this ifndef TIMPI_HAVE_MPI
164  CountType msg_size = 1;
165  timpi_call_mpi
166  (TIMPI_GET_COUNT(const_cast<MPI_Status*>(&_status), type,
167  &msg_size));
168 
169  timpi_assert_greater_equal (msg_size, 0);
170  return msg_size;
171 }
void ignore(const Args &...)
Definition: timpi_assert.h:54
status _status
Definition: status.h:113
MPI_Count CountType
Definition: status.h:47

◆ size() [2/2]

CountType TIMPI::Status::size ( ) const
inline

Definition at line 173 of file status.h.

References datatype().

174 { return this->size (this->datatype()); }
data_type & datatype()
Definition: status.h:103
CountType size() const
Definition: status.h:173

◆ source()

int TIMPI::Status::source ( ) const
inline

Definition at line 142 of file status.h.

References _status.

Referenced by TIMPI::Communicator::possibly_receive(), and TIMPI::Communicator::receive_packed_range().

143 {
144 #ifdef TIMPI_HAVE_MPI
145  return _status.MPI_SOURCE;
146 #else
147  return 0;
148 #endif
149 }
status _status
Definition: status.h:113

◆ tag()

int TIMPI::Status::tag ( ) const
inline

Definition at line 151 of file status.h.

References _status.

Referenced by TIMPI::Communicator::receive_packed_range().

152 {
153 #ifdef TIMPI_HAVE_MPI
154  return _status.MPI_TAG;
155 #else
156  timpi_not_implemented();
157  return 0;
158 #endif
159 }
status _status
Definition: status.h:113

Member Data Documentation

◆ _datatype

data_type TIMPI::Status::_datatype
private

Definition at line 114 of file status.h.

Referenced by datatype().

◆ _status

status TIMPI::Status::_status
private

Definition at line 113 of file status.h.

Referenced by get(), size(), source(), and tag().


The documentation for this class was generated from the following file: