1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-10 06:00:45 +01:00

Format emacs C++ mode

This commit is contained in:
paboyle 2018-01-14 22:34:12 +00:00
parent cfe6c6838f
commit 813af84ae8

View File

@ -25,28 +25,28 @@ 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 HMC_RESOURCE_MANAGER_H #ifndef HMC_RESOURCE_MANAGER_H
#define HMC_RESOURCE_MANAGER_H #define HMC_RESOURCE_MANAGER_H
#include <unordered_map> #include <unordered_map>
// One function per Checkpointer, use a macro to simplify // One function per Checkpointer, use a macro to simplify
#define RegisterLoadCheckPointerFunction(NAME) \ #define RegisterLoadCheckPointerFunction(NAME) \
void Load##NAME##Checkpointer(const CheckpointerParameters& Params_) { \ void Load##NAME##Checkpointer(const CheckpointerParameters& Params_) { \
if (!have_CheckPointer) { \ if (!have_CheckPointer) { \
std::cout << GridLogDebug << "Loading Checkpointer " << #NAME \ std::cout << GridLogDebug << "Loading Checkpointer " << #NAME \
<< std::endl; \ << std::endl; \
CP = std::unique_ptr<CheckpointerBaseModule>( \ CP = std::unique_ptr<CheckpointerBaseModule>( \
new NAME##CPModule<ImplementationPolicy>(Params_)); \ new NAME##CPModule<ImplementationPolicy>(Params_)); \
have_CheckPointer = true; \ have_CheckPointer = true; \
} else { \ } else { \
std::cout << GridLogError << "Checkpointer already loaded " \ std::cout << GridLogError << "Checkpointer already loaded " \
<< std::endl; \ << std::endl; \
exit(1); \ exit(1); \
} \ } \
} }
NAMESPACE_BEGIN(Grid); NAMESPACE_BEGIN(Grid);
@ -84,7 +84,7 @@ class HMCResourceManager {
} }
public: public:
HMCResourceManager() : have_RNG(false), have_CheckPointer(false) {} HMCResourceManager() : have_RNG(false), have_CheckPointer(false) {}
template <class ReaderClass, class vector_type = vComplex > template <class ReaderClass, class vector_type = vComplex >
@ -134,13 +134,13 @@ class HMCResourceManager {
} }
if(!Read.push("Level")){// push must check if the node exist if(!Read.push("Level")){// push must check if the node exist
std::cout << "Level not found" << std::endl; std::cout << "Level not found" << std::endl;
exit(1); exit(1);
} }
do do
{ {
fill_ActionsLevel(Read); fill_ActionsLevel(Read);
} }
while(Read.push("Level")); while(Read.push("Level"));
Read.pop(); Read.pop();
@ -251,9 +251,9 @@ class HMCResourceManager {
RegisterLoadCheckPointerFunction(Binary); RegisterLoadCheckPointerFunction(Binary);
RegisterLoadCheckPointerFunction(Nersc); RegisterLoadCheckPointerFunction(Nersc);
#ifdef HAVE_LIME #ifdef HAVE_LIME
RegisterLoadCheckPointerFunction(ILDG); RegisterLoadCheckPointerFunction(ILDG);
#endif #endif
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
// Observables // Observables
@ -279,7 +279,7 @@ class HMCResourceManager {
private: private:
// this private // this private
template <class ReaderClass > template <class ReaderClass >
void fill_ActionsLevel(ReaderClass &Read){ void fill_ActionsLevel(ReaderClass &Read){
// Actions set // Actions set