ESyS-Particle  4.0.1
CheckPointer.h
00001 
00002 //                                                         //
00003 // Copyright (c) 2003-2011 by The University of Queensland //
00004 // Earth Systems Science Computational Centre (ESSCC)      //
00005 // http://www.uq.edu.au/esscc                              //
00006 //                                                         //
00007 // Primary Business: Brisbane, Queensland, Australia       //
00008 // Licensed under the Open Software License version 3.0    //
00009 // http://www.opensource.org/licenses/osl-3.0.php          //
00010 //                                                         //
00012 
00013 
00014 #ifndef CHECKPOINTER_H
00015 #define CHECKPOINTER_H
00016 
00017 // --- MPI includes ---
00018 #include <mpi.h>
00019 
00020 //--- TML includes ---
00021 #include "tml/comm/comm.h"
00022 
00023 #include <string>
00024 #include <iostream>
00025 
00026 
00027 namespace esys
00028 {
00029   namespace lsm
00030   {
00031     class CheckPointable;
00032   }
00033 }
00034 
00038 class CheckPointer
00039 {
00040 public:
00043   CheckPointer(esys::lsm::CheckPointable &checkPointable, MPI_Comm mpiComm=MPI_COMM_WORLD);
00044 
00047   virtual ~CheckPointer();
00048 
00052   virtual void saveRestartable();
00053   virtual void saveDump();
00054   virtual void saveThroughMaster(TML_Comm&);
00055   virtual void loadCheckPoint();
00056 
00060   virtual void save(std::ostream &oStream);
00061 
00062   MPI_Comm getMpiComm() const;
00063   
00064   void setMpiComm(MPI_Comm mpiComm);
00065 
00066 private:
00067   esys::lsm::CheckPointable *m_pCheckPointable;
00068   MPI_Comm m_mpiComm;
00069 };
00070 
00071 #endif