1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-04 19:25:56 +01:00

Commit for debugging, lot of IO

This commit is contained in:
Guido Cossu 2016-12-13 06:35:30 +00:00
parent e0be2b6e6c
commit 5c74b6028b
4 changed files with 19 additions and 7 deletions

View File

@ -234,11 +234,17 @@ namespace Grid {
virtual RealD MpcDag (const Field &in, Field &out){
Field tmp(in._grid);
std::cout << "norm in :" << norm2(in) << std::endl;
_Mat.MeooeDag(in,tmp);
_Mat.MooeeInvDag(tmp,out);
std::cout << "norm tmp :" << norm2(tmp) << std::endl;
_Mat.MooeeInvDag(tmp,out);
std::cout << "norm out :" << norm2(out) << std::endl;
_Mat.MeooeDag(out,tmp);
std::cout << "norm tmp :" << norm2(tmp) << std::endl;
_Mat.MooeeDag(in,out);
std::cout << "norm out :" << norm2(out) << std::endl;
return axpy_norm(out,-1.0,tmp,out);
}
};

View File

@ -128,8 +128,12 @@ class ConjugateGradient : public OperatorFunction<Field> {
p = p * b + r;
LinalgTimer.Stop();
std::cout << GridLogIterative << "ConjugateGradient: Iteration " << k
<< " residual " << cp << " target " << rsq << std::endl;
std::cout << GridLogDebug << "a = "<< a << " b_pred = "<< b_pred << " b = "<< b << std::endl;
std::cout << GridLogDebug << "qq = "<< qq << " d = "<< d << " c = "<< c << std::endl;
// Stopping condition
if (cp <= rsq) {
@ -161,7 +165,7 @@ class ConjugateGradient : public OperatorFunction<Field> {
}
std::cout << GridLogMessage << "ConjugateGradient did NOT converge"
<< std::endl;
if (ErrorOnNoConverge) assert(0);
if (ErrorOnNoConverge) exit(1);
}
};
}

View File

@ -214,7 +214,9 @@ void CayleyFermion5D<Impl>::MeooeDag5D (const FermionField &psi, FermionField
std::vector<Coeff_t> lower=cs;
upper[Ls-1]=-mass*upper[Ls-1];
lower[0] =-mass*lower[0];
std::cout << "MeooeDag5D: psi: " << norm2(psi) << std::endl;
M5Ddag(psi,psi,Din,lower,diag,upper);
std::cout << "MeooeDag5D: Din: " << norm2(Din) << std::endl;
}
template<class Impl>
@ -280,7 +282,9 @@ void CayleyFermion5D<Impl>::MeooeDag (const FermionField &psi, FermionField &
} else {
this->DhopOE(psi,tmp,DaggerYes);
}
std::cout << "MeooeDag: tmp: " << norm2(tmp) << std::endl;
MeooeDag5D(tmp,chi);
std::cout << "MeooeDag: chi: " << norm2(chi) << std::endl;
}
template<class Impl>

View File

@ -51,12 +51,10 @@ int main(int argc, char** argv) {
GridRedBlackCartesian* UrbGrid =
SpaceTimeGrid::makeFourDimRedBlackGrid(UGrid);
GridCartesian* sUGrid =
SpaceTimeGrid::makeFourDimDWFGrid(GridDefaultLatt(), GridDefaultMpi());
GridRedBlackCartesian* sUrbGrid =
SpaceTimeGrid::makeFourDimRedBlackGrid(sUGrid);
GridCartesian* sUGrid = SpaceTimeGrid::makeFourDimDWFGrid(GridDefaultLatt(), GridDefaultMpi());
GridRedBlackCartesian* sUrbGrid = SpaceTimeGrid::makeFourDimRedBlackGrid(sUGrid);
GridCartesian* FGrid = SpaceTimeGrid::makeFiveDimDWFGrid(Ls, UGrid);
GridCartesian* FGrid = SpaceTimeGrid::makeFiveDimDWFGrid(Ls, UGrid);
GridRedBlackCartesian* FrbGrid = SpaceTimeGrid::makeFiveDimDWFRedBlackGrid(Ls, UGrid);
std::vector<int> seeds4({1, 2, 3, 4});