mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-13 04:37:05 +01:00
Post Michael / Felix review. Ready for Peter / Antonin review
This commit is contained in:
@ -163,14 +163,14 @@ void TDistilVectors<FImpl>::setup(void)
|
||||
{
|
||||
Cleanup();
|
||||
auto &noise = envGet(NoiseTensor, NoiseVectorName);
|
||||
auto &perambulator = envGet(Perambulator, PerambulatorName);
|
||||
auto &perambulator = envGet(PerambTensor, PerambulatorName);
|
||||
|
||||
// We expect the perambulator to have been created with these indices
|
||||
for(int i = 0; i < Perambulator::NumIndices; i++ )
|
||||
assert( PerambIndexNames[i] == perambulator.IndexNames[i] && "Perambulator indices bad" );
|
||||
for(int i = 0; i < PerambTensor::NumIndices; i++ )
|
||||
assert( PerambIndexNames[i] == perambulator.IndexNames[i] && "PerambTensor indices bad" );
|
||||
|
||||
const int Nt{ env().getDim(Tdir) };
|
||||
assert( Nt == static_cast<int>( perambulator.tensor.dimension(0) ) && "Perambulator time dimensionality bad" );
|
||||
assert( Nt == static_cast<int>( perambulator.tensor.dimension(0) ) && "PerambTensor time dimensionality bad" );
|
||||
const int TI{ Hadrons::MDistil::DistilParameters::ParameterDefault( par().TI, Nt, true) };
|
||||
const int LI{ static_cast<int>( perambulator.tensor.dimension(2) ) };
|
||||
const int SI{ static_cast<int>( perambulator.tensor.dimension(5) ) };
|
||||
@ -222,7 +222,7 @@ template <typename FImpl>
|
||||
void TDistilVectors<FImpl>::execute(void)
|
||||
{
|
||||
auto &noise = envGet(NoiseTensor, NoiseVectorName);
|
||||
auto &perambulator = envGet(Perambulator, PerambulatorName);
|
||||
auto &perambulator = envGet(PerambTensor, PerambulatorName);
|
||||
auto &epack = envGet(Grid::Hadrons::EigenPack<LatticeColourVector>, LapEvecName);
|
||||
|
||||
envGetTmp(LatticeSpinColourVector, tmp2);
|
||||
|
@ -205,11 +205,12 @@ void TLapEvec<GImpl>::execute(void)
|
||||
|
||||
// Stout smearing
|
||||
envGetTmp(GaugeField, Umu_smear);
|
||||
const StoutParameters &Stout{par().Stout};
|
||||
if( Stout.steps )
|
||||
{
|
||||
auto &Umu = envGet(GaugeField, sGaugeName);
|
||||
LOG(Message) << "Initial plaquette: " << WilsonLoops<PeriodicGimplR>::avgPlaquette(Umu) << std::endl;
|
||||
Umu_smear = Umu;
|
||||
const StoutParameters &Stout{par().Stout};
|
||||
envGetTmp(GaugeField, Umu_stout);
|
||||
Smear_Stout<PeriodicGimplR> LS(Stout.rho, Tdir); // spatial smearing only
|
||||
for (int i = 0; i < Stout.steps; i++) {
|
||||
|
@ -56,8 +56,8 @@ public:
|
||||
std::string, PerambFileName,
|
||||
std::string, solve,
|
||||
int, nvec,
|
||||
int, nvec_reduced,
|
||||
int, LI_reduced,
|
||||
std::string, nvec_reduced,
|
||||
std::string, LI_reduced,
|
||||
DistilParameters, Distil);
|
||||
};
|
||||
|
||||
@ -122,12 +122,12 @@ void TPerambFromSolve<FImpl>::setup(void)
|
||||
{
|
||||
Cleanup();
|
||||
DISTIL_PARAMETERS_DEFINE( true );
|
||||
const int nvec_reduced{ Hadrons::MDistil::DistilParameters::ParameterDefault( par().nvec_reduced, nvec, true) };
|
||||
const int LI_reduced{ Hadrons::MDistil::DistilParameters::ParameterDefault( par().LI_reduced, LI, true) };
|
||||
grid4d = env().getGrid();
|
||||
grid3d = MakeLowerDimGrid(grid4d);
|
||||
const int nvec_reduced{par().nvec_reduced};
|
||||
const int LI_reduced{par().LI_reduced};
|
||||
//std::array<std::string,6> sIndexNames{"Nt", "nvec", "LI", "nnoise", "Nt_inv", "SI"};
|
||||
envCreate(Perambulator, getName(), 1, PerambIndexNames,Nt,nvec_reduced,LI_reduced,nnoise,Nt_inv,SI);
|
||||
envCreate(PerambTensor, getName(), 1, PerambIndexNames,Nt,nvec_reduced,LI_reduced,nnoise,Nt_inv,SI);
|
||||
envCreate(NoiseTensor, getName() + "_noise", 1, nnoise, Nt, nvec, Ns );
|
||||
envTmp(LatticeColourVector, "result_3d",1,LatticeColourVector(grid3d));
|
||||
envTmp(LatticeColourVector, "evec3d",1,LatticeColourVector(grid3d));
|
||||
@ -151,10 +151,10 @@ void TPerambFromSolve<FImpl>::execute(void)
|
||||
GridCartesian * grid4d = env().getGrid();
|
||||
const int Ntlocal{grid4d->LocalDimensions()[3]};
|
||||
const int Ntfirst{grid4d->LocalStarts()[3]};
|
||||
const int nvec_reduced{par().nvec_reduced};
|
||||
const int LI_reduced{par().LI_reduced};
|
||||
DISTIL_PARAMETERS_DEFINE( false );
|
||||
auto &perambulator = envGet(Perambulator, getName());
|
||||
const int nvec_reduced{ Hadrons::MDistil::DistilParameters::ParameterDefault( par().nvec_reduced, nvec, false) };
|
||||
const int LI_reduced{ Hadrons::MDistil::DistilParameters::ParameterDefault( par().LI_reduced, LI, false) };
|
||||
auto &perambulator = envGet(PerambTensor, getName());
|
||||
auto &solve = envGet(std::vector<FermionField>, par().solve);
|
||||
auto &epack = envGet(Grid::Hadrons::EigenPack<LatticeColourVector>, par().eigenPack);
|
||||
|
||||
|
@ -82,8 +82,7 @@ protected:
|
||||
std::string sNoiseName;
|
||||
};
|
||||
|
||||
// Can't name the module Perambulator, because that's what we've called the object
|
||||
MODULE_REGISTER_TMP(Peramb, TPerambulator<FIMPL>, MDistil);
|
||||
MODULE_REGISTER_TMP(Perambulator, TPerambulator<FIMPL>, MDistil);
|
||||
|
||||
/******************************************************************************
|
||||
* TPerambulator implementation *
|
||||
@ -127,7 +126,7 @@ void TPerambulator<FImpl>::setup(void)
|
||||
grid3d = MakeLowerDimGrid(grid4d);
|
||||
DISTIL_PARAMETERS_DEFINE( true );
|
||||
|
||||
envCreate(Perambulator, getName(), 1, PerambIndexNames,Nt,nvec,LI,nnoise,Nt_inv,SI);
|
||||
envCreate(PerambTensor, getName(), 1, PerambIndexNames,Nt,nvec,LI,nnoise,Nt_inv,SI);
|
||||
envCreate(std::vector<FermionField>, getName() + "_unsmeared_sink", 1,
|
||||
nnoise*LI*Ns*Nt_inv, envGetGrid(FermionField));
|
||||
|
||||
@ -170,7 +169,7 @@ void TPerambulator<FImpl>::execute(void)
|
||||
envGetTmp(FermionField, v5dtmp_sol);
|
||||
|
||||
auto &noise = envGet(NoiseTensor, sNoiseName);
|
||||
auto &perambulator = envGet(Perambulator, getName());
|
||||
auto &perambulator = envGet(PerambTensor, getName());
|
||||
auto &epack = envGet(LapEvecs, sLapEvecName);
|
||||
auto &unsmeared_sink = envGet(std::vector<FermionField>, getName() + "_unsmeared_sink");
|
||||
|
||||
|
@ -103,14 +103,14 @@ void TLoadPerambulator<FImpl>::setup(void)
|
||||
{
|
||||
DISTIL_PARAMETERS_DEFINE( true );
|
||||
//std::array<std::string,6> sIndexNames{"Nt", "nvec", "LI", "nnoise", "Nt_inv", "SI"};
|
||||
envCreate(MDistil::Perambulator, getName(), 1, MDistil::PerambIndexNames,Nt,nvec,LI,nnoise,Nt_inv,SI);
|
||||
envCreate(MDistil::PerambTensor, getName(), 1, MDistil::PerambIndexNames,Nt,nvec,LI,nnoise,Nt_inv,SI);
|
||||
}
|
||||
|
||||
// execution ///////////////////////////////////////////////////////////////////
|
||||
template <typename FImpl>
|
||||
void TLoadPerambulator<FImpl>::execute(void)
|
||||
{
|
||||
auto &perambulator = envGet(MDistil::Perambulator, getName());
|
||||
auto &perambulator = envGet(MDistil::PerambTensor, getName());
|
||||
const std::string sPerambName{par().PerambFileName + "." + std::to_string(vm().getTrajectory())};
|
||||
perambulator.read(sPerambName.c_str());
|
||||
}
|
||||
|
Reference in New Issue
Block a user