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 113 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 117 of file parallel_implementation.h.

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

00117                                                       {
00118     // We need an example for MPI_Address to use
00119     libmesh_assert(example);
00120 
00121 #ifdef LIBMESH_HAVE_MPI
00122     // Get the sub-data-types, and make sure they live long enough
00123     // to construct the derived type
00124     StandardType<T1> d1(&example->first);
00125     StandardType<T2> d2(&example->second);
00126     MPI_Datatype types[] = { (data_type)d1, (data_type)d2 };
00127     int blocklengths[] = {1,1};
00128 
00129     MPI_Aint displs[2];
00130     MPI_Address (const_cast<T1*>(&example->first), &displs[0]);
00131     MPI_Address (const_cast<T2*>(&example->second), &displs[1]);
00132     displs[1] -= displs[0];
00133     displs[0] = 0;
00134 
00135 #if MPI_VERSION > 1
00136     MPI_Type_create_struct (2, blocklengths, displs, types, &_datatype);
00137 #else
00138     MPI_Type_struct (2, blocklengths, displs, types, &_datatype);
00139 #endif // #if MPI_VERSION > 1
00140     MPI_Type_commit (&_datatype);
00141 #endif // LIBMESH_HAVE_MPI
00142   }

template<typename T1 , typename T2 >
libMesh::Parallel::StandardType< std::pair< T1, T2 > >::~StandardType (  )  [inline]

Definition at line 144 of file parallel_implementation.h.

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

00144 { this->free(); }


Member Function Documentation

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

Definition at line 255 of file parallel.h.

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

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

00256     {
00257 #ifdef LIBMESH_HAVE_MPI
00258       MPI_Type_commit (&_datatype);
00259 #endif
00260     }

void libMesh::Parallel::DataType::free (  )  [inline, inherited]
libMesh::Parallel::DataType::operator const data_type & (  )  const [inline, inherited]

Definition at line 243 of file parallel.h.

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

00244     { return _datatype; }

libMesh::Parallel::DataType::operator data_type & (  )  [inline, inherited]

Definition at line 246 of file parallel.h.

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

00247     { return _datatype; }


Member Data Documentation


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

Site Created By: libMesh Developers
Last modified: February 05 2013 19:55:45 UTC

Hosted By:
SourceForge.net Logo