mirror of
				https://github.com/paboyle/Grid.git
				synced 2025-11-03 21:44:33 +00:00 
			
		
		
		
	envCreate problem..
This commit is contained in:
		@@ -18,6 +18,7 @@ class DistilParPar: Serializable
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
    GRID_SERIALIZABLE_CLASS_MEMBERS(DistilParPar,
 | 
			
		||||
                                    int, nvec,
 | 
			
		||||
                                    int, nnoise,
 | 
			
		||||
                                    int, tsrc,
 | 
			
		||||
                                    int, TI,
 | 
			
		||||
@@ -74,7 +75,7 @@ std::vector<std::string> TDistilPar<FImpl>::getOutput(void)
 | 
			
		||||
template <typename FImpl>
 | 
			
		||||
void TDistilPar<FImpl>::setup(void)
 | 
			
		||||
{
 | 
			
		||||
    
 | 
			
		||||
 //   envCreate(Hadrons::MDistil::DistilParameters, getName(), 1); //DOES NOT WORK
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// execution ///////////////////////////////////////////////////////////////////
 | 
			
		||||
@@ -82,11 +83,12 @@ template <typename FImpl>
 | 
			
		||||
void TDistilPar<FImpl>::execute(void)
 | 
			
		||||
{
 | 
			
		||||
    Hadrons::MDistil::DistilParameters &out = envGet(Hadrons::MDistil::DistilParameters, getName());
 | 
			
		||||
  /*  out.nvec=par().nvec;
 | 
			
		||||
    out.nnoise=par().nnoise;
 | 
			
		||||
    out.tsrc=par().tsrc;
 | 
			
		||||
    out.TI=par().TI;
 | 
			
		||||
    out.LI=par().LI;
 | 
			
		||||
    out.SI=par().SI;
 | 
			
		||||
    out.SI=par().SI; */
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
END_MODULE_NAMESPACE
 | 
			
		||||
 
 | 
			
		||||
@@ -49,7 +49,7 @@ public:
 | 
			
		||||
                                    std::string, lapevec,
 | 
			
		||||
                                    std::string, rho,
 | 
			
		||||
                                    std::string, phi,
 | 
			
		||||
                                    MDistil::DistilParameters, DistilPar);
 | 
			
		||||
                                    std::string, DistilPar);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
template <typename FImpl>
 | 
			
		||||
@@ -78,6 +78,7 @@ public:
 | 
			
		||||
    std::string PerambulatorName;
 | 
			
		||||
    std::string NoiseVectorName;
 | 
			
		||||
    std::string LapEvecName;
 | 
			
		||||
    std::string DParName;
 | 
			
		||||
    bool bMakeRho;
 | 
			
		||||
    bool bMakePhi;
 | 
			
		||||
    std::string RhoName;
 | 
			
		||||
@@ -108,7 +109,8 @@ std::vector<std::string> TDistilVectors<FImpl>::getInput(void)
 | 
			
		||||
    PerambulatorName = par().perambulator;
 | 
			
		||||
    NoiseVectorName = par().noise;
 | 
			
		||||
    LapEvecName = par().lapevec;
 | 
			
		||||
    return { PerambulatorName, NoiseVectorName, LapEvecName };
 | 
			
		||||
    DParName = par().DistilPar;
 | 
			
		||||
    return { PerambulatorName, NoiseVectorName, LapEvecName, DParName };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template <typename FImpl>
 | 
			
		||||
@@ -142,16 +144,17 @@ void TDistilVectors<FImpl>::setup(void)
 | 
			
		||||
    Cleanup();
 | 
			
		||||
    auto &noise        = envGet(NoiseTensor,  NoiseVectorName);
 | 
			
		||||
    auto &perambulator = envGet(PerambTensor, PerambulatorName);
 | 
			
		||||
    auto &DPar         = envGet(MDistil::DistilParameters,  DParName);
 | 
			
		||||
    
 | 
			
		||||
    // We expect the perambulator to have been created with these indices
 | 
			
		||||
    assert( perambulator.ValidateIndexNames() && "Perambulator index names bad" );
 | 
			
		||||
    
 | 
			
		||||
    const int Nt{env().getDim(Tdir)}; 
 | 
			
		||||
    const int nvec{par().DistilPar.nvec}; 
 | 
			
		||||
    const int nnoise{par().DistilPar.nnoise}; 
 | 
			
		||||
    const int TI{par().DistilPar.TI}; 
 | 
			
		||||
    const int LI{par().DistilPar.LI}; 
 | 
			
		||||
    const int SI{par().DistilPar.SI}; 
 | 
			
		||||
    const int nvec{DPar.nvec}; 
 | 
			
		||||
    const int nnoise{DPar.nnoise}; 
 | 
			
		||||
    const int TI{DPar.TI}; 
 | 
			
		||||
    const int LI{DPar.LI}; 
 | 
			
		||||
    const int SI{DPar.SI}; 
 | 
			
		||||
    const bool full_tdil{ TI == Nt }; 
 | 
			
		||||
    const int Nt_inv{ full_tdil ? 1 : TI };
 | 
			
		||||
    
 | 
			
		||||
@@ -195,6 +198,7 @@ void TDistilVectors<FImpl>::execute(void)
 | 
			
		||||
    auto &noise        = envGet(NoiseTensor, NoiseVectorName);
 | 
			
		||||
    auto &perambulator = envGet(PerambTensor, PerambulatorName);
 | 
			
		||||
    auto &epack        = envGet(Grid::Hadrons::EigenPack<LatticeColourVector>, LapEvecName);
 | 
			
		||||
    auto &DPar         = envGet(MDistil::DistilParameters,  DParName);
 | 
			
		||||
    
 | 
			
		||||
    envGetTmp(LatticeSpinColourVector, source4d);
 | 
			
		||||
    envGetTmp(LatticeSpinColourVector, source3d);
 | 
			
		||||
@@ -206,12 +210,12 @@ void TDistilVectors<FImpl>::execute(void)
 | 
			
		||||
    const int Ntfirst{ grid4d->LocalStarts()[3] };
 | 
			
		||||
    
 | 
			
		||||
    const int Nt{env().getDim(Tdir)}; 
 | 
			
		||||
    const int nvec{par().DistilPar.nvec}; 
 | 
			
		||||
    const int nnoise{par().DistilPar.nnoise}; 
 | 
			
		||||
    const int tsrc{par().DistilPar.tsrc}; 
 | 
			
		||||
    const int TI{par().DistilPar.TI}; 
 | 
			
		||||
    const int LI{par().DistilPar.LI}; 
 | 
			
		||||
    const int SI{par().DistilPar.SI}; 
 | 
			
		||||
    const int nvec{DPar.nvec}; 
 | 
			
		||||
    const int nnoise{DPar.nnoise}; 
 | 
			
		||||
    const int tsrc{DPar.tsrc}; 
 | 
			
		||||
    const int TI{DPar.TI}; 
 | 
			
		||||
    const int LI{DPar.LI}; 
 | 
			
		||||
    const int SI{DPar.SI}; 
 | 
			
		||||
    const bool full_tdil{ TI == Nt }; 
 | 
			
		||||
    const int Nt_inv{ full_tdil ? 1 : TI };
 | 
			
		||||
    
 | 
			
		||||
 
 | 
			
		||||
@@ -43,7 +43,7 @@ class NoisesPar: Serializable
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
    GRID_SERIALIZABLE_CLASS_MEMBERS(NoisesPar,
 | 
			
		||||
                                    MDistil::DistilParameters, DistilPar,
 | 
			
		||||
                                    std::string, DistilPar,
 | 
			
		||||
                                    std::string, NoiseFileName)
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@@ -62,6 +62,8 @@ public:
 | 
			
		||||
    virtual void setup(void);
 | 
			
		||||
    // execution
 | 
			
		||||
    virtual void execute(void);
 | 
			
		||||
protected:
 | 
			
		||||
    std::string DParName;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
MODULE_REGISTER_TMP(Noises, TNoises<FIMPL>, MDistil);
 | 
			
		||||
@@ -79,7 +81,8 @@ TNoises<FImpl>::TNoises(const std::string name)
 | 
			
		||||
template <typename FImpl>
 | 
			
		||||
std::vector<std::string> TNoises<FImpl>::getInput(void)
 | 
			
		||||
{
 | 
			
		||||
    return {};
 | 
			
		||||
    DParName = par().DistilPar;
 | 
			
		||||
    return { DParName };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template <typename FImpl>
 | 
			
		||||
@@ -93,9 +96,10 @@ std::vector<std::string> TNoises<FImpl>::getOutput(void)
 | 
			
		||||
template <typename FImpl>
 | 
			
		||||
void TNoises<FImpl>::setup(void)
 | 
			
		||||
{
 | 
			
		||||
    auto &DPar         = envGet(MDistil::DistilParameters,  DParName);
 | 
			
		||||
    const int Nt{env().getDim(Tdir)}; 
 | 
			
		||||
    const int nvec{par().DistilPar.nvec}; 
 | 
			
		||||
    const int nnoise{par().DistilPar.nnoise}; 
 | 
			
		||||
    const int nvec{DPar.nvec}; 
 | 
			
		||||
    const int nnoise{DPar.nnoise}; 
 | 
			
		||||
    envCreate(NoiseTensor, getName(), 1, nnoise, Nt, nvec, Ns);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -103,11 +107,12 @@ void TNoises<FImpl>::setup(void)
 | 
			
		||||
template <typename FImpl>
 | 
			
		||||
void TNoises<FImpl>::execute(void)
 | 
			
		||||
{
 | 
			
		||||
    auto &DPar         = envGet(MDistil::DistilParameters,  DParName);
 | 
			
		||||
    const int Nt{env().getDim(Tdir)};
 | 
			
		||||
    const int nnoise{par().DistilPar.nnoise};
 | 
			
		||||
    const int nvec{par().DistilPar.nvec};
 | 
			
		||||
    const int TI{par().DistilPar.TI};
 | 
			
		||||
    const int LI{par().DistilPar.LI};
 | 
			
		||||
    const int nnoise{DPar.nnoise};
 | 
			
		||||
    const int nvec{DPar.nvec};
 | 
			
		||||
    const int TI{DPar.TI};
 | 
			
		||||
    const int LI{DPar.LI};
 | 
			
		||||
    const bool full_tdil{ TI == Nt }; 
 | 
			
		||||
    const bool exact_distillation{ full_tdil && LI == nvec }; 
 | 
			
		||||
    
 | 
			
		||||
 
 | 
			
		||||
@@ -53,7 +53,7 @@ public:
 | 
			
		||||
                                    std::string, solve,
 | 
			
		||||
                                    std::string, nvec_reduced,
 | 
			
		||||
                                    std::string, LI_reduced,
 | 
			
		||||
                                    MDistil::DistilParameters, DistilPar);
 | 
			
		||||
                                    std::string, DistilPar);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
template <typename FImpl>
 | 
			
		||||
@@ -75,6 +75,8 @@ public:
 | 
			
		||||
protected:
 | 
			
		||||
    GridCartesian * grid3d; // Owned by me, so I must delete it
 | 
			
		||||
    GridCartesian * grid4d;
 | 
			
		||||
    //other members
 | 
			
		||||
    std::string DParName;
 | 
			
		||||
protected:
 | 
			
		||||
    virtual void Cleanup(void);
 | 
			
		||||
    
 | 
			
		||||
@@ -101,7 +103,9 @@ TPerambFromSolve<FImpl>::~TPerambFromSolve(void)
 | 
			
		||||
template <typename FImpl>
 | 
			
		||||
std::vector<std::string> TPerambFromSolve<FImpl>::getInput(void)
 | 
			
		||||
{
 | 
			
		||||
    return std::vector<std::string>{ par().solve, par().eigenPack };
 | 
			
		||||
    //return std::vector<std::string>{ par().solve, par().eigenPack };
 | 
			
		||||
    DParName = par().DistilPar;
 | 
			
		||||
    return {par().solve, par().eigenPack, DParName };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template <typename FImpl>
 | 
			
		||||
@@ -115,12 +119,13 @@ template <typename FImpl>
 | 
			
		||||
void TPerambFromSolve<FImpl>::setup(void)
 | 
			
		||||
{
 | 
			
		||||
    Cleanup();
 | 
			
		||||
    auto &DPar         = envGet(MDistil::DistilParameters,  DParName);
 | 
			
		||||
    const int Nt{env().getDim(Tdir)}; 
 | 
			
		||||
    const int nvec{par().DistilPar.nvec}; 
 | 
			
		||||
    const int nnoise{par().DistilPar.nnoise}; 
 | 
			
		||||
    const int LI{par().DistilPar.LI}; 
 | 
			
		||||
    const int TI{par().DistilPar.TI}; 
 | 
			
		||||
    const int SI{par().DistilPar.SI}; 
 | 
			
		||||
    const int nvec{DPar.nvec}; 
 | 
			
		||||
    const int nnoise{DPar.nnoise}; 
 | 
			
		||||
    const int LI{DPar.LI}; 
 | 
			
		||||
    const int TI{DPar.TI}; 
 | 
			
		||||
    const int SI{DPar.SI}; 
 | 
			
		||||
    const bool full_tdil{ TI == Nt }; 
 | 
			
		||||
    const int Nt_inv{ full_tdil ? 1 : TI };
 | 
			
		||||
    const int nvec_reduced{ par().nvec_reduced.empty() ? nvec:std::stoi(par().nvec_reduced)};
 | 
			
		||||
@@ -152,12 +157,13 @@ void TPerambFromSolve<FImpl>::execute(void)
 | 
			
		||||
    GridCartesian * grid4d = env().getGrid();
 | 
			
		||||
    const int Ntlocal{grid4d->LocalDimensions()[3]};
 | 
			
		||||
    const int Ntfirst{grid4d->LocalStarts()[3]};
 | 
			
		||||
    auto &DPar         = envGet(MDistil::DistilParameters,  DParName);
 | 
			
		||||
    const int Nt{env().getDim(Tdir)}; 
 | 
			
		||||
    const int nvec{par().DistilPar.nvec}; 
 | 
			
		||||
    const int nnoise{par().DistilPar.nnoise}; 
 | 
			
		||||
    const int TI{par().DistilPar.TI}; 
 | 
			
		||||
    const int LI{par().DistilPar.LI}; 
 | 
			
		||||
    const int SI{par().DistilPar.SI}; 
 | 
			
		||||
    const int nvec{DPar.nvec}; 
 | 
			
		||||
    const int nnoise{DPar.nnoise}; 
 | 
			
		||||
    const int TI{DPar.TI}; 
 | 
			
		||||
    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 int nvec_reduced{ par().nvec_reduced.empty() ? nvec:std::stoi(par().nvec_reduced)};
 | 
			
		||||
 
 | 
			
		||||
@@ -49,7 +49,7 @@ public:
 | 
			
		||||
                                    std::string, PerambFileName,
 | 
			
		||||
                                    std::string, UnsmearedSinkFileName,
 | 
			
		||||
                                    std::string, UnsmearedSinkMultiFile,
 | 
			
		||||
                                    MDistil::DistilParameters, DistilPar);
 | 
			
		||||
                                    std::string, DistilPar);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
template <typename FImpl>
 | 
			
		||||
@@ -79,6 +79,7 @@ protected:
 | 
			
		||||
    unsigned int Ls_;
 | 
			
		||||
    std::string sLapEvecName;
 | 
			
		||||
    std::string sNoiseName;
 | 
			
		||||
    std::string DParName;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
MODULE_REGISTER_TMP(Perambulator, TPerambulator<FIMPL>, MDistil);
 | 
			
		||||
@@ -105,7 +106,8 @@ std::vector<std::string> TPerambulator<FImpl>::getInput(void)
 | 
			
		||||
{
 | 
			
		||||
    sLapEvecName = par().lapevec;
 | 
			
		||||
    sNoiseName = par().noise;
 | 
			
		||||
    return {sLapEvecName, par().solver, sNoiseName };
 | 
			
		||||
    DParName = par().DistilPar;
 | 
			
		||||
    return {sLapEvecName, par().solver, sNoiseName, DParName };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
template <typename FImpl>
 | 
			
		||||
@@ -121,13 +123,14 @@ void TPerambulator<FImpl>::setup(void)
 | 
			
		||||
    Cleanup();
 | 
			
		||||
    grid4d = env().getGrid();
 | 
			
		||||
    grid3d = MakeLowerDimGrid(grid4d);
 | 
			
		||||
    auto &DPar         = envGet(MDistil::DistilParameters,  DParName);
 | 
			
		||||
    const int Nt{env().getDim(Tdir)}; 
 | 
			
		||||
    const int nvec{par().DistilPar.nvec}; 
 | 
			
		||||
    const int nnoise{par().DistilPar.nnoise}; 
 | 
			
		||||
    const int tsrc{par().DistilPar.tsrc}; 
 | 
			
		||||
    const int TI{par().DistilPar.TI}; 
 | 
			
		||||
    const int LI{par().DistilPar.LI}; 
 | 
			
		||||
    const int SI{par().DistilPar.SI}; 
 | 
			
		||||
    const int nvec{DPar.nvec}; 
 | 
			
		||||
    const int nnoise{DPar.nnoise}; 
 | 
			
		||||
    const int tsrc{DPar.tsrc}; 
 | 
			
		||||
    const int TI{DPar.TI}; 
 | 
			
		||||
    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 };
 | 
			
		||||
@@ -170,13 +173,14 @@ void TPerambulator<FImpl>::Cleanup(void)
 | 
			
		||||
template <typename FImpl>
 | 
			
		||||
void TPerambulator<FImpl>::execute(void)
 | 
			
		||||
{
 | 
			
		||||
    auto &DPar         = envGet(MDistil::DistilParameters,  DParName);
 | 
			
		||||
    const int Nt{env().getDim(Tdir)}; 
 | 
			
		||||
    const int nvec{par().DistilPar.nvec}; 
 | 
			
		||||
    const int nnoise{par().DistilPar.nnoise}; 
 | 
			
		||||
    const int tsrc{par().DistilPar.tsrc}; 
 | 
			
		||||
    const int TI{par().DistilPar.TI}; 
 | 
			
		||||
    const int LI{par().DistilPar.LI}; 
 | 
			
		||||
    const int SI{par().DistilPar.SI}; 
 | 
			
		||||
    const int nvec{DPar.nvec}; 
 | 
			
		||||
    const int nnoise{DPar.nnoise}; 
 | 
			
		||||
    const int tsrc{DPar.tsrc}; 
 | 
			
		||||
    const int TI{DPar.TI}; 
 | 
			
		||||
    const int LI{DPar.LI}; 
 | 
			
		||||
    const int SI{DPar.SI}; 
 | 
			
		||||
    const bool full_tdil{ TI == Nt }; 
 | 
			
		||||
    const int Nt_inv{ full_tdil ? 1 : TI };
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user