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

Streamline

This commit is contained in:
Michael Marshall 2019-11-12 23:57:28 +00:00
parent e2ab0d671e
commit 55e743aad6
2 changed files with 17 additions and 45 deletions

View File

@ -44,7 +44,7 @@ class LoadDistilNoisePar: Serializable
public: public:
GRID_SERIALIZABLE_CLASS_MEMBERS(LoadDistilNoisePar, GRID_SERIALIZABLE_CLASS_MEMBERS(LoadDistilNoisePar,
std::string, NoiseFileName, std::string, NoiseFileName,
std::string, DistilPar); std::string, DistilParams);
}; };
template <typename FImpl> template <typename FImpl>
@ -62,8 +62,6 @@ public:
virtual void setup(void); virtual void setup(void);
// execution // execution
virtual void execute(void); virtual void execute(void);
protected:
std::string DParName;
}; };
MODULE_REGISTER_TMP(LoadDistilNoise, TLoadDistilNoise<FIMPL>, MIO); MODULE_REGISTER_TMP(LoadDistilNoise, TLoadDistilNoise<FIMPL>, MIO);
@ -73,36 +71,28 @@ MODULE_REGISTER_TMP(LoadDistilNoise, TLoadDistilNoise<FIMPL>, MIO);
******************************************************************************/ ******************************************************************************/
// constructor ///////////////////////////////////////////////////////////////// // constructor /////////////////////////////////////////////////////////////////
template <typename FImpl> template <typename FImpl>
TLoadDistilNoise<FImpl>::TLoadDistilNoise(const std::string name) TLoadDistilNoise<FImpl>::TLoadDistilNoise(const std::string name) : Module<LoadDistilNoisePar>(name) {}
: Module<LoadDistilNoisePar>(name)
{}
// dependencies/products /////////////////////////////////////////////////////// // dependencies/products ///////////////////////////////////////////////////////
template <typename FImpl> template <typename FImpl>
std::vector<std::string> TLoadDistilNoise<FImpl>::getInput(void) std::vector<std::string> TLoadDistilNoise<FImpl>::getInput(void)
{ {
DParName = par().DistilPar; return {par().NoiseFileName, par().DistilParams};
return { par().NoiseFileName, DParName };
} }
template <typename FImpl> template <typename FImpl>
std::vector<std::string> TLoadDistilNoise<FImpl>::getOutput(void) std::vector<std::string> TLoadDistilNoise<FImpl>::getOutput(void)
{ {
std::vector<std::string> out = {getName()}; return {getName()};
return out;
} }
// setup /////////////////////////////////////////////////////////////////////// // setup ///////////////////////////////////////////////////////////////////////
template <typename FImpl> template <typename FImpl>
void TLoadDistilNoise<FImpl>::setup(void) void TLoadDistilNoise<FImpl>::setup(void)
{ {
auto &DPar = envGet(MDistil::DistilParameters, DParName); const MDistil::DistilParameters &dp{envGet(MDistil::DistilParameters, par().DistilParams)};
const int Nt{env().getDim(Tdir)}; const int Nt{env().getDim(Tdir)};
const int nvec{DPar.nvec}; envCreate(MDistil::NoiseTensor, getName(), 1, dp.nnoise, Nt, dp.nvec, Ns);
const int nnoise{DPar.nnoise};
envCreate(MDistil::NoiseTensor, getName(), 1, nnoise, Nt, nvec, Ns);
} }
// execution /////////////////////////////////////////////////////////////////// // execution ///////////////////////////////////////////////////////////////////
@ -117,7 +107,5 @@ void TLoadDistilNoise<FImpl>::execute(void)
} }
END_MODULE_NAMESPACE END_MODULE_NAMESPACE
END_HADRONS_NAMESPACE END_HADRONS_NAMESPACE
#endif
#endif // Hadrons_MIO_LoadDistilNoise_hpp_

View File

