$extrastylesheet
#include <parallel_algebra.h>

Public Member Functions | |
| StandardType (const Point *example=NULL) | |
| operator const data_type & () const | |
| operator data_type & () | |
| void | commit () |
| void | free () |
Protected Attributes | |
| data_type | _datatype |
Definition at line 212 of file parallel_algebra.h.
| libMesh::Parallel::StandardType< Point >::StandardType | ( | const Point * | example = NULL | ) | [inline, explicit] |
Definition at line 216 of file parallel_algebra.h.
References libMesh::Parallel::DataType::_datatype, libMesh::libMeshPrivateData::_is_initialized, and libMesh::libmesh_ignore().
{
// Prevent unused variable warnings when !LIBMESH_HAVE_MPI
libmesh_ignore(example);
// _static_type never gets freed, but it only gets committed once
// per T, so it's not a *huge* memory leak...
static data_type _static_type;
static bool _is_initialized = false;
if (!_is_initialized)
{
#ifdef LIBMESH_HAVE_MPI
// We need an example for MPI_Address to use
Point *ex;
UniquePtr<Point> temp;
if (example)
ex = const_cast<Point *>(example);
else
{
temp.reset(new Point());
ex = temp.get();
}
StandardType<Real> T_type(&((*ex)(0)));
#if MPI_VERSION == 1
int blocklengths[LIBMESH_DIM+2];
MPI_Aint displs[LIBMESH_DIM+2];
MPI_Datatype types[LIBMESH_DIM+2];
MPI_Aint start, later;
MPI_Address(ex, &start);
blocklengths[0] = 1;
displs[0] = 0;
types[0] = MPI_LB;
for (unsigned int i=0; i != LIBMESH_DIM; ++i)
{
MPI_Address(&((*ex)(i)), &later);
blocklengths[i+1] = 1;
displs[i+1] = later - start;
types[i+1] = T_type;
}
MPI_Address((ex+1), &later);
blocklengths[LIBMESH_DIM+1] = 1;
displs[LIBMESH_DIM+1] = later - start;
types[LIBMESH_DIM+1] = MPI_UB;
MPI_Type_struct (LIBMESH_DIM+2, blocklengths, displs, types, &_static_type);
#else // MPI_VERSION >= 2
int blocklength = LIBMESH_DIM;
MPI_Aint displs, start;
MPI_Datatype tmptype, type = T_type;
MPI_Get_address (ex, &start);
MPI_Get_address (&((*ex)(0)), &displs);
// subtract off offset to first value from the beginning of the structure
displs -= start;
// create a prototype structure
MPI_Type_create_struct (1, &blocklength, &displs, &type, &tmptype);
// resize the structure type to account for padding, if any
MPI_Type_create_resized (tmptype, 0, sizeof(Point), &_static_type);
#endif
MPI_Type_commit (&_static_type);
#endif // #ifdef LIBMESH_HAVE_MPI
_is_initialized = true;
}
_datatype = _static_type;
}
| 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
}
| void libMesh::Parallel::DataType::free | ( | ) | [inline, inherited] |
Definition at line 285 of file parallel.h.
References libMesh::Parallel::DataType::_datatype.
Referenced by libMesh::Parallel::StandardType< std::pair< T1, T2 > >::~StandardType(), libMesh::Parallel::StandardType< std::complex< T > >::~StandardType(), libMesh::Parallel::StandardType< TypeTensor< T > >::~StandardType(), and libMesh::Parallel::StandardType< TensorValue< T > >::~StandardType().
{
#ifdef LIBMESH_HAVE_MPI
MPI_Type_free (&_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; }
data_type libMesh::Parallel::DataType::_datatype [protected, inherited] |
Definition at line 294 of file parallel.h.
Referenced by libMesh::Parallel::DataType::commit(), libMesh::Parallel::DataType::DataType(), libMesh::Parallel::DataType::free(), libMesh::Parallel::DataType::operator const data_type &(), libMesh::Parallel::DataType::operator data_type &(), libMesh::Parallel::DataType::operator=(), libMesh::Parallel::StandardType< Hilbert::HilbertIndices >::StandardType(), libMesh::Parallel::StandardType< TypeVector< T > >::StandardType(), libMesh::Parallel::StandardType< std::pair< T1, T2 > >::StandardType(), libMesh::Parallel::StandardType< VectorValue< T > >::StandardType(), and StandardType().