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

Encapsulates the MPI_Status struct. More...

#include <status.h>

Public Member Functions

 Status ()
 
 Status (const data_type &type)
 
 Status (const status &status)
 
 Status (const status &status, const data_type &type)
 
 Status (const Status &status)
 
 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 59 of file status.h.

Constructor & Destructor Documentation

◆ Status() [1/6]

libMesh::Parallel::Status::Status ( )

Definition at line 101 of file status.h.

101  :
102  _status(),
103  _datatype()
104 {}

◆ Status() [2/6]

libMesh::Parallel::Status::Status ( const data_type type)
explicit

Definition at line 106 of file status.h.

106  :
107  _status(),
108  _datatype(type)
109 {}

◆ Status() [3/6]

libMesh::Parallel::Status::Status ( const status status)
explicit

Definition at line 111 of file status.h.

111  :
112  _status(stat),
113  _datatype()
114 {}

◆ Status() [4/6]

libMesh::Parallel::Status::Status ( const status status,
const data_type type 
)

Definition at line 116 of file status.h.

117  :
118  _status(stat),
119  _datatype(type)
120 {}

◆ Status() [5/6]

libMesh::Parallel::Status::Status ( const Status status)

Definition at line 122 of file status.h.

122  :
123  _status(stat._status),
124  _datatype(stat._datatype)
125 {}

◆ Status() [6/6]

libMesh::Parallel::Status::Status ( const Status status,
const data_type type 
)

Definition at line 127 of file status.h.

128  :
129  _status(stat._status),
130  _datatype(type)
131 {}

Member Function Documentation

◆ datatype() [1/2]

data_type& libMesh::Parallel::Status::datatype ( )

Definition at line 84 of file status.h.

References _datatype.

Referenced by size().

84 { return _datatype; }

◆ datatype() [2/2]

const data_type& libMesh::Parallel::Status::datatype ( ) const

Definition at line 86 of file status.h.

References _datatype.

86 { return _datatype; }

◆ get() [1/2]

status* libMesh::Parallel::Status::get ( )

Definition at line 76 of file status.h.

References _status.

Referenced by libMesh::Parallel::Communicator::packed_range_probe(), and libMesh::Parallel::Communicator::receive().

76 { return &_status; }

◆ get() [2/2]

status const* libMesh::Parallel::Status::get ( ) const

Definition at line 78 of file status.h.

References _status.

78 { return &_status; }

◆ size() [1/2]

unsigned int libMesh::Parallel::Status::size ( const data_type type) const

Definition at line 152 of file status.h.

References _status, and libMesh::libmesh_ignore().

Referenced by libMesh::Parallel::Communicator::nonblocking_receive_packed_range().

153 {
154  libmesh_ignore(type); // We don't use this ifndef LIBMESH_HAVE_MPI
155  int msg_size = 1;
156  libmesh_call_mpi
157  (MPI_Get_count (const_cast<MPI_Status*>(&_status), type,
158  &msg_size));
159 
160  libmesh_assert_greater_equal (msg_size, 0);
161  return msg_size;
162 }
void libmesh_ignore(const Args &...)

◆ size() [2/2]

unsigned int libMesh::Parallel::Status::size ( ) const

Definition at line 164 of file status.h.

References datatype().

165 { return this->size (this->datatype()); }
data_type & datatype()
Definition: status.h:84
unsigned int size() const
Definition: status.h:164

◆ source()

int libMesh::Parallel::Status::source ( ) const

Definition at line 133 of file status.h.

References _status.

Referenced by libMesh::Parallel::Communicator::receive_packed_range().

134 {
135 #ifdef LIBMESH_HAVE_MPI
136  return _status.MPI_SOURCE;
137 #else
138  return 0;
139 #endif
140 }

◆ tag()

int libMesh::Parallel::Status::tag ( ) const

Definition at line 142 of file status.h.

References _status.

Referenced by libMesh::Parallel::Communicator::receive_packed_range().

143 {
144 #ifdef LIBMESH_HAVE_MPI
145  return _status.MPI_TAG;
146 #else
147  libmesh_not_implemented();
148  return 0;
149 #endif
150 }

Member Data Documentation

◆ _datatype

data_type libMesh::Parallel::Status::_datatype
private

Definition at line 95 of file status.h.

Referenced by datatype().

◆ _status

status libMesh::Parallel::Status::_status
private

Definition at line 94 of file status.h.

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


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