$extrastylesheet
libMesh::Parallel::StandardType< std::pair< T1, T2 > > Class Template Reference

#include <parallel_implementation.h>

Inheritance diagram for libMesh::Parallel::StandardType< std::pair< T1, T2 > >:

List of all members.

Public Member Functions

 StandardType (const std::pair< T1, T2 > *example=NULL)
 ~StandardType ()
 operator const data_type & () const
 operator data_type & ()
void commit ()
void free ()

Protected Attributes

data_type _datatype

Detailed Description

template<typename T1, typename T2>
class libMesh::Parallel::StandardType< std::pair< T1, T2 > >

Definition at line 117 of file parallel_implementation.h.


Constructor & Destructor Documentation

template<typename T1 , typename T2 >
libMesh::Parallel::StandardType< std::pair< T1, T2 > >::StandardType ( const std::pair< T1, T2 > *  example = NULL) [inline, explicit]

Definition at line 121 of file parallel_implementation.h.

References libMesh::Parallel::DataType::_datatype, and libMesh::libmesh_assert().

                                                      {
    // We need an example for MPI_Address to use
    libmesh_assert(example);

#ifdef LIBMESH_HAVE_MPI
    // Get the sub-data-types, and make sure they live long enough
    // to construct the derived type
    StandardType<T1> d1(&example->first);
    StandardType<T2> d2(&example->second);
    MPI_Datatype types[] = { (data_type)d1, (data_type)d2 };
    int blocklengths[] = {1,1};

    MPI_Aint displs[2];
#if MPI_VERSION > 1
    MPI_Get_address (const_cast<T1*>(&example->first), &displs[0]);
    MPI_Get_address (const_cast<T2*>(&example->second), &displs[1]);
#else
    MPI_Address (const_cast<T1*>(&example->first), &displs[0]);
    MPI_Address (const_cast<T2*>(&example->second), &displs[1]);
#endif
    displs[1] -= displs[0];
    displs[0] = 0;

#if MPI_VERSION > 1
    MPI_Type_create_struct (2, blocklengths, displs, types, &_datatype);
#else
    MPI_Type_struct (2, blocklengths, displs, types, &_datatype);
#endif // #if MPI_VERSION > 1
    MPI_Type_commit (&_datatype);
#endif // LIBMESH_HAVE_MPI
  }
template<typename T1 , typename T2 >
libMesh::Parallel::StandardType< std::pair< T1, T2 > >::~StandardType ( ) [inline]

Definition at line 153 of file parallel_implementation.h.

References libMesh::Parallel::DataType::free().

{ this->free(); }

Member Function Documentation

void libMesh::Parallel::DataType::commit ( ) [inline, inherited]

Definition at line 278 of file parallel.h.

References libMesh::Parallel::DataType::_datatype.

Referenced by libMesh::Parallel::DataType::DataType().

  {
#ifdef LIBMESH_HAVE_MPI
    MPI_Type_commit (&_datatype);
#endif
  }
libMesh::Parallel::DataType::operator const data_type & ( ) const [inline, inherited]

Definition at line 266 of file parallel.h.

References libMesh::Parallel::DataType::_datatype.

  { return _datatype; }
libMesh::Parallel::DataType::operator data_type & ( ) [inline, inherited]

Definition at line 269 of file parallel.h.

References libMesh::Parallel::DataType::_datatype.

  { return _datatype; }

Member Data Documentation


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