1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-10 07:55:35 +00:00

Merge branch 'feature/distil' of github.com:mmphys/Grid into feature/distil

This commit is contained in:
ferben 2019-01-23 15:08:24 +00:00
commit 068ef85b05
2 changed files with 72 additions and 16 deletions

View File

@ -42,23 +42,30 @@ BEGIN_HADRONS_NAMESPACE
BEGIN_MODULE_NAMESPACE(MDistil) BEGIN_MODULE_NAMESPACE(MDistil)
/****************************************************************************** /******************************************************************************
* LapEvec *
***** TEST ***** Laplacian eigenvectors - parameters
******************************************************************************/ ******************************************************************************/
struct StoutParameters: Serializable {
class LapEvecPar: Serializable GRID_SERIALIZABLE_CLASS_MEMBERS(StoutParameters,
{
public:
GRID_SERIALIZABLE_CLASS_MEMBERS(LapEvecPar,
// StoutParameters,
int, steps, int, steps,
double, parm, double, parm)
// ChebyshevParameters, StoutParameters() = default;
template <class ReaderClass> StoutParameters(Reader<ReaderClass>& Reader){read(Reader,"StoutSmearing",*this);}
};
struct ChebyshevParameters: Serializable {
GRID_SERIALIZABLE_CLASS_MEMBERS(ChebyshevParameters,
int, PolyOrder, int, PolyOrder,
double, alpha, double, alpha,
double, beta, double, beta)
// LanczosParameters, ChebyshevParameters() = default;
template <class ReaderClass> ChebyshevParameters(Reader<ReaderClass>& Reader){read(Reader,"Chebyshev",*this);}
};
struct LanczosParameters: Serializable {
GRID_SERIALIZABLE_CLASS_MEMBERS(LanczosParameters,
int, Nstart, int, Nstart,
int, Nvec, int, Nvec,
int, Nk, int, Nk,
@ -66,9 +73,51 @@ public:
int, Np, int, Np,
int, MaxIt, int, MaxIt,
int, MinRes, int, MinRes,
double, resid); double, resid)
LanczosParameters() = default;
template <class ReaderClass> LanczosParameters(Reader<ReaderClass>& Reader){read(Reader,"Lanczos",*this);}
}; };
struct DistilParameters: Serializable {
GRID_SERIALIZABLE_CLASS_MEMBERS(DistilParameters,
int, TI,
int, LI,
int, Nnoise,
int, Ls, // For makeFiveDimGrid
int, tSrc)
DistilParameters() = default;
template <class ReaderClass> DistilParameters(Reader<ReaderClass>& Reader){read(Reader,"Distil",*this);}
};
struct SolverParameters: Serializable {
GRID_SERIALIZABLE_CLASS_MEMBERS(SolverParameters,
double, CGPrecision,
int, MaxIterations,
double, mass,
double, M5)
SolverParameters() = default;
template <class ReaderClass> SolverParameters(Reader<ReaderClass>& Reader){read(Reader,"Solver",*this);}
};
// These are the actual parameters passed to the module during construction
class LapEvecPar: Serializable
{
public:
GRID_SERIALIZABLE_CLASS_MEMBERS(LapEvecPar,
StoutParameters, Stout,
ChebyshevParameters, Cheby,
LanczosParameters, Lanczos,
DistilParameters, Distil,
SolverParameters, Solver);
};
/******************************************************************************
Laplacian eigenvectors - Module (class) definition
******************************************************************************/
template <typename FImpl> template <typename FImpl>
class TLapEvec: public Module<LapEvecPar> class TLapEvec: public Module<LapEvecPar>
{ {
@ -118,14 +167,18 @@ std::vector<std::string> TLapEvec<FImpl>::getOutput(void)
template <typename FImpl> template <typename FImpl>
void TLapEvec<FImpl>::setup(void) void TLapEvec<FImpl>::setup(void)
{ {
LOG(Message) << "setup() : start" << std::endl;
LOG(Message) << "Stout.steps=" << par().Stout.steps << ", Stout.parm=" << par().Stout.parm << std::endl;
LOG(Message) << "setup() : end" << std::endl;
} }
// execution /////////////////////////////////////////////////////////////////// // execution ///////////////////////////////////////////////////////////////////
template <typename FImpl> template <typename FImpl>
void TLapEvec<FImpl>::execute(void) void TLapEvec<FImpl>::execute(void)
{ {
LOG(Message) << "execute() : start" << std::endl;
LOG(Message) << "Stout.steps=" << par().Stout.steps << ", Stout.parm=" << par().Stout.parm << std::endl;
LOG(Message) << "execute() : end" << std::endl;
} }
END_MODULE_NAMESPACE END_MODULE_NAMESPACE

View File

@ -236,7 +236,10 @@ void test_LapEvec(Application &application)
// gauge field // gauge field
application.createModule<MGauge::Unit>("gauge"); application.createModule<MGauge::Unit>("gauge");
// Now make an instance of the LapEvec object // Now make an instance of the LapEvec object
application.createModule<MDistil::LapEvec>("LapEvecInstance"); MDistil::LapEvecPar levPar;
levPar.Stout.steps = 173;
levPar.Stout.parm = -9.87654321;
application.createModule<MDistil::LapEvec>("LapEvec",levPar);
} }
///////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////