@ -44,7 +44,7 @@ class LoadPerambulatorPar: Serializable
public: public:
GRID_SERIALIZABLE_CLASS_MEMBERS(LoadPerambulatorPar, GRID_SERIALIZABLE_CLASS_MEMBERS(LoadPerambulatorPar,
std::string, PerambFileName, std::string, PerambFileName,
std::string, DistilPar); std::string, DistilParams);
}; };
template <typename FImpl> template <typename FImpl>
@ -62,8 +62,6 @@ public:
virtual void setup(void); virtual void setup(void);
// execution // execution
virtual void execute(void); virtual void execute(void);
protected:
std::string DParName;
}; };
MODULE_REGISTER_TMP(LoadPerambulator, TLoadPerambulator<FIMPL>, MIO); MODULE_REGISTER_TMP(LoadPerambulator, TLoadPerambulator<FIMPL>, MIO);
@ -73,42 +71,30 @@ MODULE_REGISTER_TMP(LoadPerambulator, TLoadPerambulator<FIMPL>, MIO);
******************************************************************************/ ******************************************************************************/
// constructor ///////////////////////////////////////////////////////////////// // constructor /////////////////////////////////////////////////////////////////
template <typename FImpl> template <typename FImpl>
TLoadPerambulator<FImpl>::TLoadPerambulator(const std::string name) TLoadPerambulator<FImpl>::TLoadPerambulator(const std::string name) : Module<LoadPerambulatorPar>(name) {}
: Module<LoadPerambulatorPar>(name)
{}
// dependencies/products /////////////////////////////////////////////////////// // dependencies/products ///////////////////////////////////////////////////////
template <typename FImpl> template <typename FImpl>
std::vector<std::string> TLoadPerambulator<FImpl>::getInput(void) std::vector<std::string> TLoadPerambulator<FImpl>::getInput(void)
{ {
DParName = par().DistilPar; return {par().PerambFileName, par().DistilParams};
return { par().PerambFileName, DParName };
} }
template <typename FImpl> template <typename FImpl>
std::vector<std::string> TLoadPerambulator<FImpl>::getOutput(void) std::vector<std::string> TLoadPerambulator<FImpl>::getOutput(void)
{ {
std::vector<std::string> out = {getName()}; return {getName()};
return out;
} }
// setup /////////////////////////////////////////////////////////////////////// // setup ///////////////////////////////////////////////////////////////////////
template <typename FImpl> template <typename FImpl>
void TLoadPerambulator<FImpl>::setup(void) void TLoadPerambulator<FImpl>::setup(void)
{ {
auto &DPar = envGet(MDistil::DistilParameters, DParName); const MDistil::DistilParameters &dp{envGet(MDistil::DistilParameters, par().DistilParams)};
const int Nt{env().getDim(Tdir)}; const int Nt{env().getDim(Tdir)};
const int nvec{DPar.nvec}; const bool full_tdil{ dp.TI == Nt };
const int nnoise{DPar.nnoise}; const int Nt_inv{ full_tdil ? 1 : dp.TI };
const int tsrc{DPar.tsrc}; envCreate(MDistil::PerambTensor, getName(), 1, Nt,dp.nvec,dp.LI,dp.nnoise,Nt_inv,dp.SI);
const int TI{DPar.TI};
const int LI{DPar.LI};
const int SI{DPar.SI};
const bool full_tdil{ TI == Nt };
const bool exact_distillation{ full_tdil && LI == nvec };
const int Nt_inv{ full_tdil ? 1 : TI };
envCreate(MDistil::PerambTensor, getName(), 1, Nt,nvec,LI,nnoise,Nt_inv,SI);
} }
// execution /////////////////////////////////////////////////////////////////// // execution ///////////////////////////////////////////////////////////////////
@ -123,7 +109,5 @@ void TLoadPerambulator<FImpl>::execute(void)
} }
END_MODULE_NAMESPACE END_MODULE_NAMESPACE
END_HADRONS_NAMESPACE END_HADRONS_NAMESPACE
#endif
#endif // Hadrons_MIO_LoadPerambulator_hpp_