mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
DistilVectors complete and compiling - not tested at all!
This commit is contained in:
parent
79d533550d
commit
b1c27a141d
@ -10,7 +10,7 @@
|
|||||||
#include <Hadrons/DilutedNoise.hpp>
|
#include <Hadrons/DilutedNoise.hpp>
|
||||||
|
|
||||||
BEGIN_HADRONS_NAMESPACE
|
BEGIN_HADRONS_NAMESPACE
|
||||||
/*
|
|
||||||
template<typename LatticeObj>
|
template<typename LatticeObj>
|
||||||
class Perambulator : Serializable{
|
class Perambulator : Serializable{
|
||||||
// TODO: The next line makes friends across all combinations
|
// TODO: The next line makes friends across all combinations
|
||||||
@ -93,7 +93,7 @@ public:
|
|||||||
return operator()(i, MyIndex);
|
return operator()(i, MyIndex);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
*/
|
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Class to generate Distillation $\varrho$ and $\varphi$ vectors *
|
* Class to generate Distillation $\varrho$ and $\varphi$ vectors *
|
||||||
@ -332,16 +332,25 @@ void TDistilVectors<FImpl>::setup(void)
|
|||||||
envCreate(std::vector<FermionField>, getName() + "_phi", 1,
|
envCreate(std::vector<FermionField>, getName() + "_phi", 1,
|
||||||
noise.size(), envGetGrid(FermionField));
|
noise.size(), envGetGrid(FermionField));
|
||||||
|
|
||||||
|
|
||||||
envTmp(LatticeSpinColourVector, "tmp2",1,LatticeSpinColourVector(env().getGrid()));
|
GridCartesian * grid4d = env().getGrid();
|
||||||
envTmp(LatticeColourVector, "tmp_nospin",1,LatticeColourVector(env().getGrid()));
|
std::vector<int> latt_size = GridDefaultLatt();
|
||||||
//GridCartesian * const grid3d;
|
std::vector<int> simd_layout = GridDefaultSimd(Nd, vComplex::Nsimd());
|
||||||
//ExtractSlice(grid3d,env().getGrid(),0,3);
|
std::vector<int> mpi_layout = GridDefaultMpi();
|
||||||
//envTmp(LatticeSpinColourVector, "tmp3d",1,LatticeSpinColourVector(grid3d));
|
std::vector<int> simd_layout_3 = GridDefaultSimd(Nd-1, vComplex::Nsimd());
|
||||||
/*LatticeSpinColourVector tmp3d(grid3d);
|
latt_size[Nd-1] = 1;
|
||||||
LatticeColourVector tmp3d_nospin(grid3d);
|
simd_layout_3.push_back( 1 );
|
||||||
LatticeColourVector evec3d(grid3d);
|
mpi_layout[Nd-1] = 1;
|
||||||
*/
|
GridCartesian * grid3d = new GridCartesian(latt_size,simd_layout_3,mpi_layout,*grid4d);
|
||||||
|
|
||||||
|
|
||||||
|
envTmp(LatticeSpinColourVector, "tmp2",1,LatticeSpinColourVector(grid4d));
|
||||||
|
envTmp(LatticeColourVector, "tmp_nospin",1,LatticeColourVector(grid4d));
|
||||||
|
envTmp(LatticeSpinColourVector, "tmp3d",1,LatticeSpinColourVector(grid3d));
|
||||||
|
envTmp(LatticeColourVector, "tmp3d_nospin",1,LatticeColourVector(grid3d));
|
||||||
|
envTmp(LatticeSpinColourVector, "sink_tslice",1,LatticeSpinColourVector(grid3d));
|
||||||
|
envTmp(LatticeSpinColourVector, "sink4d",1,LatticeSpinColourVector(grid4d));
|
||||||
|
envTmp(LatticeColourVector, "evec3d",1,LatticeColourVector(grid3d));
|
||||||
}
|
}
|
||||||
|
|
||||||
// execution ///////////////////////////////////////////////////////////////////
|
// execution ///////////////////////////////////////////////////////////////////
|
||||||
@ -350,19 +359,25 @@ void TDistilVectors<FImpl>::execute(void)
|
|||||||
{
|
{
|
||||||
|
|
||||||
auto &noise = envGet(std::vector<std::vector<std::vector<SpinVector>>>, par().noise);
|
auto &noise = envGet(std::vector<std::vector<std::vector<SpinVector>>>, par().noise);
|
||||||
auto &perambulator = envGet(std::vector<SpinVector>, par().perambulator);
|
//auto &perambulator = envGet(std::vector<SpinVector>, par().perambulator);
|
||||||
//auto &perambulator = envGet(Perambulator<SpinVector>, par().noise);
|
auto &perambulator = envGet(Perambulator<SpinVector>, par().noise);
|
||||||
auto &epack = envGet(Grid::Hadrons::EigenPack<LatticeColourVector>, par().eigenPack);
|
auto &epack = envGet(Grid::Hadrons::EigenPack<LatticeColourVector>, par().eigenPack);
|
||||||
auto &rho = envGet(std::vector<FermionField>, getName() + "_rho");
|
auto &rho = envGet(std::vector<FermionField>, getName() + "_rho");
|
||||||
auto &phi = envGet(std::vector<FermionField>, getName() + "_phi");
|
auto &phi = envGet(std::vector<FermionField>, getName() + "_phi");
|
||||||
|
|
||||||
|
|
||||||
envGetTmp(LatticeSpinColourVector, tmp2);
|
envGetTmp(LatticeSpinColourVector, tmp2);
|
||||||
/*LatticeSpinColourVector tmp2(grid4d);
|
envGetTmp(LatticeColourVector, tmp_nospin);
|
||||||
LatticeSpinColourVector tmp3d(grid3d);
|
envGetTmp(LatticeSpinColourVector, tmp3d);
|
||||||
LatticeColourVector tmp3d_nospin(grid3d);
|
envGetTmp(LatticeColourVector, tmp3d_nospin);
|
||||||
LatticeColourVector tmp_nospin(grid4d);
|
envGetTmp(LatticeSpinColourVector, sink_tslice);
|
||||||
LatticeColourVector evec3d(grid3d);*/
|
envGetTmp(LatticeSpinColourVector, sink4d);
|
||||||
|
envGetTmp(LatticeColourVector, evec3d);
|
||||||
|
|
||||||
|
GridCartesian * grid4d = env().getGrid();
|
||||||
|
|
||||||
|
int Ntlocal = grid4d->LocalDimensions()[3];
|
||||||
|
int Ntfirst = grid4d->LocalStarts()[3];
|
||||||
|
|
||||||
int tsrc=0;
|
int tsrc=0;
|
||||||
int nnoise=1;
|
int nnoise=1;
|
||||||
@ -370,28 +385,31 @@ void TDistilVectors<FImpl>::execute(void)
|
|||||||
int Ns=4;
|
int Ns=4;
|
||||||
int Nt_inv=1;
|
int Nt_inv=1;
|
||||||
int Nt=64;
|
int Nt=64;
|
||||||
|
int TI=64;
|
||||||
int nvec=6;
|
int nvec=6;
|
||||||
bool full_tdil=true;
|
bool full_tdil=true;
|
||||||
|
|
||||||
int vecindex;
|
int vecindex;
|
||||||
/* for (int inoise = 0; inoise < nnoise; inoise++) {
|
for (int inoise = 0; inoise < nnoise; inoise++) {
|
||||||
for (int dk = 0; dk < LI; dk++) {
|
for (int dk = 0; dk < LI; dk++) {
|
||||||
for (int dt = 0; dt < Nt_inv; dt++) {
|
for (int dt = 0; dt < Nt_inv; dt++) {
|
||||||
if(full_tdil) dt=tsrc; //TODO: this works for now, as longs as tsrc=0, but will crash otherwise!
|
if(full_tdil) dt=tsrc; //TODO: this works for now, as longs as tsrc=0, but will crash otherwise!
|
||||||
for (int ds = 0; ds < Ns; ds++) {
|
for (int ds = 0; ds < Ns; ds++) {
|
||||||
vecindex = inoise + nnoise * dk + nnoise * LI * ds + nnoise *LI * Ns*dt;
|
vecindex = inoise + nnoise * dk + nnoise * LI * ds + nnoise *LI * Ns*dt;
|
||||||
sources_tsrc[vecindex] = zero;
|
rho[vecindex] = zero;
|
||||||
tmp3d_nospin = zero;
|
tmp3d_nospin = zero;
|
||||||
for (int it = dt; it < Nt; it += TI){
|
for (int it = dt; it < Nt; it += TI){
|
||||||
for (int ik = dk; ik < nvec; ik += LI){
|
if( it >= Ntfirst && it < Ntfirst + Ntlocal ) {
|
||||||
for (int is = ds; is < Ns; is += Ns){ //at the moment, full spin dilution is enforced
|
for (int ik = dk; ik < nvec; ik += LI){
|
||||||
ExtractSliceLocal(evec3d,eig4d.evec[ik],0,it,3);
|
for (int is = ds; is < Ns; is += Ns){ //at the moment, full spin dilution is enforced
|
||||||
tmp3d_nospin = evec3d * noises[inoise][it][ik]()(is)(); //noises do not have to be a spin vector
|
ExtractSliceLocal(evec3d,epack.evec[ik],0,it,3);
|
||||||
tmp3d=zero;
|
tmp3d_nospin = evec3d * noise[inoise][it][ik]()(is)(); //noises do not have to be a spin vector
|
||||||
pokeSpin(tmp3d,tmp3d_nospin,is);
|
tmp3d=zero;
|
||||||
tmp2=zero;
|
pokeSpin(tmp3d,tmp3d_nospin,is);
|
||||||
InsertSlice(tmp3d,tmp2,it,Grid::QCD::Tdir);
|
tmp2=zero;
|
||||||
rho[vecindex] += tmp2;
|
InsertSliceLocal(tmp3d,tmp2,0,it-Ntfirst,Grid::QCD::Tdir);
|
||||||
|
rho[vecindex] += tmp2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -399,7 +417,30 @@ void TDistilVectors<FImpl>::execute(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
|
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 < Ns; ds++) {
|
||||||
|
vecindex = inoise + nnoise * dk + nnoise * LI * ds + nnoise *LI * Ns*dt;
|
||||||
|
phi[vecindex] = zero;
|
||||||
|
for (int t = Ntfirst; t < Ntfirst + Ntlocal; t++) {
|
||||||
|
sink_tslice=zero;
|
||||||
|
for (int ivec = 0; ivec < nvec; ivec++) {
|
||||||
|
ExtractSliceLocal(evec3d,epack.evec[ivec],0,t,3);
|
||||||
|
// sink_tslice += evec3d * perambulator[inoise + nnoise * dk + nnoise * LI * dt + nnoise*LI*Nt_inv * t + nnoise*LI*Nt_inv*Nt* ivec]()(ds)();
|
||||||
|
sink_tslice += evec3d * perambulator(t, ivec, dk, inoise,dt,ds);
|
||||||
|
}
|
||||||
|
//InsertSliceLocal(sink_tslice,sink4d,0,t-Ntfirst,Grid::QCD::Tdir);
|
||||||
|
//phi[vecindex]+=sink4d; //DIFFERENT TYPES????
|
||||||
|
InsertSliceLocal(sink_tslice,phi[vecindex],0,t-Ntfirst,Grid::QCD::Tdir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user