~ubuntu-branches/ubuntu/saucy/rheolef/saucy

« back to all changes in this revision

Viewing changes to nfem/plib/point_serialize.h

  • Committer: Bazaar Package Importer
  • Author(s): Pierre Saramito
  • Date: 2011-02-08 10:00:06 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110208100006-jg8rarizvhdm8e82
Tags: 5.92-1
* New upstream release:
  - "rheolef" suffix added to all unix manuals (Closes: #607117)
  - minor source code fixes for g++-4.5 (Closes: #607184)
  - minor reference manual fix (Closes: #607038)
* debian/control: libboost-iostreams-dev dependency added, as required
  by the new upstream version.
 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _RHEOLEF_POINT_SERIALIZE_H
 
2
#define _RHEOLEF_POINT_SERIALIZE_H
 
3
///
 
4
/// This file is part of Rheolef.
 
5
///
 
6
/// Copyright (C) 2000-2009 Pierre Saramito <Pierre.Saramito@imag.fr>
 
7
///
 
8
/// Rheolef is free software; you can redistribute it and/or modify
 
9
/// it under the terms of the GNU General Public License as published by
 
10
/// the Free Software Foundation; either version 2 of the License, or
 
11
/// (at your option) any later version.
 
12
///
 
13
/// Rheolef is distributed in the hope that it will be useful,
 
14
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
/// GNU General Public License for more details.
 
17
///
 
18
/// You should have received a copy of the GNU General Public License
 
19
/// along with Rheolef; if not, write to the Free Software
 
20
/// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
21
///
 
22
/// =========================================================================
 
23
 
 
24
#include "rheolef/basic_point.h"
 
25
#include "rheolef/parallel.h"
 
26
 
 
27
#ifdef _RHEOLEF_HAVE_MPI
 
28
namespace boost {
 
29
 namespace serialization {
 
30
  template<class Archive, class T>
 
31
  void serialize (Archive& ar, class rheolef::basic_point<T>& x, const unsigned int version) {
 
32
    ar & x[0];
 
33
    ar & x[1];
 
34
    ar & x[2];
 
35
  }
 
36
 } // namespace serialization
 
37
} // namespace boost
 
38
 
 
39
// Some serializable types, like geo_element, have a fixed amount of data stored at fixed field positions.
 
40
// When this is the case, boost::mpi can optimize their serialization and transmission to avoid extraneous copy operations.
 
41
// To enable this optimization, we specialize the type trait is_mpi_datatype, e.g.:
 
42
namespace boost {
 
43
 namespace mpi {
 
44
  // TODO: when basic_point<T> is not a simple type, such as T=doubledouble or T=gmp, etc
 
45
  template <>
 
46
  struct is_mpi_datatype<rheolef::basic_point<double> > : mpl::true_ { };
 
47
 } // namespace mpi
 
48
} // namespace boost
 
49
#endif // _RHEOLEF_HAVE_MPI
 
50
 
 
51
#endif // _RHEOLEF_POINT_SERIALIZE_H