libMesh
Public Member Functions | Protected Attributes | List of all members
libMesh::Parallel::DataType Class Reference

Encapsulates the MPI_Datatype. More...

#include <data_type.h>

Inheritance diagram for libMesh::Parallel::DataType:
[legend]

Public Member Functions

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

Protected Attributes

data_type _datatype
 

Detailed Description

Encapsulates the MPI_Datatype.

Definition at line 63 of file data_type.h.

Constructor & Destructor Documentation

◆ DataType() [1/4]

libMesh::Parallel::DataType::DataType ( )

◆ DataType() [2/4]

libMesh::Parallel::DataType::DataType ( const DataType other)

Definition at line 68 of file data_type.h.

68  :
69  _datatype(other._datatype)
70  {}

◆ DataType() [3/4]

libMesh::Parallel::DataType::DataType ( const data_type type)

Definition at line 72 of file data_type.h.

72  :
73  _datatype(type)
74  {}

◆ DataType() [4/4]

libMesh::Parallel::DataType::DataType ( const DataType other,
unsigned int  count 
)

Definition at line 76 of file data_type.h.

References _datatype, commit(), and libMesh::libmesh_ignore().

77  {
78  // FIXME - if we nest an inner type here will we run into bug
79  // https://github.com/libMesh/libmesh/issues/631 again?
80  libmesh_call_mpi(MPI_Type_contiguous(count, other._datatype, &_datatype));
81  libmesh_ignore(other, count); // ifndef LIBMESH_HAVE_MPI
82  this->commit();
83  }
void libmesh_ignore(const Args &...)

Member Function Documentation

◆ commit()

void libMesh::Parallel::DataType::commit ( )

Definition at line 103 of file data_type.h.

References _datatype.

Referenced by DataType(), libMesh::Parallel::StandardType< std::pair< T1, T2 > >::StandardType(), and libMesh::Parallel::StandardType< std::tuple< Types... > >::StandardType().

104  {
105  libmesh_call_mpi
106  (MPI_Type_commit (&_datatype));
107  }

◆ free()

void libMesh::Parallel::DataType::free ( )

◆ operator const data_type &()

libMesh::Parallel::DataType::operator const data_type & ( ) const

Definition at line 91 of file data_type.h.

References _datatype.

92  { return _datatype; }

◆ operator data_type &()

libMesh::Parallel::DataType::operator data_type & ( )

Definition at line 94 of file data_type.h.

References _datatype.

95  { return _datatype; }

◆ operator=() [1/2]

DataType& libMesh::Parallel::DataType::operator= ( const DataType other)

Definition at line 85 of file data_type.h.

References _datatype.

86  { _datatype = other._datatype; return *this; }

◆ operator=() [2/2]

DataType& libMesh::Parallel::DataType::operator= ( const data_type type)

Definition at line 88 of file data_type.h.

References _datatype.

89  { _datatype = type; return *this; }

Member Data Documentation

◆ _datatype

data_type libMesh::Parallel::DataType::_datatype
protected

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