#######################################################################################
#
#  EXHAUSTIVE DistGrid Specifier for 3D to 3D redistribution
#
#######################################################################################
#
#
#                       Block Decomposition Specifier File
# This resource file specifies the block or block-cyclic memory distribution of memory in 
# terms of either fixed values or as a function of the total number of PETs. This functionality
# allows automatic scaling of the distribution space as a function of the machine resources.
#
# For all tests, both a source and destination decomposition is required. The specification 
# syntax consists of a collection of entries which specify a pair of distributions in terms 
# of either absolute distribution sizes, or relative sizes in terms of the total number of PETs.
# Entries:
# 1. descriptive string (enclosed by quote marks ')
# 2. tag indicating source specifiers  (enclosed by quote marks ')
# 3. rank of the source distribution (integer)
# 4. source specifiers for each dimension of the distribution  (operators enclosed by quote 
#    marks ', and values are real numbers)
# 5. tag indicating destination specifiers  (enclosed by quote marks ')
# 6. rank of the destination distribution (integer)
# 7. destination specifiers for each dimension of the distribution  (operators enclosed by 
#    quote marks ', and values are real numbers)
# 8. end tag  (enclosed by quote marks ')
#
# Specifier Syntax:
# - to set the distribution dimension to a set value: ==
# - to set the distribution dimension to a scalar multiple of the base dimension size: =*
# - to set the distribution dimension to a value plus a constant: =+
# Note: The product of all the base dimension sizes is equal to NPETS.
#
# Examples:
# A. 2x3 distribution redistributed to a 3x2 distribution
#    '(2,3)-->(3,2)'  'SRC' 2  'D1==' 2  'D2==' 3  'DST' 2  'D1==' 3  'D2==' 2  'END'  
# B. 1xNPETS distribution redistributed to a 2*sqrt(NPETS) X (1/2)*sqrt(NPETS) distribution 
#    '(1,n)-->(2*m,m/2)'  'SRC' 2  'D1==' 1  'D2=*' 1  'DST' 2  'D1=*' 2  'D2=*' 0.5  'END'  
# C. 1x2*NPETS distribution redistributed to a 2*sqrt(NPETS)-1 X (1/2)*sqrt(NPETS) distribution 
#    '(1,2*n)-->((2*m)-1,m/2)' 'SRC' 2 'D1==' 1 'D2=*' 2 'DST' 2 'D1=*' 2 'D1=+' -1 'D2=*' 0.5 'END'  
# D. 1xNPETS distribution redistributed to a 2*sqrt(NPETS) X (1/2)*sqrt(NPETS) distribution 
#    '(1,n)-->(2*(m-1),m/2)' 'SRC' 2 'D1==' 1 'D2=*' 1 'DST' 2 'D1=+'-1 'D1=*' 2 'D2=*' 0.5 'END'  
#  NOTE: the order of the operators is important

##################################################
# descriptive | source | source | operator | destination | dest | operator | end
# string      |  tag   |  rank  |  & value |     tag     | rank | & value  | tag
##################################################

# table specifing 2D to 2D distributions
distgrid_block_3d3d::

# fixed distribution sizes
 '(1,1,1)-->(1,1,1)'  'SRC'  3  'D1==' 1  'D2==' 1  'D3==' 1  'DST'  3  'D1==' 1  'D2==' 1  'D3==' 1  'END'  

# 1x1x1 to 1D distribution (DEs = PETS)
 '(1,1,1)-->(1,1,n)'  'SRC'  3  'D1==' 1  'D2==' 1  'D3==' 1  'DST'  3  'D1==' 1  'D2==' 1  'D3=*' 1  'END'  

# 1x1x1 to 1D distribution (DEs = PETS)
 '(1,1,1)-->(1,n,1)'  'SRC'  3  'D1==' 1  'D2==' 1  'D3==' 1  'DST'  3  'D1==' 1  'D2=*' 1  'D3==' 1  'END'  

