ESyS-Particle  4.0.1
CheckPointer.h
1 
2 // //
3 // Copyright (c) 2003-2011 by The University of Queensland //
4 // Earth Systems Science Computational Centre (ESSCC) //
5 // http://www.uq.edu.au/esscc //
6 // //
7 // Primary Business: Brisbane, Queensland, Australia //
8 // Licensed under the Open Software License version 3.0 //
9 // http://www.opensource.org/licenses/osl-3.0.php //
10 // //
12 
13 
14 #ifndef CHECKPOINTER_H
15 #define CHECKPOINTER_H
16 
17 // --- MPI includes ---
18 #include <mpi.h>
19 
20 //--- TML includes ---
21 #include "tml/comm/comm.h"
22 
23 #include <string>
24 #include <iostream>
25 
26 
27 namespace esys
28 {
29  namespace lsm
30  {
31  class CheckPointable;
32  }
33 }
34 
39 {
40 public:
43  CheckPointer(esys::lsm::CheckPointable &checkPointable, MPI_Comm mpiComm=MPI_COMM_WORLD);
44 
47  virtual ~CheckPointer();
48 
52  virtual void saveRestartable();
53  virtual void saveDump();
54  virtual void saveThroughMaster(TML_Comm&);
55  virtual void loadCheckPoint();
56 
60  virtual void save(std::ostream &oStream);
61 
62  MPI_Comm getMpiComm() const;
63 
64  void setMpiComm(MPI_Comm mpiComm);
65 
66 private:
67  esys::lsm::CheckPointable *m_pCheckPointable;
68  MPI_Comm m_mpiComm;
69 };
70 
71 #endif