TIMPI
Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
TIMPI::DataType Class Reference

Encapsulates the MPI_Datatype. More...

#include <data_type.h>

Inheritance diagram for TIMPI::DataType:
[legend]

Public Member Functions

 DataType ()=default
 
 DataType (const DataType &other)=default
 
 DataType (DataType &&other)=default
 
 DataType (const data_type &type)
 
 DataType (const DataType &other, unsigned int count)
 
virtual ~DataType ()=default
 
DataTypeoperator= (const DataType &other)=default
 
DataTypeoperator= (DataType &&other)=default
 
DataTypeoperator= (const data_type &type)
 
 operator const data_type & () const
 
 operator data_type & ()
 
void commit ()
 
void free ()
 

Static Public Attributes

static const bool is_fixed_type = true
 

Protected Attributes

data_type _datatype
 

Detailed Description

Encapsulates the MPI_Datatype.

Definition at line 50 of file data_type.h.

Constructor & Destructor Documentation

◆ DataType() [1/5]

TIMPI::DataType::DataType ( )
default

◆ DataType() [2/5]

TIMPI::DataType::DataType ( const DataType other)
default

◆ DataType() [3/5]

TIMPI::DataType::DataType ( DataType &&  other)
default

◆ DataType() [4/5]

TIMPI::DataType::DataType ( const data_type type)
inline

Definition at line 58 of file data_type.h.

58  :
59  _datatype(type)
60  {}
data_type _datatype
Definition: data_type.h:105

◆ DataType() [5/5]

TIMPI::DataType::DataType ( const DataType other,
unsigned int  count 
)
inline

Definition at line 62 of file data_type.h.

References _datatype, commit(), and TIMPI::ignore().

63  {
64  // FIXME - if we nest an inner type here will we run into bug
65  // https://github.com/libMesh/libmesh/issues/631 again?
66  timpi_call_mpi(MPI_Type_contiguous(count, other._datatype, &_datatype));
67  ignore(other, count); // ifndef TIMPI_HAVE_MPI
68  this->commit();
69  }
void commit()
Definition: data_type.h:91
void ignore(const Args &...)
Definition: timpi_assert.h:54
data_type _datatype
Definition: data_type.h:105

◆ ~DataType()

virtual TIMPI::DataType::~DataType ( )
virtualdefault

Member Function Documentation

◆ commit()

void TIMPI::DataType::commit ( )
inline

Definition at line 91 of file data_type.h.

References _datatype.

Referenced by DataType().

92  {
93  timpi_call_mpi
94  (MPI_Type_commit (&_datatype));
95  }
data_type _datatype
Definition: data_type.h:105

◆ free()

void TIMPI::DataType::free ( )
inline

Definition at line 97 of file data_type.h.

References _datatype.

98  {
99  timpi_call_mpi
100  (MPI_Type_free (&_datatype));
101  }
data_type _datatype
Definition: data_type.h:105

◆ operator const data_type &()

TIMPI::DataType::operator const data_type & ( ) const
inline

Definition at line 79 of file data_type.h.

References _datatype.

80  { return _datatype; }
data_type _datatype
Definition: data_type.h:105

◆ operator data_type &()

TIMPI::DataType::operator data_type & ( )
inline

Definition at line 82 of file data_type.h.

References _datatype.

83  { return _datatype; }
data_type _datatype
Definition: data_type.h:105

◆ operator=() [1/3]

DataType& TIMPI::DataType::operator= ( const DataType other)
default

◆ operator=() [2/3]

DataType& TIMPI::DataType::operator= ( DataType &&  other)
default

◆ operator=() [3/3]

DataType& TIMPI::DataType::operator= ( const data_type type)
inline

Definition at line 76 of file data_type.h.

References _datatype.

77  { _datatype = type; return *this; }
data_type _datatype
Definition: data_type.h:105

Member Data Documentation

◆ _datatype

data_type TIMPI::DataType::_datatype
protected

◆ is_fixed_type

const bool TIMPI::DataType::is_fixed_type = true
static

Definition at line 56 of file data_type.h.


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