mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-13 04:37:05 +01:00
Hadrons: modules remember their factory registration name
This commit is contained in:
@ -32,22 +32,22 @@ using namespace Hadrons;
|
||||
using namespace MGauge;
|
||||
|
||||
/******************************************************************************
|
||||
* Load implementation *
|
||||
* TLoad implementation *
|
||||
******************************************************************************/
|
||||
// constructor /////////////////////////////////////////////////////////////////
|
||||
Load::Load(const std::string name)
|
||||
TLoad::TLoad(const std::string name)
|
||||
: Module<LoadPar>(name)
|
||||
{}
|
||||
|
||||
// dependencies/products ///////////////////////////////////////////////////////
|
||||
std::vector<std::string> Load::getInput(void)
|
||||
std::vector<std::string> TLoad::getInput(void)
|
||||
{
|
||||
std::vector<std::string> in;
|
||||
|
||||
return in;
|
||||
}
|
||||
|
||||
std::vector<std::string> Load::getOutput(void)
|
||||
std::vector<std::string> TLoad::getOutput(void)
|
||||
{
|
||||
std::vector<std::string> out = {getName()};
|
||||
|
||||
@ -55,13 +55,13 @@ std::vector<std::string> Load::getOutput(void)
|
||||
}
|
||||
|
||||
// setup ///////////////////////////////////////////////////////////////////////
|
||||
void Load::setup(void)
|
||||
void TLoad::setup(void)
|
||||
{
|
||||
env().registerLattice<LatticeGaugeField>(getName());
|
||||
}
|
||||
|
||||
// execution ///////////////////////////////////////////////////////////////////
|
||||
void Load::execute(void)
|
||||
void TLoad::execute(void)
|
||||
{
|
||||
NerscField header;
|
||||
std::string fileName = par().file + "."
|
||||
|
@ -46,13 +46,13 @@ public:
|
||||
std::string, file);
|
||||
};
|
||||
|
||||
class Load: public Module<LoadPar>
|
||||
class TLoad: public Module<LoadPar>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
Load(const std::string name);
|
||||
TLoad(const std::string name);
|
||||
// destructor
|
||||
virtual ~Load(void) = default;
|
||||
virtual ~TLoad(void) = default;
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@ -62,9 +62,9 @@ public:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
MODULE_REGISTER_NS(Load, TLoad, MGauge);
|
||||
|
||||
MODULE_REGISTER_NS(Load, MGauge);
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
END_HADRONS_NAMESPACE
|
||||
|
||||
|
@ -32,20 +32,20 @@ using namespace Hadrons;
|
||||
using namespace MGauge;
|
||||
|
||||
/******************************************************************************
|
||||
* Random implementation *
|
||||
* TRandom implementation *
|
||||
******************************************************************************/
|
||||
// constructor /////////////////////////////////////////////////////////////////
|
||||
Random::Random(const std::string name)
|
||||
TRandom::TRandom(const std::string name)
|
||||
: Module<NoPar>(name)
|
||||
{}
|
||||
|
||||
// dependencies/products ///////////////////////////////////////////////////////
|
||||
std::vector<std::string> Random::getInput(void)
|
||||
std::vector<std::string> TRandom::getInput(void)
|
||||
{
|
||||
return std::vector<std::string>();
|
||||
}
|
||||
|
||||
std::vector<std::string> Random::getOutput(void)
|
||||
std::vector<std::string> TRandom::getOutput(void)
|
||||
{
|
||||
std::vector<std::string> out = {getName()};
|
||||
|
||||
@ -53,13 +53,13 @@ std::vector<std::string> Random::getOutput(void)
|
||||
}
|
||||
|
||||
// setup ///////////////////////////////////////////////////////////////////////
|
||||
void Random::setup(void)
|
||||
void TRandom::setup(void)
|
||||
{
|
||||
env().registerLattice<LatticeGaugeField>(getName());
|
||||
}
|
||||
|
||||
// execution ///////////////////////////////////////////////////////////////////
|
||||
void Random::execute(void)
|
||||
void TRandom::execute(void)
|
||||
{
|
||||
LOG(Message) << "Generating random gauge configuration" << std::endl;
|
||||
LatticeGaugeField &U = *env().createLattice<LatticeGaugeField>(getName());
|
||||
|
@ -39,13 +39,13 @@ BEGIN_HADRONS_NAMESPACE
|
||||
******************************************************************************/
|
||||
BEGIN_MODULE_NAMESPACE(MGauge)
|
||||
|
||||
class Random: public Module<NoPar>
|
||||
class TRandom: public Module<NoPar>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
Random(const std::string name);
|
||||
TRandom(const std::string name);
|
||||
// destructor
|
||||
virtual ~Random(void) = default;
|
||||
virtual ~TRandom(void) = default;
|
||||
// dependency relation
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@ -55,9 +55,9 @@ public:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
MODULE_REGISTER_NS(Random, TRandom, MGauge);
|
||||
|
||||
MODULE_REGISTER_NS(Random, MGauge);
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
END_HADRONS_NAMESPACE
|
||||
|
||||
|
@ -32,20 +32,20 @@ using namespace Hadrons;
|
||||
using namespace MGauge;
|
||||
|
||||
/******************************************************************************
|
||||
* Unit implementation *
|
||||
* TUnit implementation *
|
||||
******************************************************************************/
|
||||
// constructor /////////////////////////////////////////////////////////////////
|
||||
Unit::Unit(const std::string name)
|
||||
TUnit::TUnit(const std::string name)
|
||||
: Module<NoPar>(name)
|
||||
{}
|
||||
|
||||
// dependencies/products ///////////////////////////////////////////////////////
|
||||
std::vector<std::string> Unit::getInput(void)
|
||||
std::vector<std::string> TUnit::getInput(void)
|
||||
{
|
||||
return std::vector<std::string>();
|
||||
}
|
||||
|
||||
std::vector<std::string> Unit::getOutput(void)
|
||||
std::vector<std::string> TUnit::getOutput(void)
|
||||
{
|
||||
std::vector<std::string> out = {getName()};
|
||||
|
||||
@ -53,13 +53,13 @@ std::vector<std::string> Unit::getOutput(void)
|
||||
}
|
||||
|
||||
// setup ///////////////////////////////////////////////////////////////////////
|
||||
void Unit::setup(void)
|
||||
void TUnit::setup(void)
|
||||
{
|
||||
env().registerLattice<LatticeGaugeField>(getName());
|
||||
}
|
||||
|
||||
// execution ///////////////////////////////////////////////////////////////////
|
||||
void Unit::execute(void)
|
||||
void TUnit::execute(void)
|
||||
{
|
||||
LOG(Message) << "Creating unit gauge configuration" << std::endl;
|
||||
LatticeGaugeField &U = *env().createLattice<LatticeGaugeField>(getName());
|
||||
|
@ -39,13 +39,13 @@ BEGIN_HADRONS_NAMESPACE
|
||||
******************************************************************************/
|
||||
BEGIN_MODULE_NAMESPACE(MGauge)
|
||||
|
||||
class Unit: public Module<NoPar>
|
||||
class TUnit: public Module<NoPar>
|
||||
{
|
||||
public:
|
||||
// constructor
|
||||
Unit(const std::string name);
|
||||
TUnit(const std::string name);
|
||||
// destructor
|
||||
virtual ~Unit(void) = default;
|
||||
virtual ~TUnit(void) = default;
|
||||
// dependencies/products
|
||||
virtual std::vector<std::string> getInput(void);
|
||||
virtual std::vector<std::string> getOutput(void);
|
||||
@ -55,9 +55,9 @@ public:
|
||||
virtual void execute(void);
|
||||
};
|
||||
|
||||
END_MODULE_NAMESPACE
|
||||
MODULE_REGISTER_NS(Unit, TUnit, MGauge);
|
||||
|
||||
MODULE_REGISTER_NS(Unit, MGauge);
|
||||
END_MODULE_NAMESPACE
|
||||
|
||||
END_HADRONS_NAMESPACE
|
||||
|
||||
|
Reference in New Issue
Block a user