1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-09 23:45:36 +00:00

new idea to get multiple perambulators

This commit is contained in:
Felix Erben 2019-03-15 10:28:02 +00:00
parent 50ca3101de
commit d1fe4dce33
2 changed files with 30 additions and 27 deletions

View File

@ -42,6 +42,8 @@ public:
std::string, PerambFileName,
std::string, solve,
int, nvec,
int, nvec_reduced,
int, LI_reduced,
DistilParameters, Distil);
};
@ -125,8 +127,12 @@ void TPerambFromSolve<FImpl>::setup(void)
grid3d = MakeLowerDimGrid(grid4d);
const int nvec_reduced{par().nvec_reduced};
const int LI_reduced{par().LI_reduced};
//envCreate(Perambulator<SpinVector COMMA 6 COMMA sizeof(Real)>, getName(), 1,
// sIndexNames,Distil.Nt,nvec,Distil.LI,Distil.nnoise,Distil.Nt_inv,Distil.SI);
envCreate(Perambulator<SpinVector COMMA 6 COMMA sizeof(Real)>, getName(), 1,
sIndexNames,Distil.Nt,nvec,Distil.LI,Distil.nnoise,Distil.Nt_inv,Distil.SI);
sIndexNames,Distil.Nt,nvec_reduced,LI_reduced,Distil.nnoise,Distil.Nt_inv,Distil.SI);
envCreate(std::vector<Complex>, getName() + "_noise", 1,
nvec*Distil.Ns*Distil.Nt*Distil.nnoise);
@ -152,6 +158,8 @@ void TPerambFromSolve<FImpl>::Cleanup(void)
template <typename FImpl>
void TPerambFromSolve<FImpl>::execute(void)
{
const int nvec_reduced{par().nvec_reduced};
const int LI_reduced{par().LI_reduced};
const int nvec{par().nvec};
const DistilParameters & Distil{par().Distil};
const int LI{Distil.LI};
@ -181,14 +189,14 @@ void TPerambFromSolve<FImpl>::execute(void)
for (int inoise = 0; inoise < nnoise; inoise++) {
for (int dk = 0; dk < LI; dk++) {
for (int dk = 0; dk < LI_reduced; dk++) {
for (int dt = 0; dt < Nt_inv; dt++) {
for (int ds = 0; ds < Ns; ds++) {
for (int is = 0; is < Ns; is++) {
result_nospin = peekSpin(solve[inoise+nnoise*(dk+LI*(dt+Nt_inv*ds))],is);
for (int t = Ntfirst; t < Ntfirst + Ntlocal; t++) {
ExtractSliceLocal(result_3d,result_nospin,0,t-Ntfirst,Grid::QCD::Tdir);
for (int ivec = 0; ivec < nvec; ivec++) {
for (int ivec = 0; ivec < nvec_reduced; ivec++) {
ExtractSliceLocal(evec3d,epack.evec[ivec],0,t,3);
pokeSpin(perambulator(t, ivec, dk, inoise,dt,ds),innerProduct(evec3d, result_3d),is);
std::cout << "perambulator(t, ivec, dk, inoise,dt,ds)(is) = (" << t << "," << ivec << "," << dk << "," << inoise << "," << dt << "," << ds << ")(" << is << ") = " << perambulator(t, ivec, dk, inoise,dt,ds)()(is)() << std::endl;

View File

@ -141,48 +141,43 @@ void test_Perambulators(Application &application)
void test_MultiPerambulators(Application &application)
{
// PerambLight parameters
MDistil::PerambMultipleSolves::Par PerambPar;
MDistil::PerambLight::Par PerambPar;
PerambPar.eigenPack="LapEvec";
PerambPar.UniqueIdentifier="full_dilution";
PerambPar.PerambFileName="Peramb5";
PerambPar.solver="CG_s";
PerambPar.Distil.tsrc = 0;
PerambPar.Distil.nnoise = 1;
PerambPar.Distil.LI=10;
PerambPar.Distil.LI=5;
PerambPar.Distil.SI=4;
PerambPar.Distil.TI=8;
PerambPar.nvec=5;
PerambPar.nsolves=3;
PerambPar.nvecs={2,3,5};
PerambPar.Distil.Ns=4;
PerambPar.Distil.Nt=8;
PerambPar.Distil.Nt_inv=1;
application.createModule<MDistil::PerambMultipleSolves>("PerambMulti",PerambPar);
application.createModule<MDistil::PerambLight>("Peramb5",PerambPar);
MDistil::PerambFromSolve::Par SolvePar;
SolvePar.eigenPack="LapEvec";
SolvePar.PerambFileName="PerMulti2";
SolvePar.solve = "PerambMulti_solve_2";
SolvePar.PerambFileName="Peramb2";
SolvePar.solve = "Peramb5_unsmeared_sink";
SolvePar.Distil.nnoise = 1;
SolvePar.Distil.LI=2;
SolvePar.Distil.LI=5;
SolvePar.Distil.SI=4;
SolvePar.Distil.TI=8;
SolvePar.nvec=2;
SolvePar.nvec=5;
SolvePar.nvec_reduced=2;
SolvePar.LI_reduced=2;
SolvePar.Distil.Ns=4;
SolvePar.Distil.Nt=8;
SolvePar.Distil.Nt_inv=1;
application.createModule<MDistil::PerambFromSolve>("PerambMulti2",SolvePar);
SolvePar.PerambFileName="PerMulti3";
SolvePar.solve = "PerambMulti_solve_3";
SolvePar.Distil.LI=3;
SolvePar.nvec=3;
application.createModule<MDistil::PerambFromSolve>("PerambMulti3",SolvePar);
SolvePar.PerambFileName="PerMulti5";
SolvePar.solve = "PerambMulti_solve_5";
SolvePar.Distil.LI=5;
SolvePar.nvec=5;
application.createModule<MDistil::PerambFromSolve>("PerambMulti5",SolvePar);
application.createModule<MDistil::PerambFromSolve>("Peramb2",SolvePar);
SolvePar.PerambFileName="Peramb3";
SolvePar.nvec_reduced=3;
SolvePar.LI_reduced=3;
application.createModule<MDistil::PerambFromSolve>("Peramb3",SolvePar);
MDistil::DistilVectors::Par DistilVecPar;
DistilVecPar.noise="PerambMulti_noise";
DistilVecPar.perambulator="PerambMulti2";
DistilVecPar.noise="Peramb5_noise";
DistilVecPar.perambulator="Peramb2";
DistilVecPar.eigenPack="LapEvec";
DistilVecPar.tsrc = 0;
DistilVecPar.nnoise = 1;
@ -194,11 +189,11 @@ void test_MultiPerambulators(Application &application)
DistilVecPar.Nt=8;
DistilVecPar.Nt_inv=1;
application.createModule<MDistil::DistilVectors>("DistilVecs2",DistilVecPar);
DistilVecPar.perambulator="PerambMulti3";
DistilVecPar.perambulator="Peramb3";
DistilVecPar.LI=3;
DistilVecPar.nvec=3;
application.createModule<MDistil::DistilVectors>("DistilVecs3",DistilVecPar);
DistilVecPar.perambulator="PerambMulti5";
DistilVecPar.perambulator="Peramb5_perambulator_light";
DistilVecPar.LI=5;
DistilVecPar.nvec=5;
application.createModule<MDistil::DistilVectors>("DistilVecs5",DistilVecPar);