mirror of
https://github.com/paboyle/Grid.git
synced 2025-06-16 14:57:05 +01:00
Domain wall even-odd 2f HMC with wilson gauge and PV 2f ratio now running and giving small dH.
Azusa is working hard on the rectangle term and we'll hopefully start reproducing plaquettes from RBC-UKQCD parameters soon ! My new laptop is pretty warm and is starting to groan ;)
This commit is contained in:
@ -5,6 +5,37 @@
|
||||
|
||||
namespace Grid {
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
// Allow the RNG state to be less dense than the fine grid
|
||||
//////////////////////////////////////////////////////////////
|
||||
inline int RNGfillable(GridBase *coarse,GridBase *fine)
|
||||
{
|
||||
|
||||
int rngdims = coarse->_ndimension;
|
||||
|
||||
// trivially extended in higher dims, with locality guaranteeing RNG state is local to node
|
||||
int lowerdims = fine->_ndimension - coarse->_ndimension;
|
||||
assert(lowerdims >= 0);
|
||||
for(int d=0;d<lowerdims;d++){
|
||||
assert(fine->_simd_layout[d]==1);
|
||||
assert(fine->_processors[d]==1);
|
||||
}
|
||||
|
||||
// local and global volumes subdivide cleanly after SIMDization
|
||||
int multiplicity=1;
|
||||
for(int d=0;d<rngdims;d++){
|
||||
int fd= d+lowerdims;
|
||||
assert(coarse->_processors[d] == fine->_processors[fd]);
|
||||
assert(coarse->_simd_layout[d] == fine->_simd_layout[fd]);
|
||||
assert((fine->_rdimensions[fd] / coarse->_rdimensions[d])* coarse->_rdimensions[d]==fine->_rdimensions[fd]);
|
||||
|
||||
multiplicity = multiplicity *fine->_rdimensions[fd] / coarse->_rdimensions[d];
|
||||
}
|
||||
|
||||
return multiplicity;
|
||||
}
|
||||
|
||||
// Wrap seed_seq to give common interface with random_device
|
||||
class fixedSeed {
|
||||
public:
|
||||
@ -226,7 +257,7 @@ namespace Grid {
|
||||
typedef typename vobj::scalar_type scalar_type;
|
||||
typedef typename vobj::vector_type vector_type;
|
||||
|
||||
conformable(_grid,l._grid);
|
||||
int multiplicity = RNGfillable(_grid,l._grid);
|
||||
|
||||
int Nsimd =_grid->Nsimd();
|
||||
int osites=_grid->oSites();
|
||||
@ -236,17 +267,22 @@ namespace Grid {
|
||||
|
||||
PARALLEL_FOR_LOOP
|
||||
for(int ss=0;ss<osites;ss++){
|
||||
for(int si=0;si<Nsimd;si++){
|
||||
|
||||
int gdx = generator_idx(ss,si); // index of generator state
|
||||
scalar_type *pointer = (scalar_type *)&buf[si];
|
||||
for(int idx=0;idx<words;idx++){
|
||||
fillScalar(pointer[idx],dist,_generators[gdx]);
|
||||
for(int m=0;m<multiplicity;m++) {// Draw from same generator multiplicity times
|
||||
|
||||
int sm=multiplicity*ss+m; // Maps the generator site to the fine site
|
||||
|
||||
for(int si=0;si<Nsimd;si++){
|
||||
int gdx = generator_idx(ss,si); // index of generator state
|
||||
scalar_type *pointer = (scalar_type *)&buf[si];
|
||||
for(int idx=0;idx<words;idx++){
|
||||
fillScalar(pointer[idx],dist,_generators[gdx]);
|
||||
}
|
||||
}
|
||||
|
||||
// merge into SIMD lanes
|
||||
merge(l._odata[sm],buf);
|
||||
}
|
||||
// merge into SIMD lanes
|
||||
merge(l._odata[ss],buf);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -17,6 +17,7 @@ inline void subdivides(GridBase *coarse,GridBase *fine)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// remove and insert a half checkerboard
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -298,5 +299,42 @@ inline void blockPromote(const Lattice<iVector<CComplex,nbasis > > &coarseData,
|
||||
}
|
||||
|
||||
|
||||
template<class vobj>
|
||||
void Replicate(Lattice<vobj> &coarse,Lattice<vobj> & fine)
|
||||
{
|
||||
typedef typename vobj::scalar_object sobj;
|
||||
|
||||
GridBase *cg = coarse._grid;
|
||||
GridBase *fg = fine._grid;
|
||||
|
||||
int nd = cg->_ndimension;
|
||||
|
||||
subdivides(cg,fg);
|
||||
|
||||
assert(cg->_ndimension==fg->_ndimension);
|
||||
|
||||
std::vector<int> ratio(cg->_ndimension);
|
||||
|
||||
for(int d=0;d<cg->_ndimension;d++){
|
||||
ratio[d] = fg->_fdimensions[d]/cg->_fdimensions[d];
|
||||
}
|
||||
|
||||
std::vector<int> fcoor(nd);
|
||||
std::vector<int> ccoor(nd);
|
||||
for(int g=0;g<fg->gSites();g++){
|
||||
|
||||
fg->GlobalIndexToGlobalCoor(g,fcoor);
|
||||
for(int d=0;d<nd;d++){
|
||||
ccoor[d] = fcoor[d]%cg->_gdimensions[d];
|
||||
}
|
||||
|
||||
sobj tmp;
|
||||
peekSite(tmp,coarse,ccoor);
|
||||
pokeSite(tmp,fine,fcoor);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user