mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-13 04:37:05 +01:00
Updates in tests to make all of Grid compile
This commit is contained in:
@ -45,8 +45,8 @@ public:
|
||||
bool , b,
|
||||
std::vector<double>, array,
|
||||
std::vector<std::vector<double> >, twodimarray,
|
||||
std::vector<std::vector<std::vector<Complex> > >, cmplx3darray,
|
||||
SpinColourMatrix, scm
|
||||
std::vector<std::vector<std::vector<Complex> > >, cmplx3darray,
|
||||
SpinColourMatrix, scm
|
||||
);
|
||||
myclass() {}
|
||||
myclass(int i)
|
||||
|
@ -30,15 +30,14 @@ Author: paboyle <paboyle@ph.ed.ac.uk>
|
||||
|
||||
using namespace std;
|
||||
using namespace Grid;
|
||||
using namespace Grid::QCD;
|
||||
|
||||
int main (int argc, char ** argv)
|
||||
{
|
||||
Grid_init(&argc,&argv);
|
||||
|
||||
std::vector<int> latt_size = GridDefaultLatt();
|
||||
std::vector<int> simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd());
|
||||
std::vector<int> mpi_layout = GridDefaultMpi();
|
||||
auto latt_size = GridDefaultLatt();
|
||||
auto simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd());
|
||||
auto mpi_layout = GridDefaultMpi();
|
||||
|
||||
const int Ls=16;
|
||||
GridCartesian * UGrid = SpaceTimeGrid::makeFourDimGrid(GridDefaultLatt(), GridDefaultSimd(Nd,vComplexF::Nsimd()),GridDefaultMpi());
|
||||
@ -76,9 +75,9 @@ int main (int argc, char ** argv)
|
||||
src = zero;
|
||||
pokeSite(cv,src,site);
|
||||
*/
|
||||
FermionField result(FGrid); result=zero;
|
||||
FermionField tmp(FGrid); tmp=zero;
|
||||
FermionField err(FGrid); tmp=zero;
|
||||
FermionField result(FGrid); result=Zero();
|
||||
FermionField tmp(FGrid); tmp=Zero();
|
||||
FermionField err(FGrid); tmp=Zero();
|
||||
FermionField phi (FGrid); random(pRNG5,phi);
|
||||
FermionField chi (FGrid); random(pRNG5,chi);
|
||||
|
||||
@ -88,7 +87,7 @@ int main (int argc, char ** argv)
|
||||
/*
|
||||
for(int mu=1;mu<4;mu++){
|
||||
auto tmp = PeekIndex<LorentzIndex>(Umu,mu);
|
||||
tmp = zero;
|
||||
tmp = Zero();
|
||||
PokeIndex<LorentzIndex>(Umu,tmp,mu);
|
||||
}
|
||||
*/
|
||||
@ -129,9 +128,9 @@ int main (int argc, char ** argv)
|
||||
std::cout<<GridLogMessage << "Calling vectorised staggered operator"<<std::endl;
|
||||
|
||||
#ifdef AVX512
|
||||
QCD::StaggeredKernelsStatic::Opt=QCD::StaggeredKernelsStatic::OptInlineAsm;
|
||||
StaggeredKernelsStatic::Opt=StaggeredKernelsStatic::OptInlineAsm;
|
||||
#else
|
||||
QCD::StaggeredKernelsStatic::Opt=QCD::StaggeredKernelsStatic::OptGeneric;
|
||||
StaggeredKernelsStatic::Opt=StaggeredKernelsStatic::OptGeneric;
|
||||
#endif
|
||||
|
||||
t0=usecond();
|
||||
@ -150,9 +149,9 @@ int main (int argc, char ** argv)
|
||||
|
||||
|
||||
FermionField ssrc (sFGrid); localConvert(src,ssrc);
|
||||
FermionField sresult(sFGrid); sresult=zero;
|
||||
FermionField sresult(sFGrid); sresult=Zero();
|
||||
|
||||
QCD::StaggeredKernelsStatic::Opt=QCD::StaggeredKernelsStatic::OptHandUnroll;
|
||||
StaggeredKernelsStatic::Opt=StaggeredKernelsStatic::OptHandUnroll;
|
||||
t0=usecond();
|
||||
for(int i=0;i<ncall1;i++){
|
||||
sDs.Dhop(ssrc,sresult,0);
|
||||
@ -167,9 +166,9 @@ int main (int argc, char ** argv)
|
||||
|
||||
|
||||
#ifdef AVX512
|
||||
QCD::StaggeredKernelsStatic::Opt=QCD::StaggeredKernelsStatic::OptInlineAsm;
|
||||
StaggeredKernelsStatic::Opt=StaggeredKernelsStatic::OptInlineAsm;
|
||||
#else
|
||||
QCD::StaggeredKernelsStatic::Opt=QCD::StaggeredKernelsStatic::OptGeneric;
|
||||
StaggeredKernelsStatic::Opt=StaggeredKernelsStatic::OptGeneric;
|
||||
#endif
|
||||
|
||||
err = tmp-result;
|
||||
|
@ -35,9 +35,9 @@ int main(int argc, char **argv)
|
||||
{
|
||||
Grid_init(&argc, &argv);
|
||||
|
||||
std::vector<int> latt_size = GridDefaultLatt();
|
||||
std::vector<int> simd_layout = GridDefaultSimd(Nd, vComplex::Nsimd());
|
||||
std::vector<int> mpi_layout = GridDefaultMpi();
|
||||
auto latt_size = GridDefaultLatt();
|
||||
auto simd_layout = GridDefaultSimd(Nd, vComplex::Nsimd());
|
||||
auto mpi_layout = GridDefaultMpi();
|
||||
GridCartesian Grid(latt_size, simd_layout, mpi_layout);
|
||||
GridRedBlackCartesian RBGrid(&Grid);
|
||||
|
||||
@ -59,17 +59,17 @@ int main(int argc, char **argv)
|
||||
FermionField src(&Grid);
|
||||
random(pRNG, src);
|
||||
FermionField result(&Grid);
|
||||
result = zero;
|
||||
result = Zero();
|
||||
FermionField result2(&Grid);
|
||||
result2 = zero;
|
||||
result2 = Zero();
|
||||
FermionField ref(&Grid);
|
||||
ref = zero;
|
||||
ref = Zero();
|
||||
FermionField tmp(&Grid);
|
||||
tmp = zero;
|
||||
tmp = Zero();
|
||||
FermionField err(&Grid);
|
||||
err = zero;
|
||||
err = Zero();
|
||||
FermionField err2(&Grid);
|
||||
err2 = zero;
|
||||
err2 = Zero();
|
||||
FermionField phi(&Grid);
|
||||
random(pRNG, phi);
|
||||
FermionField chi(&Grid);
|
||||
@ -214,9 +214,9 @@ int main(int argc, char **argv)
|
||||
std::cout << GridLogMessage << "= Testing gauge covariance Clover term with EO preconditioning " << std::endl;
|
||||
std::cout << GridLogMessage << "================================================================" << std::endl;
|
||||
|
||||
chi = zero;
|
||||
phi = zero;
|
||||
tmp = zero;
|
||||
chi = Zero();
|
||||
phi = Zero();
|
||||
tmp = Zero();
|
||||
pickCheckerboard(Even, chi_e, chi);
|
||||
pickCheckerboard(Odd, chi_o, chi);
|
||||
pickCheckerboard(Even, phi_e, phi);
|
||||
@ -236,9 +236,9 @@ int main(int argc, char **argv)
|
||||
LatticeColourMatrix Omega(&Grid);
|
||||
LatticeColourMatrix ShiftedOmega(&Grid);
|
||||
LatticeGaugeField U_prime(&Grid);
|
||||
U_prime = zero;
|
||||
U_prime = Zero();
|
||||
LatticeColourMatrix U_prime_mu(&Grid);
|
||||
U_prime_mu = zero;
|
||||
U_prime_mu = Zero();
|
||||
SU<Nc>::LieRandomize(pRNG2, Omega, 1.0);
|
||||
for (int mu = 0; mu < Nd; mu++)
|
||||
{
|
||||
@ -269,8 +269,8 @@ int main(int argc, char **argv)
|
||||
std::cout << GridLogMessage << "= Testing gauge covariance Clover term w/o EO preconditioning " << std::endl;
|
||||
std::cout << GridLogMessage << "================================================================" << std::endl;
|
||||
|
||||
chi = zero;
|
||||
phi = zero;
|
||||
chi = Zero();
|
||||
phi = Zero();
|
||||
|
||||
WilsonFermionR Dw(Umu, Grid, RBGrid, mass, params);
|
||||
Dw.ImportGauge(Umu);
|
||||
@ -293,9 +293,9 @@ int main(int argc, char **argv)
|
||||
std::cout << GridLogMessage << "= Testing Mooee(csw=0) Clover to reproduce Mooee Wilson " << std::endl;
|
||||
std::cout << GridLogMessage << "==========================================================" << std::endl;
|
||||
|
||||
chi = zero;
|
||||
phi = zero;
|
||||
err = zero;
|
||||
chi = Zero();
|
||||
phi = Zero();
|
||||
err = Zero();
|
||||
WilsonCloverFermionR Dwc_csw0(Umu, Grid, RBGrid, mass, 0.0, 0.0, anis, params); // <-- Notice: csw=0
|
||||
Dwc_csw0.ImportGauge(Umu);
|
||||
|
||||
@ -323,9 +323,9 @@ int main(int argc, char **argv)
|
||||
std::cout << GridLogMessage << "= Testing EO operator is equal to the unprec " << std::endl;
|
||||
std::cout << GridLogMessage << "==========================================================" << std::endl;
|
||||
|
||||
chi = zero;
|
||||
phi = zero;
|
||||
err = zero;
|
||||
chi = Zero();
|
||||
phi = Zero();
|
||||
err = Zero();
|
||||
|
||||
pickCheckerboard(Even, phi_e, phi);
|
||||
pickCheckerboard(Odd, phi_o, phi);
|
||||
|
@ -30,19 +30,9 @@ Author: paboyle <paboyle@ph.ed.ac.uk>
|
||||
|
||||
using namespace std;
|
||||
using namespace Grid;
|
||||
;
|
||||
|
||||
template<class d>
|
||||
struct scal {
|
||||
d internal;
|
||||
};
|
||||
|
||||
Gamma::Algebra Gmu [] = {
|
||||
Gamma::Algebra::GammaX,
|
||||
Gamma::Algebra::GammaY,
|
||||
Gamma::Algebra::GammaZ,
|
||||
Gamma::Algebra::GammaT
|
||||
};
|
||||
|
||||
|
||||
template<class What>
|
||||
void TestCGinversions(What & Ddwf,
|
||||
@ -261,7 +251,7 @@ void TestReconstruct5D(What & Ddwf,
|
||||
GridParallelRNG *RNG5)
|
||||
{
|
||||
LatticeFermion src4 (UGrid); random(*RNG4,src4);
|
||||
LatticeFermion res4 (UGrid); res4 = zero;
|
||||
LatticeFermion res4 (UGrid); res4 = Zero();
|
||||
|
||||
LatticeFermion src (FGrid);
|
||||
LatticeFermion src_NE(FGrid);
|
||||
@ -332,7 +322,7 @@ void TestReconstruct5DFA(What & Ddwf,
|
||||
GridParallelRNG *RNG5)
|
||||
{
|
||||
LatticeFermion src4 (UGrid); random(*RNG4,src4);
|
||||
LatticeFermion res4 (UGrid); res4 = zero;
|
||||
LatticeFermion res4 (UGrid); res4 = Zero();
|
||||
|
||||
LatticeFermion src (FGrid);
|
||||
LatticeFermion src_NE(FGrid);
|
||||
|
@ -38,13 +38,13 @@ int main (int argc, char ** argv)
|
||||
|
||||
Grid_init(&argc,&argv);
|
||||
|
||||
std::vector<int> latt_size = GridDefaultLatt();
|
||||
Coordinate latt_size = GridDefaultLatt();
|
||||
int nd = latt_size.size();
|
||||
int ndm1 = nd-1;
|
||||
|
||||
std::vector<int> simd_layout = GridDefaultSimd(nd,vComplex::Nsimd());
|
||||
std::vector<int> mpi_layout = GridDefaultMpi();
|
||||
std::vector<int> mpi_split (mpi_layout.size(),1);
|
||||
Coordinate simd_layout = GridDefaultSimd(nd,vComplex::Nsimd());
|
||||
Coordinate mpi_layout = GridDefaultMpi();
|
||||
Coordinate mpi_split (mpi_layout.size(),1);
|
||||
|
||||
std::cout << " Full " << GridCmdVectorIntToString(latt_size) << " subgrid" <<std::endl;
|
||||
std::cout << " Full " << GridCmdVectorIntToString(mpi_layout) << " sub communicator"<<std::endl;
|
||||
@ -54,9 +54,9 @@ int main (int argc, char ** argv)
|
||||
simd_layout,
|
||||
mpi_layout);
|
||||
|
||||
std::vector<int> latt_m = latt_size; latt_m[nd-1] = 1;
|
||||
std::vector<int> mpi_m = mpi_layout; mpi_m [nd-1] = 1;
|
||||
std::vector<int> simd_m = GridDefaultSimd(ndm1,vComplex::Nsimd()); simd_m.push_back(1);
|
||||
Coordinate latt_m = latt_size; latt_m[nd-1] = 1;
|
||||
Coordinate mpi_m = mpi_layout; mpi_m [nd-1] = 1;
|
||||
Coordinate simd_m = GridDefaultSimd(ndm1,vComplex::Nsimd()); simd_m.push_back(1);
|
||||
|
||||
|
||||
std::cout << " Requesting " << GridCmdVectorIntToString(latt_m)<< " subgrid" <<std::endl;
|
||||
@ -88,7 +88,7 @@ int main (int argc, char ** argv)
|
||||
|
||||
auto local_latt = GridN->LocalDimensions();
|
||||
|
||||
Full_cpy = zero;
|
||||
Full_cpy = Zero();
|
||||
std::vector<int> seeds({1,2,3,4});
|
||||
GridParallelRNG RNG(GridN); RNG.SeedFixedIntegers(seeds);
|
||||
|
||||
|
@ -29,15 +29,14 @@ Author: paboyle <paboyle@ph.ed.ac.uk>
|
||||
|
||||
using namespace std;
|
||||
using namespace Grid;
|
||||
using namespace Grid::QCD;
|
||||
|
||||
int main (int argc, char ** argv)
|
||||
{
|
||||
Grid_init(&argc,&argv);
|
||||
|
||||
std::vector<int> latt_size = GridDefaultLatt();
|
||||
std::vector<int> simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd());
|
||||
std::vector<int> mpi_layout = GridDefaultMpi();
|
||||
auto latt_size = GridDefaultLatt();
|
||||
auto simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd());
|
||||
auto mpi_layout = GridDefaultMpi();
|
||||
|
||||
GridCartesian Grid(latt_size,simd_layout,mpi_layout);
|
||||
GridRedBlackCartesian RBGrid(&Grid);
|
||||
@ -85,8 +84,11 @@ int main (int argc, char ** argv)
|
||||
PokeIndex<LorentzIndex>(mom,mommu,mu);
|
||||
|
||||
// fourth order exponential approx
|
||||
parallel_for(auto i=mom.begin();i<mom.end();i++){ // exp(pmu dt) * Umu
|
||||
Uprime[i](mu) = U[i](mu) + mom[i](mu)*U[i](mu)*dt ;
|
||||
auto Uprime_v = Uprime.View();
|
||||
auto U_v = U.View();
|
||||
auto mom_v = mom.View();
|
||||
parallel_for(auto i=mom_v.begin();i<mom_v.end();i++){ // exp(pmu dt) * Umu
|
||||
Uprime_v[i](mu) = U_v[i](mu) + mom_v[i](mu)*U_v[i](mu)*dt ;
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,7 +98,7 @@ int main (int argc, char ** argv)
|
||||
// Use derivative to estimate dS
|
||||
//////////////////////////////////////////////
|
||||
|
||||
LatticeComplex dS(&Grid); dS = zero;
|
||||
LatticeComplex dS(&Grid); dS = Zero();
|
||||
|
||||
for(int mu=0;mu<Nd;mu++){
|
||||
|
||||
|
@ -35,9 +35,9 @@ int main(int argc, char **argv)
|
||||
{
|
||||
Grid_init(&argc, &argv);
|
||||
|
||||
std::vector<int> latt_size = GridDefaultLatt();
|
||||
std::vector<int> simd_layout = GridDefaultSimd(Nd, vComplex::Nsimd());
|
||||
std::vector<int> mpi_layout = GridDefaultMpi();
|
||||
auto latt_size = GridDefaultLatt();
|
||||
auto simd_layout = GridDefaultSimd(Nd, vComplex::Nsimd());
|
||||
auto mpi_layout = GridDefaultMpi();
|
||||
|
||||
GridCartesian Grid(latt_size, simd_layout, mpi_layout);
|
||||
GridRedBlackCartesian RBGrid(&Grid);
|
||||
@ -63,9 +63,8 @@ int main(int argc, char **argv)
|
||||
|
||||
LatticeGaugeField U(&Grid);
|
||||
|
||||
std::vector<int> site = {0, 0, 0, 0};
|
||||
SU3::HotConfiguration(pRNG, U);
|
||||
//SU3::ColdConfiguration(pRNG, U);// Clover term zero
|
||||
//SU3::ColdConfiguration(pRNG, U);// Clover term Zero()
|
||||
|
||||
////////////////////////////////////
|
||||
// Unmodified matrix element
|
||||
@ -107,9 +106,12 @@ int main(int argc, char **argv)
|
||||
Hmom -= real(sum(trace(mommu * mommu)));
|
||||
PokeIndex<LorentzIndex>(mom, mommu, mu);
|
||||
|
||||
parallel_for(int ss = 0; ss < mom._grid->oSites(); ss++)
|
||||
auto Uprime_v = Uprime.View();
|
||||
auto U_v = U.View();
|
||||
auto mom_v = mom.View();
|
||||
parallel_for(int ss = 0; ss < mom.Grid()->oSites(); ss++)
|
||||
{
|
||||
Uprime[ss]._internal[mu] = ProjectOnGroup(Exponentiate(mom[ss]._internal[mu], dt, 12) * U[ss]._internal[mu]);
|
||||
Uprime_v[ss]._internal[mu] = ProjectOnGroup(Exponentiate(mom_v[ss]._internal[mu], dt, 12) * U_v[ss]._internal[mu]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -125,11 +127,11 @@ int main(int argc, char **argv)
|
||||
//////////////////////////////////////////////
|
||||
|
||||
LatticeComplex dS(&Grid);
|
||||
dS = zero;
|
||||
dS = Zero();
|
||||
LatticeComplex dSmom(&Grid);
|
||||
dSmom = zero;
|
||||
dSmom = Zero();
|
||||
LatticeComplex dSmom2(&Grid);
|
||||
dSmom2 = zero;
|
||||
dSmom2 = Zero();
|
||||
|
||||
for (int mu = 0; mu < Nd; mu++)
|
||||
{
|
||||
|
@ -30,7 +30,6 @@ directory
|
||||
|
||||
using namespace std;
|
||||
using namespace Grid;
|
||||
using namespace Grid::QCD;
|
||||
|
||||
|
||||
//typedef WilsonCloverFermionR FermionOp;
|
||||
@ -154,11 +153,11 @@ NerscHmcCheckpointer<PeriodicGimplR> Checkpoint(CPparams);
|
||||
std::vector<ASymmFermionField> ASevec(Nm, FGrid);
|
||||
|
||||
for (int i = 0; i < 1; i++) {
|
||||
std::cout << i << " / " << Nm << "Fund: grid pointer " << Fundevec[i]._grid
|
||||
std::cout << i << " / " << Nm << "Fund: grid pointer " << Fundevec[i].Grid()
|
||||
<< std::endl;
|
||||
};
|
||||
for (int i = 0; i < 1; i++) {
|
||||
std::cout << i << " / " << Nm << "AS: grid pointer " << ASevec[i]._grid
|
||||
std::cout << i << " / " << Nm << "AS: grid pointer " << ASevec[i].Grid()
|
||||
<< std::endl;
|
||||
};
|
||||
|
||||
|
@ -36,7 +36,6 @@ Author: Peter Boyle <paboyle@ph.ed.ac.uk>
|
||||
|
||||
using namespace std;
|
||||
using namespace Grid;
|
||||
using namespace Grid::QCD;
|
||||
|
||||
template<class Fobj,class CComplex,int nbasis>
|
||||
class LocalCoherenceLanczosScidac : public LocalCoherenceLanczos<Fobj,CComplex,nbasis>
|
||||
@ -58,7 +57,7 @@ public:
|
||||
{
|
||||
assert(this->subspace.size()==nbasis);
|
||||
emptyUserRecord record;
|
||||
Grid::QCD::ScidacWriter WR(this->_FineGrid->IsBoss());
|
||||
Grid::ScidacWriter WR(this->_FineGrid->IsBoss());
|
||||
WR.open(evecs_file);
|
||||
for(int k=0;k<nbasis;k++) {
|
||||
WR.writeScidacFieldRecord(this->subspace[k],record);
|
||||
@ -82,10 +81,10 @@ public:
|
||||
|
||||
std::cout << GridLogIRL<< "checkpointFineRestore: Reading evecs from "<<evecs_file<<std::endl;
|
||||
emptyUserRecord record;
|
||||
Grid::QCD::ScidacReader RD ;
|
||||
Grid::ScidacReader RD ;
|
||||
RD.open(evecs_file);
|
||||
for(int k=0;k<nbasis;k++) {
|
||||
this->subspace[k].checkerboard=this->_checkerboard;
|
||||
this->subspace[k].Checkerboard()=this->_checkerboard;
|
||||
RD.readScidacFieldRecord(this->subspace[k],record);
|
||||
|
||||
}
|
||||
@ -96,7 +95,7 @@ public:
|
||||
{
|
||||
int n = this->evec_coarse.size();
|
||||
emptyUserRecord record;
|
||||
Grid::QCD::ScidacWriter WR(this->_CoarseGrid->IsBoss());
|
||||
Grid::ScidacWriter WR(this->_CoarseGrid->IsBoss());
|
||||
WR.open(evecs_file);
|
||||
for(int k=0;k<n;k++) {
|
||||
WR.writeScidacFieldRecord(this->evec_coarse[k],record);
|
||||
@ -119,7 +118,7 @@ public:
|
||||
assert(this->evals_coarse.size()==nvec);
|
||||
emptyUserRecord record;
|
||||
std::cout << GridLogIRL<< "checkpointCoarseRestore: Reading evecs from "<<evecs_file<<std::endl;
|
||||
Grid::QCD::ScidacReader RD ;
|
||||
Grid::ScidacReader RD ;
|
||||
RD.open(evecs_file);
|
||||
for(int k=0;k<nvec;k++) {
|
||||
RD.readScidacFieldRecord(this->evec_coarse[k],record);
|
||||
@ -150,7 +149,7 @@ int main (int argc, char ** argv) {
|
||||
int Ls = (int)Params.omega.size();
|
||||
RealD mass = Params.mass;
|
||||
RealD M5 = Params.M5;
|
||||
std::vector<int> blockSize = Params.blockSize;
|
||||
auto blockSize = Params.blockSize;
|
||||
|
||||
// Grids
|
||||
GridCartesian * UGrid = SpaceTimeGrid::makeFourDimGrid(GridDefaultLatt(),
|
||||
@ -160,11 +159,10 @@ int main (int argc, char ** argv) {
|
||||
GridCartesian * FGrid = SpaceTimeGrid::makeFiveDimGrid(Ls,UGrid);
|
||||
GridRedBlackCartesian * FrbGrid = SpaceTimeGrid::makeFiveDimRedBlackGrid(Ls,UGrid);
|
||||
|
||||
std::vector<int> fineLatt = GridDefaultLatt();
|
||||
auto fineLatt = GridDefaultLatt();
|
||||
int dims=fineLatt.size();
|
||||
assert(blockSize.size()==dims+1);
|
||||
std::vector<int> coarseLatt(dims);
|
||||
std::vector<int> coarseLatt5d ;
|
||||
Coordinate coarseLatt(dims);
|
||||
|
||||
for (int d=0;d<coarseLatt.size();d++){
|
||||
coarseLatt[d] = fineLatt[d]/blockSize[d]; assert(coarseLatt[d]*blockSize[d]==fineLatt[d]);
|
||||
|
@ -58,7 +58,7 @@ public:
|
||||
{
|
||||
assert(this->subspace.size()==nbasis);
|
||||
emptyUserRecord record;
|
||||
Grid::QCD::ScidacWriter WR(this->_FineGrid->IsBoss());
|
||||
Grid::ScidacWriter WR(this->_FineGrid->IsBoss());
|
||||
WR.open(evecs_file);
|
||||
for(int k=0;k<nbasis;k++) {
|
||||
WR.writeScidacFieldRecord(this->subspace[k],record);
|
||||
@ -85,7 +85,7 @@ public:
|
||||
Grid::ScidacReader RD ;
|
||||
RD.open(evecs_file);
|
||||
for(int k=0;k<nbasis;k++) {
|
||||
this->subspace[k].checkerboard=this->_checkerboard;
|
||||
this->subspace[k].Checkerboard()=this->_checkerboard;
|
||||
RD.readScidacFieldRecord(this->subspace[k],record);
|
||||
}
|
||||
RD.close();
|
||||
@ -95,7 +95,7 @@ public:
|
||||
{
|
||||
int n = this->evec_coarse.size();
|
||||
emptyUserRecord record;
|
||||
Grid::QCD::ScidacWriter WR(this->_CoarseGrid->IsBoss());
|
||||
Grid::ScidacWriter WR(this->_CoarseGrid->IsBoss());
|
||||
WR.open(evecs_file);
|
||||
for(int k=0;k<n;k++) {
|
||||
WR.writeScidacFieldRecord(this->evec_coarse[k],record);
|
||||
|
@ -228,7 +228,7 @@ int main (int argc, char ** argv)
|
||||
std::cout << GridLogMessage<<" resid["<<n<<"] "<< norm2(tmp)/norm2(src[n])<<std::endl;
|
||||
}
|
||||
|
||||
for(int s=0;s<nrhs;s++) result[s]=zero;
|
||||
for(int s=0;s<nrhs;s++) result[s]=Zero();
|
||||
int blockDim = 0;//not used for BlockCGVec
|
||||
BlockConjugateGradient<FermionField> BCGV (BlockCGVec,blockDim,stp,10000);
|
||||
BCGV.PrintInterval=10;
|
||||
|
@ -30,7 +30,6 @@ Author: Peter Boyle <paboyle@ph.ed.ac.uk>
|
||||
|
||||
using namespace std;
|
||||
using namespace Grid;
|
||||
using namespace Grid::QCD;
|
||||
|
||||
int main (int argc, char ** argv)
|
||||
{
|
||||
@ -42,12 +41,12 @@ int main (int argc, char ** argv)
|
||||
|
||||
Grid_init(&argc,&argv);
|
||||
|
||||
std::vector<int> latt_size = GridDefaultLatt();
|
||||
std::vector<int> simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd());
|
||||
std::vector<int> mpi_layout = GridDefaultMpi();
|
||||
std::vector<int> mpi_split (mpi_layout.size(),1);
|
||||
std::vector<int> split_coor (mpi_layout.size(),1);
|
||||
std::vector<int> split_dim (mpi_layout.size(),1);
|
||||
auto latt_size = GridDefaultLatt();
|
||||
auto simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd());
|
||||
auto mpi_layout = GridDefaultMpi();
|
||||
Coordinate mpi_split (mpi_layout.size(),1);
|
||||
Coordinate split_coor (mpi_layout.size(),1);
|
||||
Coordinate split_dim (mpi_layout.size(),1);
|
||||
|
||||
std::vector<ComplexD> boundary_phases(Nd,1.);
|
||||
boundary_phases[Nd-1]=-1.;
|
||||
@ -108,7 +107,7 @@ int main (int argc, char ** argv)
|
||||
FermionField tmp(FGrid);
|
||||
std::cout << GridLogMessage << "Made the Fermion Fields"<<std::endl;
|
||||
|
||||
for(int s=0;s<nrhs;s++) result[s]=zero;
|
||||
for(int s=0;s<nrhs;s++) result[s]=Zero();
|
||||
GridParallelRNG pRNG5(FGrid); pRNG5.SeedFixedIntegers(seeds);
|
||||
for(int s=0;s<nrhs;s++) {
|
||||
random(pRNG5,src[s]);
|
||||
@ -131,7 +130,6 @@ int main (int argc, char ** argv)
|
||||
std::cout << GridLogMessage << "Intialised 4D RNG "<<std::endl;
|
||||
SU3::HotConfiguration(pRNG,Umu);
|
||||
std::cout << GridLogMessage << "Intialised the HOT Gauge Field"<<std::endl;
|
||||
std::cout << " Site zero "<< Umu._odata[0] <<std::endl;
|
||||
}
|
||||
|
||||
/////////////////
|
||||
@ -170,7 +168,7 @@ int main (int argc, char ** argv)
|
||||
MdagMLinearOperator<MobiusFermionR,FermionField> HermOp(Ddwf);
|
||||
MdagMLinearOperator<MobiusFermionR,FermionField> HermOpCk(Dchk);
|
||||
ConjugateGradient<FermionField> CG((stp),100000);
|
||||
s_res = zero;
|
||||
s_res = Zero();
|
||||
|
||||
CG(HermOp,s_src,s_res);
|
||||
|
||||
@ -202,7 +200,7 @@ int main (int argc, char ** argv)
|
||||
|
||||
|
||||
for(int s=0;s<nrhs;s++){
|
||||
result[s]=zero;
|
||||
result[s]=Zero();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
|
@ -43,9 +43,9 @@ int main (int argc, char ** argv)
|
||||
|
||||
Grid_init(&argc,&argv);
|
||||
|
||||
std::vector<int> latt_size = GridDefaultLatt();
|
||||
std::vector<int> simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd());
|
||||
std::vector<int> mpi_layout = GridDefaultMpi();
|
||||
auto latt_size = GridDefaultLatt();
|
||||
auto simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd());
|
||||
auto mpi_layout = GridDefaultMpi();
|
||||
|
||||
std::vector<ComplexD> boundary_phases(Nd,1.);
|
||||
boundary_phases[Nd-1]=-1.;
|
||||
@ -72,7 +72,7 @@ int main (int argc, char ** argv)
|
||||
FermionField tmp(FGrid);
|
||||
std::cout << GridLogMessage << "Made the Fermion Fields"<<std::endl;
|
||||
|
||||
for(int s=0;s<nrhs;s++) result[s]=zero;
|
||||
for(int s=0;s<nrhs;s++) result[s]=Zero();
|
||||
GridParallelRNG pRNG5(FGrid); pRNG5.SeedFixedIntegers(seeds);
|
||||
for(int s=0;s<nrhs;s++) {
|
||||
random(pRNG5,src[s]);
|
||||
@ -116,7 +116,7 @@ int main (int argc, char ** argv)
|
||||
ConjugateGradient<FermionField> CG((stp),100000);
|
||||
|
||||
for(int rhs=0;rhs<1;rhs++){
|
||||
result[rhs] = zero;
|
||||
result[rhs] = Zero();
|
||||
CG(HermOp,src[rhs],result[rhs]);
|
||||
}
|
||||
|
||||
@ -129,7 +129,7 @@ int main (int argc, char ** argv)
|
||||
/////////////////////////////////////////////////////////////
|
||||
int blockDim = 0;//not used for BlockCGVec
|
||||
for(int s=0;s<nrhs;s++){
|
||||
result[s]=zero;
|
||||
result[s]=Zero();
|
||||
}
|
||||
BlockConjugateGradient<FermionField> BCGV (BlockCGrQVec,blockDim,stp,100000);
|
||||
{
|
||||
|
@ -43,9 +43,9 @@ int main (int argc, char ** argv)
|
||||
|
||||
Grid_init(&argc,&argv);
|
||||
|
||||
std::vector<int> latt_size = GridDefaultLatt();
|
||||
std::vector<int> simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd());
|
||||
std::vector<int> mpi_layout = GridDefaultMpi();
|
||||
auto latt_size = GridDefaultLatt();
|
||||
auto simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd());
|
||||
auto mpi_layout = GridDefaultMpi();
|
||||
|
||||
std::vector<ComplexD> boundary_phases(Nd,1.);
|
||||
boundary_phases[Nd-1]=-1.;
|
||||
@ -73,7 +73,7 @@ int main (int argc, char ** argv)
|
||||
FermionField tmp(FGrid);
|
||||
std::cout << GridLogMessage << "Made the Fermion Fields"<<std::endl;
|
||||
|
||||
for(int s=0;s<nrhs;s++) result[s]=zero;
|
||||
for(int s=0;s<nrhs;s++) result[s]=Zero();
|
||||
GridParallelRNG pRNG4(UGrid); pRNG4.SeedFixedIntegers(seeds);
|
||||
for(int s=0;s<nrhs;s++) {
|
||||
random(pRNG4,src4[s]);
|
||||
@ -120,7 +120,7 @@ int main (int argc, char ** argv)
|
||||
ConjugateGradient<FermionField> CG((stp),100000);
|
||||
|
||||
for(int rhs=0;rhs<1;rhs++){
|
||||
result[rhs] = zero;
|
||||
result[rhs] = Zero();
|
||||
// CG(HermOp,src[rhs],result[rhs]);
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ int main (int argc, char ** argv)
|
||||
/////////////////////////////////////////////////////////////
|
||||
int blockDim = 0;//not used for BlockCGVec
|
||||
for(int s=0;s<nrhs;s++){
|
||||
result[s]=zero;
|
||||
result[s]=Zero();
|
||||
}
|
||||
BlockConjugateGradient<FermionField> BCGV (BlockCGrQVec,blockDim,stp,100000);
|
||||
{
|
||||
|
@ -43,9 +43,9 @@ int main (int argc, char ** argv)
|
||||
|
||||
Grid_init(&argc,&argv);
|
||||
|
||||
std::vector<int> latt_size = GridDefaultLatt();
|
||||
std::vector<int> simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd());
|
||||
std::vector<int> mpi_layout = GridDefaultMpi();
|
||||
auto latt_size = GridDefaultLatt();
|
||||
auto simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd());
|
||||
auto mpi_layout = GridDefaultMpi();
|
||||
|
||||
std::vector<ComplexD> boundary_phases(Nd,1.);
|
||||
boundary_phases[Nd-1]=-1.;
|
||||
@ -72,7 +72,7 @@ int main (int argc, char ** argv)
|
||||
FermionField tmp(FGrid);
|
||||
std::cout << GridLogMessage << "Made the Fermion Fields"<<std::endl;
|
||||
|
||||
for(int s=0;s<nrhs;s++) result[s]=zero;
|
||||
for(int s=0;s<nrhs;s++) result[s]=Zero();
|
||||
GridParallelRNG pRNG5(FGrid); pRNG5.SeedFixedIntegers(seeds);
|
||||
for(int s=0;s<nrhs;s++) {
|
||||
random(pRNG5,src[s]);
|
||||
@ -116,7 +116,7 @@ int main (int argc, char ** argv)
|
||||
ConjugateGradient<FermionField> CG((stp),100000);
|
||||
|
||||
for(int rhs=0;rhs<1;rhs++){
|
||||
result[rhs] = zero;
|
||||
result[rhs] = Zero();
|
||||
CG(HermOp,src[rhs],result[rhs]);
|
||||
}
|
||||
|
||||
@ -129,7 +129,7 @@ int main (int argc, char ** argv)
|
||||
/////////////////////////////////////////////////////////////
|
||||
int blockDim = 0;//not used for BlockCGVec
|
||||
for(int s=0;s<nrhs;s++){
|
||||
result[s]=zero;
|
||||
result[s]=Zero();
|
||||
}
|
||||
|
||||
|
||||
|
@ -72,7 +72,7 @@ int main (int argc, char ** argv)
|
||||
#if 1
|
||||
random(pRNG5,src);
|
||||
#else
|
||||
src=zero;
|
||||
src=Zero();
|
||||
ComplexField coor(FGrid);
|
||||
LatticeCoordinate(coor,0);
|
||||
for(int ss=0;ss<FGrid->oSites();ss++){
|
||||
@ -196,7 +196,7 @@ int main (int argc, char ** argv)
|
||||
std::cout << GridLogMessage << " Calling Block CG for "<<Ls <<" right hand sides" <<std::endl;
|
||||
std::cout << GridLogMessage << "************************************************************************ "<<std::endl;
|
||||
Ds.ZeroCounters();
|
||||
result_o=zero;
|
||||
result_o=Zero();
|
||||
{
|
||||
double t1=usecond();
|
||||
BCG(HermOp,src_o,result_o);
|
||||
@ -216,7 +216,7 @@ int main (int argc, char ** argv)
|
||||
std::cout << GridLogMessage << "****************************************************************** "<<std::endl;
|
||||
std::vector<FermionField> src_v (Ls,UrbGrid);
|
||||
std::vector<FermionField> result_v(Ls,UrbGrid);
|
||||
for(int s=0;s<Ls;s++) result_v[s] = zero;
|
||||
for(int s=0;s<Ls;s++) result_v[s] = Zero();
|
||||
for(int s=0;s<Ls;s++) {
|
||||
FermionField src4(UGrid);
|
||||
ExtractSlice(src4,src,s,0);
|
||||
|
@ -31,7 +31,6 @@ Author: Peter Boyle <paboyle@ph.ed.ac.uk>
|
||||
|
||||
using namespace std;
|
||||
using namespace Grid;
|
||||
using namespace Grid::QCD;
|
||||
|
||||
template<class d>
|
||||
struct scal {
|
||||
@ -52,9 +51,9 @@ int main (int argc, char ** argv)
|
||||
|
||||
Grid_init(&argc,&argv);
|
||||
|
||||
std::vector<int> latt_size = GridDefaultLatt();
|
||||
std::vector<int> simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd());
|
||||
std::vector<int> mpi_layout = GridDefaultMpi();
|
||||
auto latt_size = GridDefaultLatt();
|
||||
auto simd_layout = GridDefaultSimd(Nd,vComplex::Nsimd());
|
||||
auto mpi_layout = GridDefaultMpi();
|
||||
|
||||
GridCartesian Grid(latt_size,simd_layout,mpi_layout);
|
||||
GridRedBlackCartesian RBGrid(&Grid);
|
||||
|
Reference in New Issue
Block a user