# 1x1x1 to 1D distribution (DEs = PETS)
 '(1,1,1)-->(n,1,1)'  'SRC'  3  'D1==' 1  'D2==' 1  'D3==' 1  'DST'  3  'D1=*' 1  'D2==' 1  'D3==' 1  'END'  

# 1x1x1 to 1D distribution (DEs > PETS)
 '(1,1,1)-->(1,1,2*n)'  'SRC'  3  'D1==' 1  'D2==' 1  'D3==' 1  'DST'  3  'D1==' 1  'D2==' 1  'D3=*' 2  'END'  

# 1x1x1 to 1D distribution (DEs > PETS)
 '(1,1,1)-->(1,2*n,1)'  'SRC'  3  'D1==' 1  'D2==' 1  'D3==' 1  'DST'  3  'D1==' 1  'D2=*' 2  'D3==' 1  'END'  

# 1x1x1 to 1D distribution (DEs > PETS)
 '(1,1,1)-->(2*n,1,1)'  'SRC'  3  'D1==' 1  'D2==' 1  'D3==' 1  'DST'  3  'D1=*' 2  'D2==' 1  'D3==' 1  'END'  

# 1x1x1 to 1D distribution (DEs < PETS)
 '(1,1,1)-->(1,1,n/2)' 'SRC'  3  'D1==' 1  'D2==' 1  'D3==' 1  'DST'  3  'D1==' 1  'D2==' 1  'D3=*' 0.5  'END'  

# 1x1x1 to 1D distribution (DEs < PETS)
 '(1,1,1)-->(1,n/2,1)' 'SRC'  3  'D1==' 1  'D2==' 1  'D3==' 1  'DST'  3  'D1==' 1  'D2=*' 0.5  'D3==' 1  'END'  

# 1x1x1 to 1D distribution (DEs < PETS)
 '(1,1,1)-->(n/2,1,1)' 'SRC'  3  'D1==' 1  'D2==' 1  'D3==' 1  'DST'  3  'D1=*' 0.5  'D2==' 1  'D3==' 1  'END'  

# 1x1x1 to 2D distribution (DEs = PETS)
 '(1,1,1)-->(2*n,1,n/2)' 'SRC'  3  'D1==' 1  'D2==' 1  'D3==' 1  'DST'  3  'D1=*' 2  'D2==' 1  'D3=*' 0.5  'END'

# 1x1x1 to 2D distribution (DEs = PETS)
 '(1,1,1)-->(2*n,n/2,1)' 'SRC'  3  'D1==' 1  'D2==' 1  'D3==' 1  'DST'  3  'D1=*' 2  'D2=*' 0.5  'D3==' 1  'END'

# 1x1x1 to 2D distribution (DEs = PETS)
 '(1,1,1)-->(n/2,2*n,1)' 'SRC'  3  'D1==' 1  'D2==' 1  'D3==' 1  'DST'  3  'D1=*' 0.5  'D2=*' 2  'D3==' 1  'END'

# 1x1x1 to 2D distribution (DEs = PETS)
 '(1,1,1)-->(1,2*n,n/2)' 'SRC'  3  'D1==' 1  'D2==' 1  'D3==' 1  'DST'  3  'D1==' 1  'D2=*' 2  'D3=*' 0.5  'END'

# 1x1x1 to 2D distribution (DEs = PETS)
 '(1,1,1)-->(n/2,1,2*n)' 'SRC'  3  'D1==' 1  'D2==' 1  'D3==' 1  'DST'  3  'D1=*' 0.5  'D2==' 1  'D3=*' 2  'END'

# 1x1x1 to 2D distribution (DEs = PETS)
 '(1,1,1)-->(1,n/2,2*n)' 'SRC'  3  'D1==' 1  'D2==' 1  'D3==' 1  'DST'  3  'D1==' 1  'D2=*' 0.5  'D3=*' 2  'END'

