mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-05 03:35:55 +01:00
Hadrons: namespace macro to tackle GCC 5 bug
This commit is contained in:
parent
7a1ac45679
commit
7ae734103e
@ -39,8 +39,13 @@ namespace Hadrons {\
|
||||
using Grid::operator<<;
|
||||
#define END_HADRONS_NAMESPACE }}
|
||||
|
||||
#define BEGIN_MODULE_NAMESPACE(name)\
|
||||
namespace name {\
|
||||
using Grid::operator<<;
|
||||
#define END_MODULE_NAMESPACE }
|
||||
|
||||
/* the 'using Grid::operator<<;' statement prevents a very nasty compilation
|
||||
* error with GCC (clang compiles fine without it).
|
||||
* error with GCC 5 (clang & GCC 6 compile fine without it).
|
||||
*/
|
||||
|
||||
// FIXME: find a way to do that in a more general fashion
|
||||
|
@ -37,21 +37,21 @@ BEGIN_HADRONS_NAMESPACE
|
||||
/******************************************************************************
|
||||
* Domain wall quark action *
|
||||
******************************************************************************/
|
||||
namespace MAction
|
||||
BEGIN_MODULE_NAMESPACE(MAction)
|
||||
|
||||
class DWFPar: Serializable
|
||||
{
|
||||
class DWFPar: Serializable
|
||||
{
|
||||
public:
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(DWFPar,
|
||||
std::string, gauge,
|
||||
unsigned int, Ls,
|
||||
double , mass,
|
||||
double , M5);
|
||||
};
|
||||
};
|
||||
|
||||
class DWF: public Module<DWFPar>
|
||||
{
|
||||
public:
|
||||
class DWF: public Module<DWFPar>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
DWF(const std::string name);
|
||||
// destructor
|
||||
@ -63,8 +63,9 @@ namespace MAction
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
MODULE_REGISTER_NS(DWF, MAction);
|
||||
|
||||
|
@ -37,19 +37,19 @@ BEGIN_HADRONS_NAMESPACE
|
||||
/******************************************************************************
|
||||
* Wilson quark action *
|
||||
******************************************************************************/
|
||||
namespace MAction
|
||||
BEGIN_MODULE_NAMESPACE(MAction)
|
||||
|
||||
class WilsonPar: Serializable
|
||||
{
|
||||
class WilsonPar: Serializable
|
||||
{
|
||||
public:
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(WilsonPar,
|
||||
std::string, gauge,
|
||||
double , mass);
|
||||
};
|
||||
};
|
||||
|
||||
class Wilson: public Module<WilsonPar>
|
||||
{
|
||||
public:
|
||||
class Wilson: public Module<WilsonPar>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
Wilson(const std::string name);
|
||||
// destructor
|
||||
@ -61,8 +61,9 @@ namespace MAction
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
MODULE_REGISTER_NS(Wilson, MAction);
|
||||
|
||||
|
@ -37,27 +37,27 @@ BEGIN_HADRONS_NAMESPACE
|
||||
/******************************************************************************
|
||||
* Meson *
|
||||
******************************************************************************/
|
||||
namespace MContraction
|
||||
BEGIN_MODULE_NAMESPACE(MContraction)
|
||||
|
||||
class MesonPar: Serializable
|
||||
{
|
||||
class MesonPar: Serializable
|
||||
{
|
||||
public:
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(MesonPar,
|
||||
std::string, q1,
|
||||
std::string, q2,
|
||||
std::string, output);
|
||||
};
|
||||
};
|
||||
|
||||
class Meson: public Module<MesonPar>
|
||||
{
|
||||
public:
|
||||
class Meson: public Module<MesonPar>
|
||||
{
|
||||
public:
|
||||
class Result: Serializable
|
||||
{
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(Result,
|
||||
std::vector<std::vector<std::vector<Complex>>>, corr);
|
||||
};
|
||||
public:
|
||||
public:
|
||||
// constructor
|
||||
Meson(const std::string name);
|
||||
// destructor
|
||||
@ -67,8 +67,9 @@ namespace MContraction
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
MODULE_REGISTER_NS(Meson, MContraction);
|
||||
|
||||
|
@ -37,18 +37,18 @@ BEGIN_HADRONS_NAMESPACE
|
||||
/******************************************************************************
|
||||
* Load a NERSC configuration *
|
||||
******************************************************************************/
|
||||
namespace MGauge
|
||||
BEGIN_MODULE_NAMESPACE(MGauge)
|
||||
|
||||
class LoadPar: Serializable
|
||||
{
|
||||
class LoadPar: Serializable
|
||||
{
|
||||
public:
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(LoadPar,
|
||||
std::string, file);
|
||||
};
|
||||
};
|
||||
|
||||
class Load: public Module<LoadPar>
|
||||
{
|
||||
public:
|
||||
class Load: public Module<LoadPar>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
Load(const std::string name);
|
||||
// destructor
|
||||
@ -60,8 +60,9 @@ namespace MGauge
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
MODULE_REGISTER_NS(Load, MGauge);
|
||||
|
||||
|
@ -37,11 +37,11 @@ BEGIN_HADRONS_NAMESPACE
|
||||
/******************************************************************************
|
||||
* Random gauge *
|
||||
******************************************************************************/
|
||||
namespace MGauge
|
||||
BEGIN_MODULE_NAMESPACE(MGauge)
|
||||
|
||||
class Random: public Module<NoPar>
|
||||
{
|
||||
class Random: public Module<NoPar>
|
||||
{
|
||||
public:
|
||||
public:
|
||||
// constructor
|
||||
Random(const std::string name);
|
||||
// destructor
|
||||
@ -53,8 +53,9 @@ namespace MGauge
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
MODULE_REGISTER_NS(Random, MGauge);
|
||||
|
||||
|
@ -37,11 +37,11 @@ BEGIN_HADRONS_NAMESPACE
|
||||
/******************************************************************************
|
||||
* Unit gauge *
|
||||
******************************************************************************/
|
||||
namespace MGauge
|
||||
BEGIN_MODULE_NAMESPACE(MGauge)
|
||||
|
||||
class Unit: public Module<NoPar>
|
||||
{
|
||||
class Unit: public Module<NoPar>
|
||||
{
|
||||
public:
|
||||
public:
|
||||
// constructor
|
||||
Unit(const std::string name);
|
||||
// destructor
|
||||
@ -53,8 +53,9 @@ namespace MGauge
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
MODULE_REGISTER_NS(Unit, MGauge);
|
||||
|
||||
|
@ -37,19 +37,19 @@ BEGIN_HADRONS_NAMESPACE
|
||||
/******************************************************************************
|
||||
* Schur red-black preconditioned CG *
|
||||
******************************************************************************/
|
||||
namespace MSolver
|
||||
BEGIN_MODULE_NAMESPACE(MSolver)
|
||||
|
||||
class RBPrecCGPar: Serializable
|
||||
{
|
||||
class RBPrecCGPar: Serializable
|
||||
{
|
||||
public:
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(RBPrecCGPar,
|
||||
std::string, action,
|
||||
double , residual);
|
||||
};
|
||||
};
|
||||
|
||||
class RBPrecCG: public Module<RBPrecCGPar>
|
||||
{
|
||||
public:
|
||||
class RBPrecCG: public Module<RBPrecCGPar>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
RBPrecCG(const std::string name);
|
||||
// destructor
|
||||
@ -61,8 +61,9 @@ namespace MSolver
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
MODULE_REGISTER_NS(RBPrecCG, MSolver);
|
||||
|
||||
|
@ -48,18 +48,18 @@ BEGIN_HADRONS_NAMESPACE
|
||||
/******************************************************************************
|
||||
* Point *
|
||||
******************************************************************************/
|
||||
namespace MSource
|
||||
BEGIN_MODULE_NAMESPACE(MSource)
|
||||
|
||||
class PointPar: Serializable
|
||||
{
|
||||
class PointPar: Serializable
|
||||
{
|
||||
public:
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(PointPar,
|
||||
std::string, position);
|
||||
};
|
||||
};
|
||||
|
||||
class Point: public Module<PointPar>
|
||||
{
|
||||
public:
|
||||
class Point: public Module<PointPar>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
Point(const std::string name);
|
||||
// destructor
|
||||
@ -71,8 +71,9 @@ namespace MSource
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
MODULE_REGISTER_NS(Point, MSource);
|
||||
|
||||
|
@ -49,19 +49,19 @@ BEGIN_HADRONS_NAMESPACE
|
||||
/******************************************************************************
|
||||
* Z2 *
|
||||
******************************************************************************/
|
||||
namespace MSource
|
||||
BEGIN_MODULE_NAMESPACE(MSource)
|
||||
|
||||
class Z2Par: Serializable
|
||||
{
|
||||
class Z2Par: Serializable
|
||||
{
|
||||
public:
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(Z2Par,
|
||||
unsigned int, tA,
|
||||
unsigned int, tB);
|
||||
};
|
||||
};
|
||||
|
||||
class Z2: public Module<Z2Par>
|
||||
{
|
||||
public:
|
||||
class Z2: public Module<Z2Par>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
Z2(const std::string name);
|
||||
// destructor
|
||||
@ -73,8 +73,9 @@ namespace MSource
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
MODULE_REGISTER_NS(Z2, MSource);
|
||||
|
||||
|
@ -10,18 +10,18 @@ BEGIN_HADRONS_NAMESPACE
|
||||
/******************************************************************************
|
||||
* ___FILEBASENAME___ *
|
||||
******************************************************************************/
|
||||
namespace ___NAMESPACE___
|
||||
BEGIN_MODULE_NAMESPACE(___NAMESPACE___)
|
||||
|
||||
class ___FILEBASENAME___Par: Serializable
|
||||
{
|
||||
class ___FILEBASENAME___Par: Serializable
|
||||
{
|
||||
public:
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(___FILEBASENAME___Par,
|
||||
unsigned int, i);
|
||||
};
|
||||
};
|
||||
|
||||
class ___FILEBASENAME___: public Module<___FILEBASENAME___Par>
|
||||
{
|
||||
public:
|
||||
class ___FILEBASENAME___: public Module<___FILEBASENAME___Par>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
___FILEBASENAME___(const std::string name);
|
||||
// destructor
|
||||
@ -33,8 +33,9 @@ namespace ___NAMESPACE___
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
MODULE_REGISTER_NS(___FILEBASENAME___, ___NAMESPACE___);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user