1
0
mirror of https://github.com/paboyle/Grid.git synced 2024-11-09 23:45:36 +00:00
This commit is contained in:
ferben 2019-11-13 14:52:06 +00:00
parent 667ffb70db
commit a977d9901b
3 changed files with 58 additions and 60 deletions

View File

@ -164,32 +164,33 @@ void TDistilVectors<FImpl>::execute(void)
const int Ntfirst{ grid4d->LocalStarts()[3] };
const int Nt{env().getDim(Tdir)};
const int nvec{dp.nvec};
const int nnoise{dp.nnoise};
const int tsrc{dp.tsrc};
const int TI{dp.TI};
const int LI{dp.LI};
const int SI{dp.SI};
const bool full_tdil{ TI == Nt };
const int Nt_inv{ full_tdil ? 1 : TI };
const bool full_tdil{ dp.TI == Nt };
const int Nt_inv{ full_tdil ? 1 : dp.TI };
int vecindex;
int t_inv;
if (!RhoName.empty())
{
auto &rho = envGet(std::vector<FermionField>, RhoName);
for (int inoise = 0; inoise < nnoise; inoise++) {
for (int dk = 0; dk < LI; dk++) {
for (int dt = 0; dt < Nt_inv; dt++) {
for (int ds = 0; ds < SI; ds++) {
vecindex = inoise + nnoise * dk + nnoise * LI * ds + nnoise *LI * SI*dt;
for (int inoise = 0; inoise < dp.nnoise; inoise++)
{
for (int dk = 0; dk < dp.LI; dk++)
{
for (int dt = 0; dt < Nt_inv; dt++)
{
for (int ds = 0; ds < dp.SI; ds++)
{
vecindex = inoise + dp.nnoise * dk + dp.nnoise * dp.LI * ds + dp.nnoise *dp.LI * dp.SI*dt;
rho[vecindex] = 0;
source3d_nospin = 0;
for (int it = dt; it < Nt; it += TI){
if (full_tdil) t_inv = tsrc; else t_inv = it;
if (t_inv >= Ntfirst && t_inv < Ntfirst + Ntlocal) {
for (int ik = dk; ik < nvec; ik += LI){
for (int is = ds; is < Ns; is += SI){
for (int it = dt; it < Nt; it += dp.TI)
{
const int t_inv{full_tdil ? dp.tsrc : it};
if (t_inv >= Ntfirst && t_inv < Ntfirst + Ntlocal)
{
for (int ik = dk; ik < dp.nvec; ik += dp.LI)
{
for (int is = ds; is < Ns; is += dp.SI)
{
ExtractSliceLocal(evec3d,epack.evec[ik],0,t_inv-Ntfirst,Tdir);
source3d_nospin = evec3d * noise.tensor(inoise, t_inv, ik, is);
source3d=0;
@ -206,17 +207,24 @@ void TDistilVectors<FImpl>::execute(void)
}
}
}
if (!PhiName.empty()) {
if (!PhiName.empty())
{
auto &phi = envGet(std::vector<FermionField>, PhiName);
for (int inoise = 0; inoise < nnoise; inoise++) {
for (int dk = 0; dk < LI; dk++) {
for (int dt = 0; dt < Nt_inv; dt++) {
for (int ds = 0; ds < SI; ds++) {
vecindex = inoise + nnoise * dk + nnoise * LI * ds + nnoise *LI * SI*dt;
for (int inoise = 0; inoise < dp.nnoise; inoise++)
{
for (int dk = 0; dk < dp.LI; dk++)
{
for (int dt = 0; dt < Nt_inv; dt++)
{
for (int ds = 0; ds < dp.SI; ds++)
{
vecindex = inoise + dp.nnoise * dk + dp.nnoise * dp.LI * ds + dp.nnoise *dp.LI *dp. SI*dt;
phi[vecindex] = 0;
for (int t = Ntfirst; t < Ntfirst + Ntlocal; t++) {
for (int t = Ntfirst; t < Ntfirst + Ntlocal; t++)
{
sink3d=0;
for (int ivec = 0; ivec < nvec; ivec++) {
for (int ivec = 0; ivec < dp.nvec; ivec++)
{
ExtractSliceLocal(evec3d,epack.evec[ivec],0,t-Ntfirst,Tdir);
sink3d += evec3d * perambulator.tensor(t, ivec, dk, inoise,dt,ds);
}

View File

@ -130,14 +130,8 @@ void TPerambulator<FImpl>::execute(void)
{
const DistilParameters &dp{ envGet(DistilParameters, par().DistilParams) };
const int Nt{env().getDim(Tdir)};
const int nvec{dp.nvec};
const int nnoise{dp.nnoise};
const int tsrc{dp.tsrc};
const int TI{dp.TI};
const int LI{dp.LI};
const int SI{dp.SI};
const bool full_tdil{ TI == Nt };
const int Nt_inv{ full_tdil ? 1 : TI };
const bool full_tdil{ dp.TI == Nt };
const int Nt_inv{ full_tdil ? 1 : dp.TI };
auto &solver=envGet(Solver, par().solver);
auto &mat = solver.getFMat();
@ -161,26 +155,25 @@ void TPerambulator<FImpl>::execute(void)
const int Ntfirst{grid4d->LocalStarts()[3]};
const std::string UnsmearedSinkFileName{ par().UnsmearedSinkFileName };
for (int inoise = 0; inoise < nnoise; inoise++)
for (int inoise = 0; inoise < dp.nnoise; inoise++)
{
for (int dk = 0; dk < LI; dk++)
for (int dk = 0; dk < dp.LI; dk++)
{
for (int dt = 0; dt < Nt_inv; dt++)
{
for (int ds = 0; ds < SI; ds++)
for (int ds = 0; ds < dp.SI; ds++)
{
LOG(Message) << "LapH source vector from noise " << inoise << " and dilution component (d_k,d_t,d_alpha) : (" << dk << ","<< dt << "," << ds << ")" << std::endl;
dist_source = 0;
source3d_nospin = 0;
evec3d = 0;
for (int it = dt; it < Nt; it += TI)
for (int it = dt; it < Nt; it += dp.TI)
{
const int t_inv{full_tdil ? tsrc : it};
const int t_inv{full_tdil ? dp.tsrc : it};
if( t_inv >= Ntfirst && t_inv < Ntfirst + Ntlocal )
{
for (int ik = dk; ik < nvec; ik += LI)
for (int ik = dk; ik < dp.nvec; ik += dp.LI)
{
for (int is = ds; is < Ns; is += SI)
for (int is = ds; is < Ns; is += dp.SI)
{
ExtractSliceLocal(evec3d,epack.evec[ik],0,t_inv-Ntfirst,Tdir);
source3d_nospin = evec3d * noise.tensor(inoise, t_inv, ik, is);
@ -205,14 +198,14 @@ void TPerambulator<FImpl>::execute(void)
result4d = v4dtmp;
}
if (!UnsmearedSinkFileName.empty())
unsmeared_sink[inoise+nnoise*(dk+LI*(dt+Nt_inv*ds))] = result4d;
unsmeared_sink[inoise+dp.nnoise*(dk+dp.LI*(dt+Nt_inv*ds))] = result4d;
for (int is = 0; is < Ns; is++)
{
result4d_nospin = peekSpin(result4d,is);
for (int t = Ntfirst; t < Ntfirst + Ntlocal; t++)
{
ExtractSliceLocal(result3d_nospin,result4d_nospin,0,t-Ntfirst,Tdir);
for (int ivec = 0; ivec < nvec; ivec++)
for (int ivec = 0; ivec < dp.nvec; ivec++)
{
ExtractSliceLocal(evec3d,epack.evec[ivec],0,t-Ntfirst,Tdir);
pokeSpin(perambulator.tensor(t, ivec, dk, inoise,dt,ds),static_cast<Complex>(innerProduct(evec3d, result3d_nospin)),is);

View File

@ -142,17 +142,15 @@ std::string test_Solver(Application &application, const char * pSuffix = nullptr
/////////////////////////////////////////////////////////////
std::string test_DPar(Application &application) {
// DistilVectors parameters
//MDistil::DistilParPar DistilPar;
MDistil::DistilParameters DistilPar;
DistilPar.nvec = 5;
DistilPar.nnoise = 1;
DistilPar.tsrc = 0;
DistilPar.LI = 5;
DistilPar.TI = 8;
DistilPar.SI = 4;
MDistil::DistilPar DPar;
DPar.nvec = 5;
DPar.nnoise = 1;
DPar.tsrc = 0;
DPar.LI = 5;
DPar.TI = 8;
DPar.SI = 4;
std::string sDParName{"DPar_l"};
application.createModule<MDistil::DistilPar>(sDParName,DistilPar);
application.createModule<MDistil::DistilPar>(sDParName,DPar);
return sDParName;
}
/////////////////////////////////////////////////////////////
@ -160,9 +158,8 @@ std::string test_DPar(Application &application) {
/////////////////////////////////////////////////////////////
std::string test_Noises(Application &application, const std::string &sNoiseBaseName ) {
// DistilVectors parameters
MDistil::NoisesPar NoisePar;
NoisePar.DistilPar = "DPar_l";
NoisePar.DistilParams = "DPar_l";
NoisePar.NoiseFileName = "noise";
std::string sNoiseName{"noise"};
application.createModule<MDistil::Noises>(sNoiseName,NoisePar);
@ -186,7 +183,7 @@ void test_LoadPerambulators( Application &application, const char * pszSuffix =
std::string sModuleName{ PerambulatorName( pszSuffix ) };
MIO::LoadPerambulator::Par PerambPar;
PerambPar.PerambFileName = sModuleName;
PerambPar.DistilPar = "DPar_l";
PerambPar.DistilParams = "DPar_l";
test_Noises(application, sModuleName); // I want these written after solver stuff
application.createModule<MIO::LoadPerambulator>( sModuleName, PerambPar );
}
@ -199,7 +196,7 @@ void test_Perambulators( Application &application, const char * pszSuffix = null
PerambPar.lapevec = "LapEvec";
PerambPar.PerambFileName = sModuleName;
PerambPar.solver = test_Solver( application, pszSuffix );
PerambPar.DistilPar = "DPar_l";
PerambPar.DistilParams = "DPar_l";
PerambPar.noise = "noise";
test_Noises(application, sModuleName); // I want these written after solver stuff
application.createModule<MDistil::Perambulator>( sModuleName, PerambPar );
@ -223,7 +220,7 @@ void test_DistilVectors(Application &application, const char * pszSuffix = nullp
DistilVecPar.phi = "phi";
DistilVecPar.perambulator = sPerambName;
DistilVecPar.lapevec = "LapEvec";
DistilVecPar.DistilPar = "DPar_l";
DistilVecPar.DistilParams = "DPar_l";
application.createModule<MDistil::DistilVectors>(sModuleName,DistilVecPar);
}