mirror of
				https://github.com/paboyle/Grid.git
				synced 2025-11-02 21:14:32 +00:00 
			
		
		
		
	Debug in progress
This commit is contained in:
		@@ -757,7 +757,74 @@ void precisionChange(Lattice<VobjOut> &out, const Lattice<VobjIn> &in){
 | 
			
		||||
// NB: Easiest to programme if keep in lex order.
 | 
			
		||||
//
 | 
			
		||||
/////////////////////////////////////////////////////////
 | 
			
		||||
/*
 | 
			
		||||
 | 
			
		||||
[0,0,0,0,0]	S {V<4>{V<3>{(0,0),(0,0),(0,0)},V<3>{(0,0),(0,0),(0,0)},V<3>{(0,0),(0,0),(0,0)},V<3>{(0,0),(0,0),(0,0)}}}
 | 
			
		||||
[0,0,0,0,1]	S {V<4>{V<3>{(1,0),(1,0),(1,0)},V<3>{(1,0),(1,0),(1,0)},V<3>{(1,0),(1,0),(1,0)},V<3>{(1,0),(1,0),(1,0)}}}
 | 
			
		||||
[0,0,0,0,2]	S {V<4>{V<3>{(4,0),(4,0),(4,0)},V<3>{(4,0),(4,0),(4,0)},V<3>{(4,0),(4,0),(4,0)},V<3>{(4,0),(4,0),(4,0)}}}
 | 
			
		||||
[0,0,0,0,3]	S {V<4>{V<3>{(5,0),(5,0),(5,0)},V<3>{(5,0),(5,0),(5,0)},V<3>{(5,0),(5,0),(5,0)},V<3>{(5,0),(5,0),(5,0)}}}
 | 
			
		||||
[0,0,0,0,4]	S {V<4>{V<3>{(2,0),(2,0),(2,0)},V<3>{(2,0),(2,0),(2,0)},V<3>{(2,0),(2,0),(2,0)},V<3>{(2,0),(2,0),(2,0)}}}
 | 
			
		||||
[0,0,0,0,5]	S {V<4>{V<3>{(3,0),(3,0),(3,0)},V<3>{(3,0),(3,0),(3,0)},V<3>{(3,0),(3,0),(3,0)},V<3>{(3,0),(3,0),(3,0)}}}
 | 
			
		||||
[0,0,0,0,6]	S {V<4>{V<3>{(6,0),(6,0),(6,0)},V<3>{(6,0),(6,0),(6,0)},V<3>{(6,0),(6,0),(6,0)},V<3>{(6,0),(6,0),(6,0)}}}
 | 
			
		||||
[0,0,0,0,7]	S {V<4>{V<3>{(7,0),(7,0),(7,0)},V<3>{(7,0),(7,0),(7,0)},V<3>{(7,0),(7,0),(7,0)},V<3>{(7,0),(7,0),(7,0)}}}
 | 
			
		||||
[0,0,0,0,8]	S {V<4>{V<3>{(8,0),(8,0),(8,0)},V<3>{(8,0),(8,0),(8,0)},V<3>{(8,0),(8,0),(8,0)},V<3>{(8,0),(8,0),(8,0)}}}
 | 
			
		||||
[0,0,0,0,9]	S {V<4>{V<3>{(9,0),(9,0),(9,0)},V<3>{(9,0),(9,0),(9,0)},V<3>{(9,0),(9,0),(9,0)},V<3>{(9,0),(9,0),(9,0)}}}
 | 
			
		||||
[0,0,0,0,10]	S {V<4>{V<3>{(12,0),(12,0),(12,0)},V<3>{(12,0),(12,0),(12,0)},V<3>{(12,0),(12,0),(12,0)},V<3>{(12,0),(12,0),(12,0)}}}
 | 
			
		||||
[0,0,0,0,11]	S {V<4>{V<3>{(13,0),(13,0),(13,0)},V<3>{(13,0),(13,0),(13,0)},V<3>{(13,0),(13,0),(13,0)},V<3>{(13,0),(13,0),(13,0)}}}
 | 
			
		||||
[0,0,0,0,12]	S {V<4>{V<3>{(10,0),(10,0),(10,0)},V<3>{(10,0),(10,0),(10,0)},V<3>{(10,0),(10,0),(10,0)},V<3>{(10,0),(10,0),(10,0)}}}
 | 
			
		||||
[0,0,0,0,13]	S {V<4>{V<3>{(11,0),(11,0),(11,0)},V<3>{(11,0),(11,0),(11,0)},V<3>{(11,0),(11,0),(11,0)},V<3>{(11,0),(11,0),(11,0)}}}
 | 
			
		||||
[0,0,0,0,14]	S {V<4>{V<3>{(14,0),(14,0),(14,0)},V<3>{(14,0),(14,0),(14,0)},V<3>{(14,0),(14,0),(14,0)},V<3>{(14,0),(14,0),(14,0)}}}
 | 
			
		||||
[0,0,0,0,15]	S {V<4>{V<3>{(15,0),(15,0),(15,0)},V<3>{(15,0),(15,0),(15,0)},V<3>{(15,0),(15,0),(15,0)},V<3>{(15,0),(15,0),(15,0)}}}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Process decomp
 | 
			
		||||
[A(0 1) A(2 3) B(0 1) B(2 3)] [ A(4 5) A(6 7) B(4 5) B(6 7)] [ A(8 9) A(10 11) B(8 9) B(10 11)] [A(12 13) A(14 15) B(12 13) B(14 15)]
 | 
			
		||||
 | 
			
		||||
A2A(Full)
 | 
			
		||||
 -- divides M*fL into fP segments of size M*fL/fP = fL/sP
 | 
			
		||||
 -- total is fP * fL/sP = M * fL
 | 
			
		||||
 A(0 1) A(4 5)  A(8 9)   A(12 13)   
 | 
			
		||||
 A(2 3) A(6 7)  A(10 11) A(14 15) 
 | 
			
		||||
 B(0 1) B(4 5)  B(8 9)   B(12 13) 
 | 
			
		||||
 B(2 3) B(6 7)  B(10 11) B(14 15)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
A2A(Split)    
 | 
			
		||||
 A(0 1)   A(4 5)   A(2 3)   A(6 7) 
 | 
			
		||||
 A(8 9)   A(12 13) A(10 11) A(14 15) 
 | 
			
		||||
 B(0 1)   B(2 3)   B(4 5)   B(6 7) 
 | 
			
		||||
 B(8 9)   B(10 11) B(12 13) B(14 15) 
 | 
			
		||||
 | 
			
		||||
--------------------
 | 
			
		||||
--  General case 
 | 
			
		||||
--------------------
 | 
			
		||||
G global lattice
 | 
			
		||||
fP - procs 
 | 
			
		||||
sP - Procs in split grid
 | 
			
		||||
M  - subdivisions/vectors   - M*sP = fP      ** constraint 1
 | 
			
		||||
fL = G/fP  per node (full)
 | 
			
		||||
sL = G/sP  per node split
 | 
			
		||||
 | 
			
		||||
[ G * M ] total = G*fP/sP.
 | 
			
		||||
[ Subdivide fL*M by fP => fL *M / fP = fL/fP *fP/sP = fL/sP ]
 | 
			
		||||
--------------------
 | 
			
		||||
--  1st A2A chunk is fL*M/fP = G/fP *fP/sP /fP = fL/sP
 | 
			
		||||
--  Let cL = fL/sP chunk.         ( Divide into fP/sP = M chunks )
 | 
			
		||||
 | 
			
		||||
--    node 0     1st cL of node 0,1,... fP-1  ; vector 0
 | 
			
		||||
--    node 1     2nd cL of node 0,1,... fP-1   
 | 
			
		||||
--    node 2     3nd cL of node 0,1,... fP-1
 | 
			
		||||
--    node 3     4th cL of node 0,1,... fP-1
 | 
			
		||||
... when node > sP get vector 1 etc... 
 | 
			
		||||
 | 
			
		||||
-- 2nd A2A (over sP nodes; subdivide the fP into sP chunks of M)
 | 
			
		||||
--    node 0     1st cL of node 0M..(1M-1); 2nd cL of node 0M..(1M-1))..
 | 
			
		||||
--    node 1     1st cL of node 1M..(2M-1); 2nd cL of node 1M..(2M-1)..
 | 
			
		||||
--    node 2     1st cL of node 2M..(3M-1); 2nd cL of node 2M..(3M-1)..
 | 
			
		||||
--    node 3     1st cL of node 3M..(3M-1); 2nd cL of node 2M..(3M-1)..
 | 
			
		||||
--
 | 
			
		||||
-- Insert correctly
 | 
			
		||||
 */
 | 
			
		||||
template<class Vobj>
 | 
			
		||||
void Grid_split(std::vector<Lattice<Vobj> > & full,Lattice<Vobj>   & split)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user