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
 
unsigned int size (const data_type &type) const
 
unsigned int 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 62 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 107 of file status.h.

107  :
108  _status(),
109  _datatype(type)
110 {}
status _status
Definition: status.h:100
data_type _datatype
Definition: status.h:101

◆ Status() [5/7]

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

Definition at line 112 of file status.h.

112  :
113  _status(stat),
114  _datatype()
115 {}
status _status
Definition: status.h:100
data_type _datatype
Definition: status.h:101

◆ Status() [6/7]

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

Definition at line 117 of file status.h.

118  :
119  _status(stat),
120  _datatype(type)
121 {}
status _status
Definition: status.h:100
data_type _datatype
Definition: status.h:101

◆ Status() [7/7]

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

Definition at line 123 of file status.h.

124  :
125  _status(stat._status),
126  _datatype(type)
127 {}
status _status
Definition: status.h:100
data_type _datatype
Definition: status.h:101

Member Function Documentation

◆ datatype() [1/2]

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

Definition at line 90 of file status.h.

References _datatype.

Referenced by size().

90 { return _datatype; }
data_type _datatype
Definition: status.h:101

◆ datatype() [2/2]

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

Definition at line 92 of file status.h.

References _datatype.

92 { return _datatype; }
data_type _datatype
Definition: status.h:101

◆ get() [1/2]

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

◆ get() [2/2]

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

Definition at line 84 of file status.h.

References _status.

84 { return &_status; }
status _status
Definition: status.h:100

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ size() [1/2]

unsigned int TIMPI::Status::size ( const data_type type) const
inline

Definition at line 148 of file status.h.

References _status, and TIMPI::ignore().

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

149 {
150  ignore(type); // We don't use this ifndef TIMPI_HAVE_MPI
151  int msg_size = 1;
152  timpi_call_mpi
153  (MPI_Get_count (const_cast<MPI_Status*>(&_status), type,
154  &msg_size));
155 
156  timpi_assert_greater_equal (msg_size, 0);
157  return msg_size;
158 }
void ignore(const Args &...)
Definition: timpi_assert.h:54
status _status
Definition: status.h:100

◆ size() [2/2]

unsigned int TIMPI::Status::size ( ) const
inline

Definition at line 160 of file status.h.

References datatype().

161 { return this->size (this->datatype()); }
data_type & datatype()
Definition: status.h:90
unsigned int size() const
Definition: status.h:160

◆ source()

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

Definition at line 129 of file status.h.

References _status.

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

130 {
131 #ifdef TIMPI_HAVE_MPI
132  return _status.MPI_SOURCE;
133 #else
134  return 0;
135 #endif
136 }
status _status
Definition: status.h:100

◆ tag()

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

Definition at line 138 of file status.h.

References _status.

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

139 {
140 #ifdef TIMPI_HAVE_MPI
141  return _status.MPI_TAG;
142 #else
143  timpi_not_implemented();
144  return 0;
145 #endif
146 }
status _status
Definition: status.h:100

Member Data Documentation

◆ _datatype

data_type TIMPI::Status::_datatype
private

Definition at line 101 of file status.h.

Referenced by datatype().

◆ _status

status TIMPI::Status::_status
private

Definition at line 100 of file status.h.

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


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