mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-04 19:25:56 +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,34 +37,35 @@ BEGIN_HADRONS_NAMESPACE
|
||||
/******************************************************************************
|
||||
* Domain wall quark action *
|
||||
******************************************************************************/
|
||||
namespace MAction
|
||||
BEGIN_MODULE_NAMESPACE(MAction)
|
||||
|
||||
class DWFPar: Serializable
|
||||
{
|
||||
class DWFPar: Serializable
|
||||
{
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(DWFPar,
|
||||
std::string, gauge,
|
||||
unsigned int, Ls,
|
||||
double , mass,
|
||||
double , M5);
|
||||
};
|
||||
|
||||
class DWF: public Module<DWFPar>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
DWF(const std::string name);
|
||||
// destructor
|
||||
virtual ~DWF(void) = default;
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// setup
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
}
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(DWFPar,
|
||||
std::string, gauge,
|
||||
unsigned int, Ls,
|
||||
double , mass,
|
||||
double , M5);
|
||||
};
|
||||
|
||||
class DWF: public Module<DWFPar>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
DWF(const std::string name);
|
||||
// destructor
|
||||
virtual ~DWF(void) = default;
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// setup
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
MODULE_REGISTER_NS(DWF, MAction);
|
||||
|
||||
|
@ -37,32 +37,33 @@ BEGIN_HADRONS_NAMESPACE
|
||||
/******************************************************************************
|
||||
* Wilson quark action *
|
||||
******************************************************************************/
|
||||
namespace MAction
|
||||
{
|
||||
class WilsonPar: Serializable
|
||||
{
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(WilsonPar,
|
||||
std::string, gauge,
|
||||
double , mass);
|
||||
};
|
||||
BEGIN_MODULE_NAMESPACE(MAction)
|
||||
|
||||
class Wilson: public Module<WilsonPar>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
Wilson(const std::string name);
|
||||
// destructor
|
||||
virtual ~Wilson(void) = default;
|
||||
// dependencies/products
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// setup
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
}
|
||||
class WilsonPar: Serializable
|
||||
{
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(WilsonPar,
|
||||
std::string, gauge,
|
||||
double , mass);
|
||||
};
|
||||
|
||||
class Wilson: public Module<WilsonPar>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
Wilson(const std::string name);
|
||||
// destructor
|
||||
virtual ~Wilson(void) = default;
|
||||
// dependencies/products
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// setup
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
MODULE_REGISTER_NS(Wilson, MAction);
|
||||
|
||||
|
@ -37,38 +37,39 @@ BEGIN_HADRONS_NAMESPACE
|
||||
/******************************************************************************
|
||||
* Meson *
|
||||
******************************************************************************/
|
||||
namespace MContraction
|
||||
BEGIN_MODULE_NAMESPACE(MContraction)
|
||||
|
||||
class MesonPar: Serializable
|
||||
{
|
||||
class MesonPar: Serializable
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(MesonPar,
|
||||
std::string, q1,
|
||||
std::string, q2,
|
||||
std::string, output);
|
||||
};
|
||||
|
||||
class Meson: public Module<MesonPar>
|
||||
{
|
||||
public:
|
||||
class Result: Serializable
|
||||
{
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(MesonPar,
|
||||
std::string, q1,
|
||||
std::string, q2,
|
||||
std::string, output);
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(Result,
|
||||
std::vector<std::vector<std::vector<Complex>>>, corr);
|
||||
};
|
||||
|
||||
class Meson: public Module<MesonPar>
|
||||
{
|
||||
public:
|
||||
class Result: Serializable
|
||||
{
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(Result,
|
||||
std::vector<std::vector<std::vector<Complex>>>, corr);
|
||||
};
|
||||
public:
|
||||
// constructor
|
||||
Meson(const std::string name);
|
||||
// destructor
|
||||
virtual ~Meson(void) = default;
|
||||
// dependencies/products
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
}
|
||||
public:
|
||||
// constructor
|
||||
Meson(const std::string name);
|
||||
// destructor
|
||||
virtual ~Meson(void) = default;
|
||||
// dependencies/products
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
MODULE_REGISTER_NS(Meson, MContraction);
|
||||
|
||||
|
@ -37,31 +37,32 @@ BEGIN_HADRONS_NAMESPACE
|
||||
/******************************************************************************
|
||||
* Load a NERSC configuration *
|
||||
******************************************************************************/
|
||||
namespace MGauge
|
||||
{
|
||||
class LoadPar: Serializable
|
||||
{
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(LoadPar,
|
||||
std::string, file);
|
||||
};
|
||||
BEGIN_MODULE_NAMESPACE(MGauge)
|
||||
|
||||
class Load: public Module<LoadPar>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
Load(const std::string name);
|
||||
// destructor
|
||||
virtual ~Load(void) = default;
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// setup
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
}
|
||||
class LoadPar: Serializable
|
||||
{
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(LoadPar,
|
||||
std::string, file);
|
||||
};
|
||||
|
||||
class Load: public Module<LoadPar>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
Load(const std::string name);
|
||||
// destructor
|
||||
virtual ~Load(void) = default;
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// setup
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
MODULE_REGISTER_NS(Load, MGauge);
|
||||
|
||||
|
@ -37,24 +37,25 @@ BEGIN_HADRONS_NAMESPACE
|
||||
/******************************************************************************
|
||||
* Random gauge *
|
||||
******************************************************************************/
|
||||
namespace MGauge
|
||||
BEGIN_MODULE_NAMESPACE(MGauge)
|
||||
|
||||
class Random: public Module<NoPar>
|
||||
{
|
||||
class Random: public Module<NoPar>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
Random(const std::string name);
|
||||
// destructor
|
||||
virtual ~Random(void) = default;
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// setup
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
}
|
||||
public:
|
||||
// constructor
|
||||
Random(const std::string name);
|
||||
// destructor
|
||||
virtual ~Random(void) = default;
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// setup
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
MODULE_REGISTER_NS(Random, MGauge);
|
||||
|
||||
|
@ -37,24 +37,25 @@ BEGIN_HADRONS_NAMESPACE
|
||||
/******************************************************************************
|
||||
* Unit gauge *
|
||||
******************************************************************************/
|
||||
namespace MGauge
|
||||
BEGIN_MODULE_NAMESPACE(MGauge)
|
||||
|
||||
class Unit: public Module<NoPar>
|
||||
{
|
||||
class Unit: public Module<NoPar>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
Unit(const std::string name);
|
||||
// destructor
|
||||
virtual ~Unit(void) = default;
|
||||
// dependencies/products
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// setup
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
}
|
||||
public:
|
||||
// constructor
|
||||
Unit(const std::string name);
|
||||
// destructor
|
||||
virtual ~Unit(void) = default;
|
||||
// dependencies/products
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// setup
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
MODULE_REGISTER_NS(Unit, MGauge);
|
||||
|
||||
|
@ -37,32 +37,33 @@ BEGIN_HADRONS_NAMESPACE
|
||||
/******************************************************************************
|
||||
* Schur red-black preconditioned CG *
|
||||
******************************************************************************/
|
||||
namespace MSolver
|
||||
BEGIN_MODULE_NAMESPACE(MSolver)
|
||||
|
||||
class RBPrecCGPar: Serializable
|
||||
{
|
||||
class RBPrecCGPar: Serializable
|
||||
{
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(RBPrecCGPar,
|
||||
std::string, action,
|
||||
double , residual);
|
||||
};
|
||||
|
||||
class RBPrecCG: public Module<RBPrecCGPar>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
RBPrecCG(const std::string name);
|
||||
// destructor
|
||||
virtual ~RBPrecCG(void) = default;
|
||||
// dependencies/products
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// setup
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
}
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(RBPrecCGPar,
|
||||
std::string, action,
|
||||
double , residual);
|
||||
};
|
||||
|
||||
class RBPrecCG: public Module<RBPrecCGPar>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
RBPrecCG(const std::string name);
|
||||
// destructor
|
||||
virtual ~RBPrecCG(void) = default;
|
||||
// dependencies/products
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// setup
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
MODULE_REGISTER_NS(RBPrecCG, MSolver);
|
||||
|
||||
|
@ -48,31 +48,32 @@ BEGIN_HADRONS_NAMESPACE
|
||||
/******************************************************************************
|
||||
* Point *
|
||||
******************************************************************************/
|
||||
namespace MSource
|
||||
BEGIN_MODULE_NAMESPACE(MSource)
|
||||
|
||||
class PointPar: Serializable
|
||||
{
|
||||
class PointPar: Serializable
|
||||
{
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(PointPar,
|
||||
std::string, position);
|
||||
};
|
||||
|
||||
class Point: public Module<PointPar>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
Point(const std::string name);
|
||||
// destructor
|
||||
virtual ~Point(void) = default;
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// setup
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
}
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(PointPar,
|
||||
std::string, position);
|
||||
};
|
||||
|
||||
class Point: public Module<PointPar>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
Point(const std::string name);
|
||||
// destructor
|
||||
virtual ~Point(void) = default;
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// setup
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
MODULE_REGISTER_NS(Point, MSource);
|
||||
|
||||
|
@ -49,32 +49,33 @@ BEGIN_HADRONS_NAMESPACE
|
||||
/******************************************************************************
|
||||
* Z2 *
|
||||
******************************************************************************/
|
||||
namespace MSource
|
||||
{
|
||||
class Z2Par: Serializable
|
||||
{
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(Z2Par,
|
||||
unsigned int, tA,
|
||||
unsigned int, tB);
|
||||
};
|
||||
BEGIN_MODULE_NAMESPACE(MSource)
|
||||
|
||||
class Z2: public Module<Z2Par>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
Z2(const std::string name);
|
||||
// destructor
|
||||
virtual ~Z2(void) = default;
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// setup
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
}
|
||||
class Z2Par: Serializable
|
||||
{
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(Z2Par,
|
||||
unsigned int, tA,
|
||||
unsigned int, tB);
|
||||
};
|
||||
|
||||
class Z2: public Module<Z2Par>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
Z2(const std::string name);
|
||||
// destructor
|
||||
virtual ~Z2(void) = default;
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// setup
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
MODULE_REGISTER_NS(Z2, MSource);
|
||||
|
||||
|
@ -10,31 +10,32 @@ BEGIN_HADRONS_NAMESPACE
|
||||
/******************************************************************************
|
||||
* ___FILEBASENAME___ *
|
||||
******************************************************************************/
|
||||
namespace ___NAMESPACE___
|
||||
BEGIN_MODULE_NAMESPACE(___NAMESPACE___)
|
||||
|
||||
class ___FILEBASENAME___Par: Serializable
|
||||
{
|
||||
class ___FILEBASENAME___Par: Serializable
|
||||
{
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(___FILEBASENAME___Par,
|
||||
unsigned int, i);
|
||||
};
|
||||
|
||||
class ___FILEBASENAME___: public Module<___FILEBASENAME___Par>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
___FILEBASENAME___(const std::string name);
|
||||
// destructor
|
||||
virtual ~___FILEBASENAME___(void) = default;
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// setup
|
||||
virtual void setup(void);
|
||||
// execution
|
||||
virtual void execute(void);
|
||||
};
|
||||
}
|
||||
public:
|
||||
GRID_SERIALIZABLE_CLASS_MEMBERS(___FILEBASENAME___Par,
|
||||
unsigned int, i);
|
||||
};
|
||||
|
||||
class ___FILEBASENAME___: public Module<___FILEBASENAME___Par>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
___FILEBASENAME___(const std::string name);
|
||||
// destructor
|
||||
virtual ~___FILEBASENAME___(void) = default;
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
// setup
|
||||
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