diff --git a/Hadrons/Environment.cc b/Hadrons/Environment.cc index ab5b4de9..d184ac0b 100644 --- a/Hadrons/Environment.cc +++ b/Hadrons/Environment.cc @@ -45,19 +45,13 @@ Environment::Environment(void) { dim_ = GridDefaultLatt(); nd_ = dim_.size(); - defaultGrid_ = {typeHash(), 1}; - grid4d_[defaultGrid_].reset( - SpaceTimeGrid::makeFourDimGrid(dim_, - GridDefaultSimd(nd_, vComplex::Nsimd()), - GridDefaultMpi())); - gridRb4d_[defaultGrid_].reset( - SpaceTimeGrid::makeFourDimRedBlackGrid(grid4d_[defaultGrid_].get())); + createGrid(1); vol_ = 1.; for (auto d: dim_) { vol_ *= d; } - rng4d_.reset(new GridParallelRNG(grid4d_[defaultGrid_].get())); + rng4d_.reset(new GridParallelRNG(getGrid())); } // grids /////////////////////////////////////////////////////////////////////// diff --git a/Hadrons/Environment.hpp b/Hadrons/Environment.hpp index 3cacd28b..8498cf81 100644 --- a/Hadrons/Environment.hpp +++ b/Hadrons/Environment.hpp @@ -174,7 +174,6 @@ private: bool protect_{true}; // grids std::vector dim_; - FineGridKey defaultGrid_; std::map grid4d_; std::map grid5d_; std::map gridRb4d_; diff --git a/Hadrons/Global.hpp b/Hadrons/Global.hpp index 61eb11c2..222990f6 100644 --- a/Hadrons/Global.hpp +++ b/Hadrons/Global.hpp @@ -96,19 +96,20 @@ using Grid::operator>>; BEGIN_HADRONS_NAMESPACE // type aliases -#define FERM_TYPE_ALIASES(FImpl, suffix)\ -typedef FermionOperator FMat##suffix; \ -typedef typename FImpl::FermionField FermionField##suffix; \ -typedef typename FImpl::PropagatorField PropagatorField##suffix; \ -typedef typename FImpl::SitePropagator::scalar_object SitePropagator##suffix; \ -typedef std::vector SlicedPropagator##suffix; +#define BASIC_TYPE_ALIASES(Impl, suffix)\ +typedef typename Impl::Field ScalarField##suffix;\ +typedef typename Impl::PropagatorField PropagatorField##suffix;\ +typedef typename Impl::SitePropagator::scalar_object SitePropagator##suffix;\ +typedef std::vector SlicedPropagator##suffix; -#define GAUGE_TYPE_ALIASES(FImpl, suffix)\ +#define FERM_TYPE_ALIASES(FImpl, suffix)\ +BASIC_TYPE_ALIASES(FImpl, suffix);\ +typedef FermionOperator FMat##suffix;\ +typedef typename FImpl::FermionField FermionField##suffix;\ typedef typename FImpl::DoubledGaugeField DoubledGaugeField##suffix; -#define SCALAR_TYPE_ALIASES(SImpl, suffix)\ -typedef typename SImpl::Field ScalarField##suffix;\ -typedef typename SImpl::Field PropagatorField##suffix; +#define GAUGE_TYPE_ALIASES(GImpl, suffix)\ +typedef typename GImpl::GaugeField GaugeField##suffix; #define SOLVER_TYPE_ALIASES(FImpl, suffix)\ typedef Solver Solver##suffix; @@ -117,10 +118,6 @@ typedef Solver Solver##suffix; typedef std::function SinkFn##suffix; -#define FG_TYPE_ALIASES(FImpl, suffix)\ -FERM_TYPE_ALIASES(FImpl, suffix)\ -GAUGE_TYPE_ALIASES(FImpl, suffix) - // logger class HadronsLogger: public Logger { diff --git a/Hadrons/Module.hpp b/Hadrons/Module.hpp index f16c38e8..e9c1c449 100644 --- a/Hadrons/Module.hpp +++ b/Hadrons/Module.hpp @@ -67,6 +67,12 @@ MODULE_REGISTER(mod, ARG(base), ns); #define ARG(...) __VA_ARGS__ #define MACRO_REDIRECT(arg1, arg2, arg3, macro, ...) macro +#define envCreateGrid(latticeType, Ls)\ +env().template createGrid(Ls) + +#define envGetGrid(latticeType, Ls)\ +env().template getGrid(Ls) + #define envGet(type, name)\ *env().template getObject(name) @@ -86,10 +92,10 @@ env().template createObject(name, Environment::Storage::object, Ls, __VA_A env().template createDerivedObject(name, Environment::Storage::object, Ls, __VA_ARGS__) #define envCreateLat4(type, name)\ -envCreate(type, name, 1, env().getGrid()) +envCreate(type, name, 1, env().template getGrid()) #define envCreateLat5(type, name, Ls)\ -envCreate(type, name, Ls, env().getGrid(Ls)) +envCreate(type, name, Ls, env().template getGrid(Ls)) #define envCreateLat(...)\ MACRO_REDIRECT(__VA_ARGS__, envCreateLat5, envCreateLat4)(__VA_ARGS__) @@ -98,10 +104,10 @@ MACRO_REDIRECT(__VA_ARGS__, envCreateLat5, envCreateLat4)(__VA_ARGS__) env().template createObject(name, Environment::Storage::cache, Ls, __VA_ARGS__) #define envCacheLat4(type, name)\ -envCache(type, name, 1, env().getGrid()) +envCache(type, name, 1, env().template getGrid()) #define envCacheLat5(type, name, Ls)\ -envCache(type, name, Ls, env().getGrid(Ls)) +envCache(type, name, Ls, env().template getGrid(Ls)) #define envCacheLat(...)\ MACRO_REDIRECT(__VA_ARGS__, envCacheLat5, envCacheLat4)(__VA_ARGS__) @@ -111,10 +117,10 @@ env().template createObject(getName() + "_tmp_" + name, \ Environment::Storage::temporary, Ls, __VA_ARGS__) #define envTmpLat4(type, name)\ -envTmp(type, name, 1, env().getGrid()) +envTmp(type, name, 1, env().template getGrid()) #define envTmpLat5(type, name, Ls)\ -envTmp(type, name, Ls, env().getGrid(Ls)) +envTmp(type, name, Ls, env().template getGrid(Ls)) #define envTmpLat(...)\ MACRO_REDIRECT(__VA_ARGS__, envTmpLat5, envTmpLat4)(__VA_ARGS__) diff --git a/Hadrons/Modules/MAction/DWF.hpp b/Hadrons/Modules/MAction/DWF.hpp index 88ceed75..714bccc3 100644 --- a/Hadrons/Modules/MAction/DWF.hpp +++ b/Hadrons/Modules/MAction/DWF.hpp @@ -56,7 +56,7 @@ template class TDWF: public Module { public: - FG_TYPE_ALIASES(FImpl,); + FERM_TYPE_ALIASES(FImpl,); public: // constructor TDWF(const std::string name); diff --git a/Hadrons/Modules/MAction/MobiusDWF.hpp b/Hadrons/Modules/MAction/MobiusDWF.hpp index 47e72ab8..4db2ebb6 100644 --- a/Hadrons/Modules/MAction/MobiusDWF.hpp +++ b/Hadrons/Modules/MAction/MobiusDWF.hpp @@ -56,7 +56,7 @@ template class TMobiusDWF: public Module { public: - FG_TYPE_ALIASES(FImpl,); + FERM_TYPE_ALIASES(FImpl,); public: // constructor TMobiusDWF(const std::string name); diff --git a/Hadrons/Modules/MAction/ScaledDWF.hpp b/Hadrons/Modules/MAction/ScaledDWF.hpp index f4f38810..850a8662 100644 --- a/Hadrons/Modules/MAction/ScaledDWF.hpp +++ b/Hadrons/Modules/MAction/ScaledDWF.hpp @@ -55,7 +55,7 @@ template class TScaledDWF: public Module { public: - FG_TYPE_ALIASES(FImpl,); + FERM_TYPE_ALIASES(FImpl,); public: // constructor TScaledDWF(const std::string name); diff --git a/Hadrons/Modules/MAction/Wilson.hpp b/Hadrons/Modules/MAction/Wilson.hpp index 6fbded7c..cccd648f 100644 --- a/Hadrons/Modules/MAction/Wilson.hpp +++ b/Hadrons/Modules/MAction/Wilson.hpp @@ -54,7 +54,7 @@ template class TWilson: public Module { public: - FG_TYPE_ALIASES(FImpl,); + FERM_TYPE_ALIASES(FImpl,); public: // constructor TWilson(const std::string name); diff --git a/Hadrons/Modules/MAction/WilsonClover.hpp b/Hadrons/Modules/MAction/WilsonClover.hpp index 241bc6f9..48f4f44e 100644 --- a/Hadrons/Modules/MAction/WilsonClover.hpp +++ b/Hadrons/Modules/MAction/WilsonClover.hpp @@ -59,7 +59,7 @@ template class TWilsonClover: public Module { public: - FG_TYPE_ALIASES(FImpl,); + FERM_TYPE_ALIASES(FImpl,); public: // constructor TWilsonClover(const std::string name); diff --git a/Hadrons/Modules/MAction/ZMobiusDWF.hpp b/Hadrons/Modules/MAction/ZMobiusDWF.hpp index 13aaddd6..6a02a1ec 100644 --- a/Hadrons/Modules/MAction/ZMobiusDWF.hpp +++ b/Hadrons/Modules/MAction/ZMobiusDWF.hpp @@ -57,7 +57,7 @@ template class TZMobiusDWF: public Module { public: - FG_TYPE_ALIASES(FImpl,); + FERM_TYPE_ALIASES(FImpl,); public: // constructor TZMobiusDWF(const std::string name); diff --git a/Hadrons/Modules/MContraction/Meson.hpp b/Hadrons/Modules/MContraction/Meson.hpp index a5806d97..514a6bb9 100644 --- a/Hadrons/Modules/MContraction/Meson.hpp +++ b/Hadrons/Modules/MContraction/Meson.hpp @@ -77,7 +77,7 @@ class TMeson: public Module public: FERM_TYPE_ALIASES(FImpl1, 1); FERM_TYPE_ALIASES(FImpl2, 2); - FERM_TYPE_ALIASES(ScalarImplCR, Scalar); + BASIC_TYPE_ALIASES(ScalarImplCR, Scalar); SINK_TYPE_ALIASES(Scalar); class Result: Serializable { diff --git a/Hadrons/Modules/MFermion/FreeProp.hpp b/Hadrons/Modules/MFermion/FreeProp.hpp index 000c2ea1..b5d7b1a3 100644 --- a/Hadrons/Modules/MFermion/FreeProp.hpp +++ b/Hadrons/Modules/MFermion/FreeProp.hpp @@ -56,7 +56,7 @@ template class TFreeProp: public Module { public: - FG_TYPE_ALIASES(FImpl,); + FERM_TYPE_ALIASES(FImpl,); public: // constructor TFreeProp(const std::string name); diff --git a/Hadrons/Modules/MFermion/GaugeProp.hpp b/Hadrons/Modules/MFermion/GaugeProp.hpp index e6408a6d..e779ae68 100644 --- a/Hadrons/Modules/MFermion/GaugeProp.hpp +++ b/Hadrons/Modules/MFermion/GaugeProp.hpp @@ -56,7 +56,7 @@ template class TGaugeProp: public Module { public: - FG_TYPE_ALIASES(FImpl,); + FERM_TYPE_ALIASES(FImpl,); SOLVER_TYPE_ALIASES(FImpl,); public: // constructor diff --git a/Hadrons/Modules/MGauge/Random.cc b/Hadrons/Modules/MGauge/Random.cc index 2c5ae761..040cd91a 100644 --- a/Hadrons/Modules/MGauge/Random.cc +++ b/Hadrons/Modules/MGauge/Random.cc @@ -25,47 +25,10 @@ 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 directory *************************************************************************************/ /* END LEGAL */ - #include using namespace Grid; using namespace Hadrons; using namespace MGauge; -/****************************************************************************** -* TRandom implementation * -******************************************************************************/ -// constructor ///////////////////////////////////////////////////////////////// -TRandom::TRandom(const std::string name) -: Module(name) -{} - -// dependencies/products /////////////////////////////////////////////////////// -std::vector TRandom::getInput(void) -{ - std::vector in; - - return in; -} - -std::vector TRandom::getOutput(void) -{ - std::vector out = {getName()}; - - return out; -} - -// setup /////////////////////////////////////////////////////////////////////// -void TRandom::setup(void) -{ - envCreateLat(LatticeGaugeField, getName()); -} - -// execution /////////////////////////////////////////////////////////////////// -void TRandom::execute(void) -{ - LOG(Message) << "Generating random gauge configuration" << std::endl; - - auto &U = envGet(LatticeGaugeField, getName()); - SU3::HotConfiguration(rng4d(), U); -} +template class Grid::Hadrons::MGauge::TRandom; diff --git a/Hadrons/Modules/MGauge/Random.hpp b/Hadrons/Modules/MGauge/Random.hpp index 6a9c3592..84b8dba0 100644 --- a/Hadrons/Modules/MGauge/Random.hpp +++ b/Hadrons/Modules/MGauge/Random.hpp @@ -40,8 +40,11 @@ BEGIN_HADRONS_NAMESPACE ******************************************************************************/ BEGIN_MODULE_NAMESPACE(MGauge) +template class TRandom: public Module { +public: + GAUGE_TYPE_ALIASES(GImpl,); public: // constructor TRandom(const std::string name); @@ -57,7 +60,50 @@ protected: virtual void execute(void); }; -MODULE_REGISTER(Random, TRandom, MGauge); +MODULE_REGISTER_TMP(Random, TRandom, MGauge); + +/****************************************************************************** +* TRandom implementation * +******************************************************************************/ +// constructor ///////////////////////////////////////////////////////////////// +template +TRandom::TRandom(const std::string name) +: Module(name) +{} + +// dependencies/products /////////////////////////////////////////////////////// +template +std::vector TRandom::getInput(void) +{ + std::vector in; + + return in; +} + +template +std::vector TRandom::getOutput(void) +{ + std::vector out = {getName()}; + + return out; +} + +// setup /////////////////////////////////////////////////////////////////////// +template +void TRandom::setup(void) +{ + envCreateLat(GaugeField, getName()); +} + +// execution /////////////////////////////////////////////////////////////////// +template +void TRandom::execute(void) +{ + LOG(Message) << "Generating random gauge configuration" << std::endl; + + auto &U = envGet(GaugeField, getName()); + GImpl::HotConfiguration(rng4d(), U); +} END_MODULE_NAMESPACE diff --git a/Hadrons/Modules/MGauge/StoutSmearing.hpp b/Hadrons/Modules/MGauge/StoutSmearing.hpp index e859dde5..973ac38d 100644 --- a/Hadrons/Modules/MGauge/StoutSmearing.hpp +++ b/Hadrons/Modules/MGauge/StoutSmearing.hpp @@ -52,7 +52,7 @@ template class TStoutSmearing: public Module { public: - typedef typename GImpl::Field GaugeField; + GAUGE_TYPE_ALIASES(GImpl,); public: // constructor TStoutSmearing(const std::string name); diff --git a/Hadrons/Modules/MGauge/Unit.cc b/Hadrons/Modules/MGauge/Unit.cc index f273a187..02ad7c0b 100644 --- a/Hadrons/Modules/MGauge/Unit.cc +++ b/Hadrons/Modules/MGauge/Unit.cc @@ -25,45 +25,10 @@ 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 directory *************************************************************************************/ /* END LEGAL */ - #include using namespace Grid; using namespace Hadrons; using namespace MGauge; -/****************************************************************************** -* TUnit implementation * -******************************************************************************/ -// constructor ///////////////////////////////////////////////////////////////// -TUnit::TUnit(const std::string name) -: Module(name) -{} - -// dependencies/products /////////////////////////////////////////////////////// -std::vector TUnit::getInput(void) -{ - return std::vector(); -} - -std::vector TUnit::getOutput(void) -{ - std::vector out = {getName()}; - - return out; -} - -// setup /////////////////////////////////////////////////////////////////////// -void TUnit::setup(void) -{ - envCreateLat(LatticeGaugeField, getName()); -} - -// execution /////////////////////////////////////////////////////////////////// -void TUnit::execute(void) -{ - LOG(Message) << "Creating unit gauge configuration" << std::endl; - - auto &U = envGet(LatticeGaugeField, getName()); - SU3::ColdConfiguration(rng4d(), U); -} +template class Grid::Hadrons::MGauge::TUnit; diff --git a/Hadrons/Modules/MGauge/Unit.hpp b/Hadrons/Modules/MGauge/Unit.hpp index f0af186f..f123f25b 100644 --- a/Hadrons/Modules/MGauge/Unit.hpp +++ b/Hadrons/Modules/MGauge/Unit.hpp @@ -40,8 +40,11 @@ BEGIN_HADRONS_NAMESPACE ******************************************************************************/ BEGIN_MODULE_NAMESPACE(MGauge) +template class TUnit: public Module { +public: + GAUGE_TYPE_ALIASES(GImpl,); public: // constructor TUnit(const std::string name); @@ -57,7 +60,48 @@ protected: virtual void execute(void); }; -MODULE_REGISTER(Unit, TUnit, MGauge); +MODULE_REGISTER_TMP(Unit, TUnit, MGauge); + +/****************************************************************************** +* TUnit implementation * +******************************************************************************/ +// constructor ///////////////////////////////////////////////////////////////// +template +TUnit::TUnit(const std::string name) +: Module(name) +{} + +// dependencies/products /////////////////////////////////////////////////////// +template +std::vector TUnit::getInput(void) +{ + return std::vector(); +} + +template +std::vector TUnit::getOutput(void) +{ + std::vector out = {getName()}; + + return out; +} + +// setup /////////////////////////////////////////////////////////////////////// +template +void TUnit::setup(void) +{ + envCreateLat(GaugeField, getName()); +} + +// execution /////////////////////////////////////////////////////////////////// +template +void TUnit::execute(void) +{ + LOG(Message) << "Creating unit gauge configuration" << std::endl; + + auto &U = envGet(GaugeField, getName()); + GImpl::ColdConfiguration(rng4d(), U); +} END_MODULE_NAMESPACE diff --git a/Hadrons/Modules/MIO/LoadNersc.cc b/Hadrons/Modules/MIO/LoadNersc.cc index 6d26c2a8..ce7276f9 100644 --- a/Hadrons/Modules/MIO/LoadNersc.cc +++ b/Hadrons/Modules/MIO/LoadNersc.cc @@ -31,44 +31,4 @@ using namespace Grid; using namespace Hadrons; using namespace MIO; -/****************************************************************************** -* TLoadNersc implementation * -******************************************************************************/ -// constructor ///////////////////////////////////////////////////////////////// -TLoadNersc::TLoadNersc(const std::string name) -: Module(name) -{} - -// dependencies/products /////////////////////////////////////////////////////// -std::vector TLoadNersc::getInput(void) -{ - std::vector in; - - return in; -} - -std::vector TLoadNersc::getOutput(void) -{ - std::vector out = {getName()}; - - return out; -} - -// setup /////////////////////////////////////////////////////////////////////// -void TLoadNersc::setup(void) -{ - envCreateLat(LatticeGaugeField, getName()); -} - -// execution /////////////////////////////////////////////////////////////////// -void TLoadNersc::execute(void) -{ - FieldMetaData header; - std::string fileName = par().file + "." - + std::to_string(vm().getTrajectory()); - LOG(Message) << "Loading NERSC configuration from file '" << fileName - << "'" << std::endl; - - auto &U = envGet(LatticeGaugeField, getName()); - NerscIO::readConfiguration(U, header, fileName); -} +template class Grid::Hadrons::MIO::TLoadNersc; diff --git a/Hadrons/Modules/MIO/LoadNersc.hpp b/Hadrons/Modules/MIO/LoadNersc.hpp index 231b2f47..c0e69511 100644 --- a/Hadrons/Modules/MIO/LoadNersc.hpp +++ b/Hadrons/Modules/MIO/LoadNersc.hpp @@ -46,8 +46,11 @@ public: std::string, file); }; +template class TLoadNersc: public Module { +public: + GAUGE_TYPE_ALIASES(GImpl,); public: // constructor TLoadNersc(const std::string name); @@ -62,7 +65,54 @@ public: virtual void execute(void); }; -MODULE_REGISTER(LoadNersc, TLoadNersc, MIO); +MODULE_REGISTER_TMP(LoadNersc, TLoadNersc, MIO); + +/****************************************************************************** +* TLoadNersc implementation * +******************************************************************************/ +// constructor ///////////////////////////////////////////////////////////////// +template +TLoadNersc::TLoadNersc(const std::string name) +: Module(name) +{} + +// dependencies/products /////////////////////////////////////////////////////// +template +std::vector TLoadNersc::getInput(void) +{ + std::vector in; + + return in; +} + +template +std::vector TLoadNersc::getOutput(void) +{ + std::vector out = {getName()}; + + return out; +} + +// setup /////////////////////////////////////////////////////////////////////// +template +void TLoadNersc::setup(void) +{ + envCreateLat(GaugeField, getName()); +} + +// execution /////////////////////////////////////////////////////////////////// +template +void TLoadNersc::execute(void) +{ + FieldMetaData header; + std::string fileName = par().file + "." + + std::to_string(vm().getTrajectory()); + LOG(Message) << "Loading NERSC configuration from file '" << fileName + << "'" << std::endl; + + auto &U = envGet(GaugeField, getName()); + NerscIO::readConfiguration(U, header, fileName); +} END_MODULE_NAMESPACE diff --git a/Hadrons/Modules/MScalar/ChargedProp.hpp b/Hadrons/Modules/MScalar/ChargedProp.hpp index bf098cd1..443c38a6 100644 --- a/Hadrons/Modules/MScalar/ChargedProp.hpp +++ b/Hadrons/Modules/MScalar/ChargedProp.hpp @@ -55,7 +55,7 @@ public: class TChargedProp: public Module { public: - SCALAR_TYPE_ALIASES(SIMPL,); + BASIC_TYPE_ALIASES(SIMPL,); typedef PhotonR::GaugeField EmField; typedef PhotonR::GaugeLinkField EmComp; class Result: Serializable diff --git a/Hadrons/Modules/MScalar/FreeProp.hpp b/Hadrons/Modules/MScalar/FreeProp.hpp index 25f5f709..5ed6756d 100644 --- a/Hadrons/Modules/MScalar/FreeProp.hpp +++ b/Hadrons/Modules/MScalar/FreeProp.hpp @@ -51,7 +51,7 @@ public: class TFreeProp: public Module { public: - SCALAR_TYPE_ALIASES(SIMPL,); + BASIC_TYPE_ALIASES(SIMPL,); public: // constructor TFreeProp(const std::string name); diff --git a/Hadrons/Modules/MScalar/ScalarVP.hpp b/Hadrons/Modules/MScalar/ScalarVP.hpp index b7b2431f..3cd01249 100644 --- a/Hadrons/Modules/MScalar/ScalarVP.hpp +++ b/Hadrons/Modules/MScalar/ScalarVP.hpp @@ -53,7 +53,7 @@ public: class TScalarVP: public Module { public: - SCALAR_TYPE_ALIASES(SIMPL,); + BASIC_TYPE_ALIASES(SIMPL,); typedef PhotonR::GaugeField EmField; typedef PhotonR::GaugeLinkField EmComp; class Result: Serializable diff --git a/Hadrons/Modules/MScalar/VPCounterTerms.hpp b/Hadrons/Modules/MScalar/VPCounterTerms.hpp index e7335694..8bbc3e20 100644 --- a/Hadrons/Modules/MScalar/VPCounterTerms.hpp +++ b/Hadrons/Modules/MScalar/VPCounterTerms.hpp @@ -53,7 +53,7 @@ public: class TVPCounterTerms: public Module { public: - SCALAR_TYPE_ALIASES(SIMPL,); + BASIC_TYPE_ALIASES(SIMPL,); class Result: Serializable { public: diff --git a/Hadrons/Modules/MSink/Point.hpp b/Hadrons/Modules/MSink/Point.hpp index ea164ced..f7970346 100644 --- a/Hadrons/Modules/MSink/Point.hpp +++ b/Hadrons/Modules/MSink/Point.hpp @@ -53,7 +53,7 @@ template class TPoint: public Module { public: - FERM_TYPE_ALIASES(FImpl,); + BASIC_TYPE_ALIASES(FImpl,); SINK_TYPE_ALIASES(); public: // constructor diff --git a/Hadrons/Modules/MSolver/MixedPrecisionRBPrecCG.hpp b/Hadrons/Modules/MSolver/MixedPrecisionRBPrecCG.hpp index 5ada4e69..5be1e3ce 100644 --- a/Hadrons/Modules/MSolver/MixedPrecisionRBPrecCG.hpp +++ b/Hadrons/Modules/MSolver/MixedPrecisionRBPrecCG.hpp @@ -58,8 +58,8 @@ template class TMixedPrecisionRBPrecCG: public Module { public: - FG_TYPE_ALIASES(FImplInner, Inner); - FG_TYPE_ALIASES(FImplOuter, Outer); + FERM_TYPE_ALIASES(FImplInner, Inner); + FERM_TYPE_ALIASES(FImplOuter, Outer); SOLVER_TYPE_ALIASES(FImplOuter,); typedef HADRONS_DEFAULT_SCHUR_OP SchurFMatInner; typedef HADRONS_DEFAULT_SCHUR_OP SchurFMatOuter; diff --git a/Hadrons/Modules/MSolver/RBPrecCG.hpp b/Hadrons/Modules/MSolver/RBPrecCG.hpp index 09779b3a..8c83c6a1 100644 --- a/Hadrons/Modules/MSolver/RBPrecCG.hpp +++ b/Hadrons/Modules/MSolver/RBPrecCG.hpp @@ -58,7 +58,7 @@ template class TRBPrecCG: public Module { public: - FG_TYPE_ALIASES(FImpl,); + FERM_TYPE_ALIASES(FImpl,); SOLVER_TYPE_ALIASES(FImpl,); public: // constructor diff --git a/Hadrons/Modules/MSource/Point.hpp b/Hadrons/Modules/MSource/Point.hpp index 076a078d..082c04e8 100644 --- a/Hadrons/Modules/MSource/Point.hpp +++ b/Hadrons/Modules/MSource/Point.hpp @@ -63,7 +63,7 @@ template class TPoint: public Module { public: - FERM_TYPE_ALIASES(FImpl,); + BASIC_TYPE_ALIASES(FImpl,); public: // constructor TPoint(const std::string name); diff --git a/Hadrons/Modules/MSource/SeqGamma.hpp b/Hadrons/Modules/MSource/SeqGamma.hpp index 59776e80..59fdb7ae 100644 --- a/Hadrons/Modules/MSource/SeqGamma.hpp +++ b/Hadrons/Modules/MSource/SeqGamma.hpp @@ -71,7 +71,7 @@ template class TSeqGamma: public Module { public: - FG_TYPE_ALIASES(FImpl,); + FERM_TYPE_ALIASES(FImpl,); public: // constructor TSeqGamma(const std::string name); @@ -125,7 +125,7 @@ template void TSeqGamma::setup(void) { envCreateLat(PropagatorField, getName()); - envCacheLat(Lattice>, tName_); + envCache(Lattice>, tName_, 1, env().getGrid()); envCacheLat(LatticeComplex, momphName_); envTmpLat(LatticeComplex, "coor"); } diff --git a/Hadrons/Modules/MSource/Z2.hpp b/Hadrons/Modules/MSource/Z2.hpp index f2ca50be..ec57fbd4 100644 --- a/Hadrons/Modules/MSource/Z2.hpp +++ b/Hadrons/Modules/MSource/Z2.hpp @@ -66,7 +66,7 @@ template class TZ2: public Module { public: - FERM_TYPE_ALIASES(FImpl,); + BASIC_TYPE_ALIASES(FImpl,); public: // constructor TZ2(const std::string name); @@ -120,7 +120,7 @@ template void TZ2::setup(void) { envCreateLat(PropagatorField, getName()); - envCacheLat(Lattice>, tName_); + envCache(Lattice>, tName_, 1, env().getGrid()); envTmpLat(LatticeComplex, "eta"); } diff --git a/Hadrons/Modules/MUtilities/RandomVectors.hpp b/Hadrons/Modules/MUtilities/RandomVectors.hpp index 570198d4..2444b850 100644 --- a/Hadrons/Modules/MUtilities/RandomVectors.hpp +++ b/Hadrons/Modules/MUtilities/RandomVectors.hpp @@ -96,8 +96,15 @@ std::vector TRandomVectors::getOutput(void) template void TRandomVectors::setup(void) { - envCreate(std::vector, getName(), par().Ls, par().size, - env().getGrid(par().Ls)); + if (par().Ls > 1) + { + envCreate(std::vector, getName(), par().Ls, par().size, + env().getGrid(par().Ls)); + } + else + { + envCreate(std::vector, getName(), 1, par().size, env().getGrid()); + } } // execution ///////////////////////////////////////////////////////////////////