mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
New parameter module compiles. Untested.
This commit is contained in:
parent
db952993fa
commit
62dd0bfe58
@ -69,6 +69,8 @@ struct DistilParameters: Serializable {
|
|||||||
int, TI,
|
int, TI,
|
||||||
int, LI,
|
int, LI,
|
||||||
int, SI )
|
int, SI )
|
||||||
|
DistilParameters() = default;
|
||||||
|
DistilParameters( const DistilParameters &p ) = default; // member-wise copy
|
||||||
};
|
};
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
|
@ -13,21 +13,8 @@ BEGIN_HADRONS_NAMESPACE
|
|||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
BEGIN_MODULE_NAMESPACE(MDistil)
|
BEGIN_MODULE_NAMESPACE(MDistil)
|
||||||
|
|
||||||
|
|
||||||
class DistilParPar: Serializable
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
GRID_SERIALIZABLE_CLASS_MEMBERS(DistilParPar,
|
|
||||||
int, nvec,
|
|
||||||
int, nnoise,
|
|
||||||
int, tsrc,
|
|
||||||
int, TI,
|
|
||||||
int, LI,
|
|
||||||
int, SI );
|
|
||||||
};
|
|
||||||
|
|
||||||
template <typename FImpl>
|
template <typename FImpl>
|
||||||
class TDistilPar: public Module<DistilParPar>
|
class TDistilPar: public Module<DistilParameters>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// constructor
|
// constructor
|
||||||
@ -51,44 +38,34 @@ MODULE_REGISTER_TMP(DistilPar, TDistilPar<FIMPL>, MDistil);
|
|||||||
// constructor /////////////////////////////////////////////////////////////////
|
// constructor /////////////////////////////////////////////////////////////////
|
||||||
template <typename FImpl>
|
template <typename FImpl>
|
||||||
TDistilPar<FImpl>::TDistilPar(const std::string name)
|
TDistilPar<FImpl>::TDistilPar(const std::string name)
|
||||||
: Module<DistilParPar>(name)
|
: Module<DistilParameters>(name)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
// dependencies/products ///////////////////////////////////////////////////////
|
// dependencies/products ///////////////////////////////////////////////////////
|
||||||
template <typename FImpl>
|
template <typename FImpl>
|
||||||
std::vector<std::string> TDistilPar<FImpl>::getInput(void)
|
std::vector<std::string> TDistilPar<FImpl>::getInput(void)
|
||||||
{
|
{
|
||||||
std::vector<std::string> in;
|
return {};
|
||||||
|
|
||||||
return in;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename FImpl>
|
template <typename FImpl>
|
||||||
std::vector<std::string> TDistilPar<FImpl>::getOutput(void)
|
std::vector<std::string> TDistilPar<FImpl>::getOutput(void)
|
||||||
{
|
{
|
||||||
std::vector<std::string> out = {getName()};
|
return {getName()};
|
||||||
|
|
||||||
return out;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// setup ///////////////////////////////////////////////////////////////////////
|
// setup ///////////////////////////////////////////////////////////////////////
|
||||||
template <typename FImpl>
|
template <typename FImpl>
|
||||||
void TDistilPar<FImpl>::setup(void)
|
void TDistilPar<FImpl>::setup(void)
|
||||||
{
|
{
|
||||||
// envCreate(Hadrons::MDistil::DistilParameters, getName(), 1); //DOES NOT WORK
|
envCreate(DistilParameters, getName(), 1, par() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// execution ///////////////////////////////////////////////////////////////////
|
// execution ///////////////////////////////////////////////////////////////////
|
||||||
template <typename FImpl>
|
template <typename FImpl>
|
||||||
void TDistilPar<FImpl>::execute(void)
|
void TDistilPar<FImpl>::execute(void)
|
||||||
{
|
{
|
||||||
Hadrons::MDistil::DistilParameters &out = envGet(Hadrons::MDistil::DistilParameters, getName());
|
// Nothing to do. setup() created and initialised the output object
|
||||||
/* out.nvec=par().nvec;
|
|
||||||
out.nnoise=par().nnoise;
|
|
||||||
out.tsrc=par().tsrc;
|
|
||||||
out.TI=par().TI;
|
|
||||||
out.LI=par().LI;
|
|
||||||
out.SI=par().SI; */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
END_MODULE_NAMESPACE
|
END_MODULE_NAMESPACE
|
||||||
|
@ -48,7 +48,6 @@ public:
|
|||||||
std::string, noise,
|
std::string, noise,
|
||||||
std::string, PerambFileName,
|
std::string, PerambFileName,
|
||||||
std::string, UnsmearedSinkFileName,
|
std::string, UnsmearedSinkFileName,
|
||||||
std::string, UnsmearedSinkMultiFile,
|
|
||||||
std::string, DistilPar);
|
std::string, DistilPar);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -77,9 +76,6 @@ protected:
|
|||||||
GridCartesian * grid4d; // Owned by environment (so I won't delete it)
|
GridCartesian * grid4d; // Owned by environment (so I won't delete it)
|
||||||
// Other members
|
// Other members
|
||||||
unsigned int Ls_;
|
unsigned int Ls_;
|
||||||
std::string sLapEvecName;
|
|
||||||
std::string sNoiseName;
|
|
||||||
std::string DParName;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
MODULE_REGISTER_TMP(Perambulator, TPerambulator<FIMPL>, MDistil);
|
MODULE_REGISTER_TMP(Perambulator, TPerambulator<FIMPL>, MDistil);
|
||||||
@ -104,10 +100,7 @@ TPerambulator<FImpl>::~TPerambulator(void)
|
|||||||
template <typename FImpl>
|
template <typename FImpl>
|
||||||
std::vector<std::string> TPerambulator<FImpl>::getInput(void)
|
std::vector<std::string> TPerambulator<FImpl>::getInput(void)
|
||||||
{
|
{
|
||||||
sLapEvecName = par().lapevec;
|
return {par().lapevec, par().solver, par().noise, par().DistilPar};
|
||||||
sNoiseName = par().noise;
|
|
||||||
DParName = par().DistilPar;
|
|
||||||
return {sLapEvecName, par().solver, sNoiseName, DParName };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename FImpl>
|
template <typename FImpl>
|
||||||
@ -123,24 +116,14 @@ void TPerambulator<FImpl>::setup(void)
|
|||||||
Cleanup();
|
Cleanup();
|
||||||
grid4d = env().getGrid();
|
grid4d = env().getGrid();
|
||||||
grid3d = MakeLowerDimGrid(grid4d);
|
grid3d = MakeLowerDimGrid(grid4d);
|
||||||
auto &DPar = envGet(MDistil::DistilParameters, DParName);
|
const DistilParameters &dp = envGet(DistilParameters, par().DistilPar);
|
||||||
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};
|
|
||||||
const int TI{DPar.TI};
|
envCreate(PerambTensor, getName(), 1, Nt, dp.nvec, dp.LI, dp.nnoise, Nt_inv, dp.SI);
|
||||||
const int LI{DPar.LI};
|
|
||||||
const int SI{DPar.SI};
|
|
||||||
const bool full_tdil{ TI == Nt };
|
|
||||||
const int Nt_inv{ full_tdil ? 1 : TI };
|
|
||||||
const std::string UnsmearedSinkFileName{ par().UnsmearedSinkFileName };
|
|
||||||
if (!UnsmearedSinkFileName.empty())
|
|
||||||
//bool bMulti = ( Hadrons::MDistil::DistilParameters::ParameterDefault( par().UnsmearedSinkMultiFile, 1, true ) != 0 );
|
|
||||||
bool bMulti = 0;
|
|
||||||
|
|
||||||
envCreate(PerambTensor, getName(), 1, Nt,nvec,LI,nnoise,Nt_inv,SI);
|
|
||||||
envCreate(std::vector<FermionField>, getName() + "_unsmeared_sink", 1,
|
envCreate(std::vector<FermionField>, getName() + "_unsmeared_sink", 1,
|
||||||
nnoise*LI*Ns*Nt_inv, envGetGrid(FermionField));
|
dp.nnoise*dp.LI*Ns*Nt_inv, envGetGrid(FermionField));
|
||||||
|
|
||||||
envTmpLat(LatticeSpinColourVector, "dist_source");
|
envTmpLat(LatticeSpinColourVector, "dist_source");
|
||||||
envTmpLat(LatticeSpinColourVector, "source4d");
|
envTmpLat(LatticeSpinColourVector, "source4d");
|
||||||
@ -173,8 +156,8 @@ void TPerambulator<FImpl>::Cleanup(void)
|
|||||||
template <typename FImpl>
|
template <typename FImpl>
|
||||||
void TPerambulator<FImpl>::execute(void)
|
void TPerambulator<FImpl>::execute(void)
|
||||||
{
|
{
|
||||||
auto &DPar = envGet(MDistil::DistilParameters, DParName);
|
const DistilParameters &DPar{ envGet(DistilParameters, par().DistilPar) };
|
||||||
const int Nt{env().getDim(Tdir)};
|
const int Nt{env().getDim(Tdir)};
|
||||||
const int nvec{DPar.nvec};
|
const int nvec{DPar.nvec};
|
||||||
const int nnoise{DPar.nnoise};
|
const int nnoise{DPar.nnoise};
|
||||||
const int tsrc{DPar.tsrc};
|
const int tsrc{DPar.tsrc};
|
||||||
@ -189,9 +172,9 @@ void TPerambulator<FImpl>::execute(void)
|
|||||||
envGetTmp(FermionField, v4dtmp);
|
envGetTmp(FermionField, v4dtmp);
|
||||||
envGetTmp(FermionField, v5dtmp);
|
envGetTmp(FermionField, v5dtmp);
|
||||||
envGetTmp(FermionField, v5dtmp_sol);
|
envGetTmp(FermionField, v5dtmp_sol);
|
||||||
auto &noise = envGet(NoiseTensor, sNoiseName);
|
auto &noise = envGet(NoiseTensor, par().noise);
|
||||||
auto &perambulator = envGet(PerambTensor, getName());
|
auto &perambulator = envGet(PerambTensor, getName());
|
||||||
auto &epack = envGet(LapEvecs, sLapEvecName);
|
auto &epack = envGet(LapEvecs, par().lapevec);
|
||||||
auto &unsmeared_sink = envGet(std::vector<FermionField>, getName() + "_unsmeared_sink");
|
auto &unsmeared_sink = envGet(std::vector<FermionField>, getName() + "_unsmeared_sink");
|
||||||
envGetTmp(LatticeSpinColourVector, dist_source);
|
envGetTmp(LatticeSpinColourVector, dist_source);
|
||||||
envGetTmp(LatticeSpinColourVector, source4d);
|
envGetTmp(LatticeSpinColourVector, source4d);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user