From 1271508ca26198a39d441e275d5b393ee272483f Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Wed, 4 Nov 2015 09:57:57 +0000 Subject: [PATCH] Bug fix for spread out in x (EO) direction. This is really annoying -- it is very hard to thread the loops with the index recursion on buffer offset in the red-black case. Must think of a good threading solution here. --- lib/cshift/Cshift_common.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/cshift/Cshift_common.h b/lib/cshift/Cshift_common.h index 822e02c9..83508ca3 100644 --- a/lib/cshift/Cshift_common.h +++ b/lib/cshift/Cshift_common.h @@ -29,14 +29,15 @@ Gather_plane_simple (const Lattice &rhs,std::vector_slice_nblock[dimension]; int e2=rhs._grid->_slice_block[dimension]; -PARALLEL_NESTED_LOOP2 + int bo=0; + //PARALLEL_NESTED_LOOP21 for(int n=0;n_slice_stride[dimension]; - int bo = n*rhs._grid->_slice_block[dimension]; + // int bo = n*rhs._grid->_slice_block[dimension]; int ocb=1<CheckerBoardFromOindex(o+b);// Could easily be a table lookup if ( ocb &cbmask ) { - buffer[bo+b]=compress(rhs._odata[so+o+b],dimension,plane,so+o+b,rhs._grid); + buffer[bo++]=compress(rhs._odata[so+o+b],dimension,plane,so+o+b,rhs._grid); } } } @@ -59,7 +60,7 @@ Gather_plane_extract(const Lattice &rhs,std::vector_slice_nblock[dimension]; int e2=rhs._grid->_slice_block[dimension]; -PARALLEL_NESTED_LOOP2 + //PARALLEL_NESTED_LOOP2 for(int n=0;n void Scatter_plane_simple (Lattice &rhs,std::vector_slice_nblock[dimension]; int e2=rhs._grid->_slice_block[dimension]; -PARALLEL_NESTED_LOOP2 + int bo=0; + //PARALLEL_NESTED_LOOP2 for(int n=0;n_slice_stride[dimension]; - int bo =n*rhs._grid->_slice_block[dimension]; + // int bo =n*rhs._grid->_slice_block[dimension]; int ocb=1<CheckerBoardFromOindex(o+b);// Could easily be a table lookup if ( ocb & cbmask ) { - rhs._odata[so+o+b]=buffer[bo+b]; + rhs._odata[so+o+b]=buffer[bo++]; } } }