1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-12-08 15:24:41 +00:00

Merge branch 'feature/hmc_generalise' into feature/scalar_adjointFT

This commit is contained in:
Guido Cossu
2017-04-05 14:50:28 +01:00
242 changed files with 28719 additions and 4002 deletions

View File

@@ -51,7 +51,7 @@ int main(int argc, char ** argv) {
GridRedBlackCartesian rbFine(latt_size,simd_layout,mpi_layout);
GridParallelRNG fRNG(&Fine);
// fRNG.SeedRandomDevice();
// fRNG.SeedFixedIntegers(std::vector<int>({45,12,81,9});
std::vector<int> seeds({1,2,3,4});
fRNG.SeedFixedIntegers(seeds);
@@ -65,7 +65,9 @@ int main(int argc, char ** argv) {
random(fRNG,Foo);
gaussian(fRNG,Bar);
/*
for (int i=0;i<simd_layout.size();i++){
std::cout <<" simd layout "<<i<<" = "<<simd_layout[i]<<std::endl;
}
Integer stride =1000;
{
double nrm;
@@ -78,7 +80,6 @@ int main(int argc, char ** argv) {
}
Foo=lex;
}
*/
typedef CartesianStencil<vobj,vobj> Stencil;
for(int dir=0;dir<4;dir++){
@@ -91,7 +92,6 @@ int main(int argc, char ** argv) {
std::vector<int> displacements(npoint,disp);
Stencil myStencil(&Fine,npoint,0,directions,displacements);
std::vector<int> ocoor(4);
for(int o=0;o<Fine.oSites();o++){
Fine.oCoorFromOindex(ocoor,o);
@@ -105,17 +105,20 @@ int main(int argc, char ** argv) {
// Implement a stencil code that should agree with cshift!
for(int i=0;i<Check._grid->oSites();i++){
int permute_type;
StencilEntry *SE;
SE = myStencil.GetEntry(permute_type,0,i);
if ( SE->_is_local && SE->_permute )
permute(Check._odata[i],Foo._odata[SE->_offset],permute_type);
else if (SE->_is_local)
Check._odata[i] = Foo._odata[SE->_offset];
else
else {
Check._odata[i] = myStencil.CommBuf()[SE->_offset];
// std::cout << " receive "<<i<<" " << Check._odata[i]<<std::endl;
// std::cout << " Foo "<<i<<" " << Foo._odata[i]<<std::endl;
}
}
Real nrmC = norm2(Check);
@@ -146,7 +149,12 @@ int main(int argc, char ** argv) {
}}}}
if (nrm > 1.0e-4) {
for(int i=0;i<Check._odata.size();i++){
std::cout << i<<" Check.odata "<<Check._odata[i]<< "\n"<<i<<" Bar.odata "<<Bar._odata[i]<<std::endl;
}
}
if (nrm > 1.0e-4) exit(-1);
}
}
@@ -181,9 +189,13 @@ int main(int argc, char ** argv) {
SimpleCompressor<vobj> compress;
<<<<<<< HEAD
EStencil.HaloExchange(EFoo,compress);
OStencil.HaloExchange(OFoo,compress);
=======
>>>>>>> feature/hmc_generalise
Bar = Cshift(Foo,dir,disp);
if ( disp & 0x1 ) {
@@ -195,6 +207,7 @@ int main(int argc, char ** argv) {
}
// Implement a stencil code that should agree with that darn cshift!
EStencil.HaloExchange(EFoo,compress);
for(int i=0;i<OCheck._grid->oSites();i++){
int permute_type;
StencilEntry *SE;
@@ -208,6 +221,7 @@ int main(int argc, char ** argv) {
else
OCheck._odata[i] = EStencil.CommBuf()[SE->_offset];
}
OStencil.HaloExchange(OFoo,compress);
for(int i=0;i<ECheck._grid->oSites();i++){
int permute_type;
StencilEntry *SE;
@@ -253,6 +267,7 @@ int main(int argc, char ** argv) {
}}}}
if (nrm > 1.0e-4) exit(-1);
}
}