diff --git a/TODO b/TODO index 3f89f576..bdf9b20c 100644 --- a/TODO +++ b/TODO @@ -17,6 +17,8 @@ Policies: - Lanczos +- Audit oIndex usage for cb behaviour + - Rectangle gauge actions. Iwasaki, Symanzik, diff --git a/lib/cartesian/Cartesian_base.h b/lib/cartesian/Cartesian_base.h index 6303e38e..3b9f6630 100644 --- a/lib/cartesian/Cartesian_base.h +++ b/lib/cartesian/Cartesian_base.h @@ -166,8 +166,9 @@ public: pcoor.resize(_ndimension); lcoor.resize(_ndimension); for(int mu=0;mu<_ndimension;mu++){ - pcoor[mu] = gcoor[mu]/_ldimensions[mu]; - lcoor[mu] = gcoor[mu]%_ldimensions[mu]; + int _fld = _fdimensions[mu]/_processors[mu]; + pcoor[mu] = gcoor[mu]/_fld; + lcoor[mu] = gcoor[mu]%_fld; } } void GlobalCoorToRankIndex(int &rank, int &o_idx, int &i_idx ,const std::vector &gcoor) @@ -176,8 +177,16 @@ public: std::vector lcoor; GlobalCoorToProcessorCoorLocalCoor(pcoor,lcoor,gcoor); rank = RankFromProcessorCoor(pcoor); - i_idx= iIndex(lcoor); - o_idx= oIndex(lcoor); + + std::vector cblcoor(lcoor); + for(int d=0;dCheckerBoarded(d) ) { + cblcoor[d] = lcoor[d]/2; + } + } + + i_idx= iIndex(cblcoor);// this does not imply divide by 2 on checker dim + o_idx= oIndex(lcoor);// this implies divide by 2 on checkerdim } void RankIndexToGlobalCoor(int rank, int o_idx, int i_idx , std::vector &gcoor) diff --git a/tests/Test_cshift_red_black.cc b/tests/Test_cshift_red_black.cc index 88355e47..ed19a36a 100644 --- a/tests/Test_cshift_red_black.cc +++ b/tests/Test_cshift_red_black.cc @@ -53,6 +53,7 @@ int main (int argc, char ** argv) TComplex cm; + TComplex cmeo; for(int dir=0;dir scoor(coor); scoor[dir] = (scoor[dir]+shift)%latt_size[dir]; @@ -136,13 +147,29 @@ int main (int argc, char ** argv) + latt_size[0]*latt_size[1]*latt_size[2]*scoor[3]; Complex scm(slex); - - nrm = abs(scm-cm()()()); + std::vector peer(4); - Complex ctmp=cm; + Complex ctmp=cmeo; Integer index=real(ctmp); Fine.CoorFromIndex(peer,index,latt_size); + double nrm = abs(cmeo()()()-scm); + if (nrm != 0) { + std::cout<<"EOFAIL shift "<< shift<<" in dir "<< dir + <<" ["< 0){ std::cout<<"FAIL shift "<< shift<<" in dir "<< dir <<" ["<