1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-14 01:35:36 +00:00

Namespace

This commit is contained in:
paboyle 2018-01-14 22:30:54 +00:00
parent 7631ed9c56
commit 2c2da60cc2

View File

@ -25,27 +25,26 @@ with this program; if not, write to the Free Software Foundation, Inc.,
See the full license in the file "LICENSE" in the top level distribution See the full license in the file "LICENSE" in the top level distribution
directory directory
*************************************************************************************/ *************************************************************************************/
/* END LEGAL */ /* END LEGAL */
#ifndef BASE_CHECKPOINTER #ifndef BASE_CHECKPOINTER
#define BASE_CHECKPOINTER #define BASE_CHECKPOINTER
namespace Grid { NAMESPACE_BEGIN(Grid);
namespace QCD {
class CheckpointerParameters : Serializable { class CheckpointerParameters : Serializable {
public: public:
GRID_SERIALIZABLE_CLASS_MEMBERS(CheckpointerParameters, GRID_SERIALIZABLE_CLASS_MEMBERS(CheckpointerParameters,
std::string, config_prefix, std::string, config_prefix,
std::string, rng_prefix, std::string, rng_prefix,
int, saveInterval, int, saveInterval,
std::string, format, ); std::string, format, );
CheckpointerParameters(std::string cf = "cfg", std::string rn = "rng", CheckpointerParameters(std::string cf = "cfg", std::string rn = "rng",
int savemodulo = 1, const std::string &f = "IEEE64BIG") int savemodulo = 1, const std::string &f = "IEEE64BIG")
: config_prefix(cf), : config_prefix(cf),
rng_prefix(rn), rng_prefix(rn),
saveInterval(savemodulo), saveInterval(savemodulo),
format(f){}; format(f){};
template <class ReaderClass > template <class ReaderClass >
@ -60,7 +59,7 @@ class CheckpointerParameters : Serializable {
// Base class for checkpointers // Base class for checkpointers
template <class Impl> template <class Impl>
class BaseHmcCheckpointer : public HmcObservable<typename Impl::Field> { class BaseHmcCheckpointer : public HmcObservable<typename Impl::Field> {
public: public:
void build_filenames(int traj, CheckpointerParameters &Params, void build_filenames(int traj, CheckpointerParameters &Params,
std::string &conf_file, std::string &rng_file) { std::string &conf_file, std::string &rng_file) {
{ {
@ -74,7 +73,7 @@ class BaseHmcCheckpointer : public HmcObservable<typename Impl::Field> {
os << Params.config_prefix << "." << traj; os << Params.config_prefix << "." << traj;
conf_file = os.str(); conf_file = os.str();
} }
} }
virtual void initialize(const CheckpointerParameters &Params) = 0; virtual void initialize(const CheckpointerParameters &Params) = 0;
@ -84,6 +83,7 @@ class BaseHmcCheckpointer : public HmcObservable<typename Impl::Field> {
}; // class BaseHmcCheckpointer }; // class BaseHmcCheckpointer
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
}
} NAMESPACE_END(Grid);
#endif #endif