1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-06-14 13:57:07 +01:00

Zero changes, acceleartor on kernels and some thread loop changes

This commit is contained in:
paboyle
2018-01-27 23:47:38 +00:00
parent 45df59720e
commit 2d0bcc2606
40 changed files with 174 additions and 175 deletions

View File

@ -131,7 +131,7 @@ public:
spProj(eta, tmp[0], -1, Lop.Ls);
Lop.Omega(tmp[0], tmp[1], -1, 0);
G5R5(CG_src, tmp[1]);
tmp[1] = zero;
tmp[1] = Zero();
for(int k=0; k<param.degree; ++k){
gamma_l = 1.0 / ( 1.0 + PowerNegHalf.poles[k] );
Lop.RefreshShiftCoefficients(-gamma_l);
@ -141,7 +141,7 @@ public:
Solver(Lop, CG_src, CG_soln);
prev_solns.push_back(CG_soln);
} else {
CG_soln = zero; // Just use zero as the initial guess
CG_soln = Zero(); // Just use zero as the initial guess
Solver(Lop, CG_src, CG_soln);
}
Lop.Dtilde(CG_soln, tmp[0]); // We actually solved Cayley preconditioned system: transform back
@ -157,7 +157,7 @@ public:
spProj(eta, tmp[0], 1, Rop.Ls);
Rop.Omega(tmp[0], tmp[1], 1, 0);
G5R5(CG_src, tmp[1]);
tmp[1] = zero;
tmp[1] = Zero();
if(use_heatbath_forecasting){ prev_solns.clear(); } // empirically, LH solns don't help for RH solves
for(int k=0; k<param.degree; ++k){
gamma_l = 1.0 / ( 1.0 + PowerNegHalf.poles[k] );
@ -168,7 +168,7 @@ public:
Solver(Rop, CG_src, CG_soln);
prev_solns.push_back(CG_soln);
} else {
CG_soln = zero;
CG_soln = Zero();
Solver(Rop, CG_src, CG_soln);
}
Rop.Dtilde(CG_soln, tmp[0]); // We actually solved Cayley preconditioned system: transform back
@ -199,7 +199,7 @@ public:
spProj(Phi, spProj_Phi, -1, Lop.Ls);
Lop.Omega(spProj_Phi, tmp[0], -1, 0);
G5R5(tmp[1], tmp[0]);
tmp[0] = zero;
tmp[0] = Zero();
Solver(Lop, tmp[1], tmp[0]);
Lop.Dtilde(tmp[0], tmp[1]); // We actually solved Cayley preconditioned system: transform back
Lop.Omega(tmp[1], tmp[0], -1, 1);
@ -210,7 +210,7 @@ public:
spProj(Phi, spProj_Phi, 1, Rop.Ls);
Rop.Omega(spProj_Phi, tmp[0], 1, 0);
G5R5(tmp[1], tmp[0]);
tmp[0] = zero;
tmp[0] = Zero();
Solver(Rop, tmp[1], tmp[0]);
Rop.Dtilde(tmp[0], tmp[1]);
Rop.Omega(tmp[1], tmp[0], 1, 1);
@ -238,7 +238,7 @@ public:
spProj(Phi, spProj_Phi, -1, Lop.Ls);
Lop.Omega(spProj_Phi, Omega_spProj_Phi, -1, 0);
G5R5(CG_src, Omega_spProj_Phi);
spProj_Phi = zero;
spProj_Phi = Zero();
Solver(Lop, CG_src, spProj_Phi);
Lop.Dtilde(spProj_Phi, Chi);
G5R5(g5_R5_Chi, Chi);
@ -250,7 +250,7 @@ public:
spProj(Phi, spProj_Phi, 1, Rop.Ls);
Rop.Omega(spProj_Phi, Omega_spProj_Phi, 1, 0);
G5R5(CG_src, Omega_spProj_Phi);
spProj_Phi = zero;
spProj_Phi = Zero();
Solver(Rop, CG_src, spProj_Phi);
Rop.Dtilde(spProj_Phi, Chi);
G5R5(g5_R5_Chi, Chi);

View File

@ -138,7 +138,7 @@ public:
//////////////////////////////////////////////////////
assert(FermOp.ConstEE() == 1);
PhiEven = zero;
PhiEven = Zero();
};
//////////////////////////////////////////////////////
@ -205,7 +205,7 @@ public:
msCG(Mpc, PhiOdd, MPhi_k);
dSdU = zero;
dSdU = Zero();
for (int k = 0; k < Npole; k++) {
RealD ak = PowerNegHalf.residues[k];

View File

@ -144,7 +144,7 @@ public:
assert(NumOp.ConstEE() == 1);
assert(DenOp.ConstEE() == 1);
PhiEven = zero;
PhiEven = Zero();
};
@ -236,7 +236,7 @@ public:
RealD ak;
dSdU = zero;
dSdU = Zero();
// With these building blocks
//

