Rheolef  7.2
an efficient C++ finite element environment
 
Loading...
Searching...
No Matches
mpi_pair_datatype.h
Go to the documentation of this file.
1#ifndef _RHEO_MPI_PAIR_DATA_TYPE_H
2#define _RHEO_MPI_PAIR_DATA_TYPE_H
23// send a pair<T1,T2> via mpi & serialization
24
25#pragma GCC diagnostic push
26#pragma GCC diagnostic ignored "-Weffc++"
27#pragma GCC diagnostic ignored "-Wparentheses"
28#pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
29// -------------------------------------------------------------
30// 1) non-intrusive version of serialization for pair<T1,T2>
31// -------------------------------------------------------------
32#include <boost/serialization/utility.hpp>
33// ---------------------------------------------------------------------------
34// 2) Some serializable types, like pair<size_t,double>, have a fixed amount of
35// data stored at fixed field positions.
36// When this is the case, boost::mpi can optimize their serialization and
37// transmission to avoid extraneous copy operations.
38// To enable this optimization, we specialize the type trait is_mpi_datatype
39// this is done in an header file.
40// ---------------------------------------------------------------------------
41#include <boost/mpi/datatype.hpp>
42#pragma GCC diagnostic pop
43
44// ---------------------------------------------------------------------------
45// 3) remove constness
46// when is_mpi_datatype<unsigned int> is true
47// then is_mpi_datatype<unsigned int const> is false
48// => remove constness is not performed by is_mpi_datatype<T>
49// we do it here
50#ifdef _RHEOLEF_HAVE_MPI
51namespace boost {
52 namespace mpi {
53 template <class T>
54 struct is_mpi_datatype<T const> : is_mpi_datatype<T> {};
55 } // namespace mpi
56} // namespace boost
57#endif // _RHEOLEF_HAVE_MPI
58
59#endif // _RHEO_MPI_PAIR_DATA_TYPE_H
Expr1::float_type T
Definition field_expr.h:230