# 1x1x1 to 3D distribution (DEs = PETS)
 '(1,1,1)-->(n,n,n)' 'SRC'  3  'D1==' 1  'D2==' 1  'D3==' 1  'DST'  3  'D1=*' 1  'D2=*' 1  'D3=*' 1  'END'

# 1x1x1 to 3D distribution (DEs = PETS)
 '(1,1,1)-->(n/2,n,2*n)' 'SRC' 3  'D1==' 1  'D2==' 1  'D3==' 1  'DST' 3  'D1=*' 0.5  'D2=*' 1  'D3=*' 2 'END'

# 1x1x1 to 3D distribution (DEs > PETS)
 '(1,1,1)-->(2*n,n,2*n)' 'SRC' 3  'D1==' 1  'D2==' 1  'D3==' 1  'DST' 3  'D1=*' 2  'D2=*' 1  'D3=*' 2 'END'

# 3D to 3D distribution (DEs = PETS)
 '(n,n,n)-->(n,n,n)' 'SRC'  3  'D1=*' 1  'D2=*' 1  'D3=*' 1  'DST'  3  'D1=*' 1  'D2=*' 1  'D3=*' 1  'END'

# 3D to 3D distribution (DEs < PETS)
 '(n,n,n)-->(n,n,n-1)' 'SRC'  3  'D1=*' 1  'D2=*' 1  'D3=*' 1  
                 &     'DST'  3  'D1=*' 1  'D2=*' 1  'D3=*' 1 'D3=+' -1  'END'

# 3D to 3D distribution (DEs < PETS)
 '(n,n,n)-->(n,n-1,n)' 'SRC'  3  'D1=*' 1  'D2=*' 1  'D3=*' 1  
                 &     'DST'  3  'D1=*' 1  'D2=*' 1 'D2=+' -1  'D3=*' 1  'END'

# 3D to 3D distribution (DEs < PETS)
 '(n,n,n)-->(n-1,n,n)' 'SRC'  3  'D1=*' 1  'D2=*'  1  'D3=*' 1  
                 &     'DST'  3  'D1=*' 1  'D1=+' -1  'D2=*' 1 'D3=*' 1  'END'

# 3D to 2D distribution (DEs = PETS)
 '(n,n,n)-->(m/2,1,2m)' 'SRC'  3  'D1=*' 1  'D2=*' 1  'D3=*' 1  'DST'  3  'D1=*' 0.5  'D2==' 1  'D3=*' 2  'END'

# 3D to 2D distribution (DEs > PETS)
 '(n,n,n)-->(2m,1,2m)' 'SRC'  3  'D1=*' 1  'D2=*' 1  'D3=*' 1  'DST'  3  'D1=*' 2  'D2==' 1  'D3=*' 2  'END'

# 3D to 2D distribution (DEs = PETS)
 '(n,n,n)-->(m/2,2m,1)' 'SRC'  3  'D1=*' 1  'D2=*' 1  'D3=*' 1  'DST'  3  'D1=*' 0.5  'D2=*' 2  'D3==' 1  'END'

# 3D to 2D distribution (DEs > PETS)
 '(n,n,n)-->(2m,2m,1)' 'SRC'  3  'D1=*' 1  'D2=*' 1  'D3=*' 1  'DST'  3  'D1=*' 2  'D2=*' 2  'D3==' 1  'END'

# 3D to 2D distribution (DEs = PETS)
 '(n,n,n)-->(1,m/2,2m)' 'SRC'  3  'D1=*' 1  'D2=*' 1  'D3=*' 1  'DST'  3  'D1==' 1  'D2=*' 0.5  'D3=*' 2  'END'

# 3D to 2D distribution (DEs > PETS)
 '(n,n,n)-->(1,2m,2m)' 'SRC'  3  'D1=*' 1  'D2=*' 1  'D3=*' 1  'DST'  3  'D1==' 1  'D2=*' 2  'D3=*' 2  'END'

::