View File

@ -187,7 +187,7 @@ public:
msCG(MdagMOp,Phi,MPhi_k);
dSdU = zero;
dSdU = Zero();
for(int k=0;k<Npole;k++){
RealD ak = PowerNegHalf.residues[k];

View File

@ -222,7 +222,7 @@ public:
RealD ak;
dSdU = zero;
dSdU = Zero();
// With these building blocks
//

View File

@ -111,7 +111,7 @@ public:
FermionField Y(FermOp.FermionGrid());
MdagMLinearOperator<FermionOperator<Impl>, FermionField> MdagMOp(FermOp);
X = zero;
X = Zero();
ActionSolver(MdagMOp, Phi, X);
MdagMOp.Op(X, Y);
@ -138,7 +138,7 @@ public:
MdagMLinearOperator<FermionOperator<Impl>, FermionField> MdagMOp(FermOp);
X = zero;
X = Zero();
DerivativeSolver(MdagMOp, Phi, X); // X = (MdagM)^-1 phi
MdagMOp.Op(X, Y); // Y = M X = (Mdag)^-1 phi

View File

@ -121,7 +121,7 @@ public:
SchurDifferentiableOperator<Impl> PCop(FermOp);
X=zero;
X=Zero();
ActionSolver(PCop,PhiOdd,X);
PCop.Op(X,Y);
RealD action = norm2(Y);
@ -155,7 +155,7 @@ public:
// Our conventions really make this UdSdU; We do not differentiate wrt Udag here.
// So must take dSdU - adj(dSdU) and left multiply by mom to get dS/dt.
X=zero;
X=Zero();
DerivativeSolver(Mpc,PhiOdd,X);
Mpc.Mpc(X,Y);
Mpc.MpcDeriv(tmp , Y, X ); dSdU=tmp;

View File

@ -109,7 +109,7 @@ public:
// Odd det factors
Mpc.MpcDag(etaOdd,PhiOdd);
tmp=zero;
tmp=Zero();
ActionSolver(Vpc,PhiOdd,tmp);
Vpc.Mpc(tmp,PhiOdd);
@ -137,7 +137,7 @@ public:
FermionField Y(NumOp.FermionRedBlackGrid());
Vpc.MpcDag(PhiOdd,Y); // Y= Vdag phi
X=zero;
X=Zero();
ActionSolver(Mpc,Y,X); // X= (MdagM)^-1 Vdag phi
//Mpc.Mpc(X,Y); // Y= Mdag^-1 Vdag phi
// Multiply by Ydag
@ -145,7 +145,7 @@ public:
//RealD action = norm2(Y);
// The EE factorised block; normally can replace with zero if det is constant (gauge field indept)
// The EE factorised block; normally can replace with Zero() if det is constant (gauge field indept)
// Only really clover term that creates this. Leave the EE portion as a future to do to make most
// rapid progresss on DWF for now.
//
@ -179,7 +179,7 @@ public:
//X = (Mdag M)^-1 V^dag phi
//Y = (Mdag)^-1 V^dag phi
Vpc.MpcDag(PhiOdd,Y); // Y= Vdag phi
X=zero;
X=Zero();
DerivativeSolver(Mpc,Y,X); // X= (MdagM)^-1 Vdag phi
Mpc.Mpc(X,Y); // Y= Mdag^-1 Vdag phi

View File

@ -94,7 +94,7 @@ public:
MdagMLinearOperator<FermionOperator<Impl> ,FermionField> MdagMOp(NumOp);
DenOp.Mdag(eta,Phi); // Mdag eta
tmp = zero;
tmp = Zero();
ActionSolver(MdagMOp,Phi,tmp); // (VdagV)^-1 Mdag eta = V^-1 Vdag^-1 Mdag eta
NumOp.M(tmp,Phi); // Vdag^-1 Mdag eta
@ -116,7 +116,7 @@ public:
MdagMLinearOperator<FermionOperator<Impl> ,FermionField> MdagMOp(DenOp);
NumOp.Mdag(Phi,Y); // Y= Vdag phi
X=zero;
X=Zero();
ActionSolver(MdagMOp,Y,X); // X= (MdagM)^-1 Vdag phi
DenOp.M(X,Y); // Y= Mdag^-1 Vdag phi
@ -147,7 +147,7 @@ public:
//X = (Mdag M)^-1 V^dag phi
//Y = (Mdag)^-1 V^dag phi
NumOp.Mdag(Phi,Y); // Y= Vdag phi
X=zero;
X=Zero();
DerivativeSolver(MdagMOp,Y,X); // X= (MdagM)^-1 Vdag phi
DenOp.M(X,Y); // Y= Mdag^-1 Vdag phi