mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-13 20:57:06 +01:00
Rework of RNG to use C++11 random. Should work correctly maintaining parallel RNG across
a machine. If a "fixedSeed" is used, randoms should be reproducible across different machine decomposition since the generators are physically indexed and assigned in lexico ordering.
This commit is contained in:
@ -57,7 +57,8 @@ int main (int argc, char ** argv)
|
||||
|
||||
GridCartesian Fine(latt_size,simd_layout,mpi_layout);
|
||||
GridRedBlackCartesian rbFine(latt_size,simd_layout,mpi_layout);
|
||||
|
||||
GridRNG FineRNG(&Fine);
|
||||
|
||||
LatticeColourMatrix Foo(&Fine);
|
||||
LatticeColourMatrix Bar(&Fine);
|
||||
|
||||
@ -91,17 +92,17 @@ int main (int argc, char ** argv)
|
||||
iSpinMatrix<vComplex> iGammaFive;
|
||||
ColourMatrix cmat;
|
||||
|
||||
random(Foo);
|
||||
gaussian(Bar);
|
||||
random(scFoo);
|
||||
random(scBar);
|
||||
random(FineRNG,Foo);
|
||||
gaussian(FineRNG,Bar);
|
||||
random(FineRNG,scFoo);
|
||||
random(FineRNG,scBar);
|
||||
|
||||
random(cMat);
|
||||
random(sMat);
|
||||
random(scMat);
|
||||
random(cVec);
|
||||
random(sVec);
|
||||
random(scVec);
|
||||
random(FineRNG,cMat);
|
||||
random(FineRNG,sMat);
|
||||
random(FineRNG,scMat);
|
||||
random(FineRNG,cVec);
|
||||
random(FineRNG,sVec);
|
||||
random(FineRNG,scVec);
|
||||
|
||||
fflush(stdout);
|
||||
cVec = cMat * cVec; // LatticeColourVector = LatticeColourMatrix * LatticeColourVector
|
||||
@ -277,7 +278,7 @@ int main (int argc, char ** argv)
|
||||
peekSite(bar,Bar,coor);
|
||||
for(int r=0;r<3;r++){
|
||||
for(int c=0;c<3;c++){
|
||||
cout<<"bar "<<coor[0]<<coor[1]<<coor[2]<<coor[3] <<" "<<bar()()(r,c)<<std::endl;
|
||||
// cout<<"bar "<<coor[0]<<coor[1]<<coor[2]<<coor[3] <<" "<<bar()()(r,c)<<std::endl;
|
||||
}}
|
||||
}}}}
|
||||
}
|
||||
|
@ -48,14 +48,15 @@ int main (int argc, char ** argv)
|
||||
|
||||
GridCartesian Fine(latt_size,simd_layout,mpi_layout);
|
||||
GridRedBlackCartesian rbFine(latt_size,simd_layout,mpi_layout);
|
||||
|
||||
GridRNG fRNG(&Fine);
|
||||
|
||||
LatticeColourMatrix Foo(&Fine);
|
||||
LatticeColourMatrix Bar(&Fine);
|
||||
LatticeColourMatrix Check(&Fine);
|
||||
LatticeColourMatrix Diff(&Fine);
|
||||
|
||||
random(Foo);
|
||||
gaussian(Bar);
|
||||
random(fRNG,Foo);
|
||||
gaussian(fRNG,Bar);
|
||||
|
||||
|
||||
for(int dir=0;dir<4;dir++){
|
||||
|
Reference in New Issue
Block a user