Difference between revisions of "Horizontal"

From Mesham
Jump to navigationJump to search
m
m (11 revisions imported)
 
(5 intermediate revisions by the same user not shown)
Line 13: Line 13:
 
== Communication ==
 
== Communication ==
  
There are a number of different default communication rules associated with the horizontal partition, based on the assignment ''assigned variable:=assigning variable'' which are detailed below.
+
{{OneDimPartitionCommunication}}
  
{| border="1" cellspacing="0" cellpadding="5" align="center"
+
== Dot operators ==
! Assigned Variable
 
! Assigning Variable
 
! Semantics
 
|-
 
| single
 
| partition
 
| Gather
 
|-
 
| partition
 
| single
 
| Scatter
 
|-
 
| partition
 
| partition
 
| Local copy
 
|}
 
As in the last row of the table , if the two partitions are the same type then a simple copy is performed. However, if they are different then an error will be generated as Mesham disallows differently typed partitions to be assigned to each other.
 
  
Horizontal blocks also support ''.high'' and ''.low'', which will return the top and bottom bounds of the block
+
Horizontal blocks also support a variety of dot operators to provide meta data
  
 +
{{OneDimPartitionDotOperators}}
 +
 +
''Since: Version 0.41b''
  
 
[[Category:Type Library]]
 
[[Category:Type Library]]
 
[[Category:Compound Types]]
 
[[Category:Compound Types]]
 
[[Category:Partition Types]]
 
[[Category:Partition Types]]

Latest revision as of 15:44, 15 April 2019

Syntax

horizontal[blocks]

Where blocks is number of blocks to partition into.

Semantics

This type will split up data horizontally into a number of blocks. If the split is uneven then the extra data will be distributed amongst the blocks in the most efficient way in order to keep the blocks a similar size. The figure below illustrates horizontally partioning an array into three blocks.

Horizontal Partition of an array into three blocks via type oriented programming

Communication

There are a number of different default communication rules associated with the one dimensional partitions, based on the assignment assigned variable:=assigning variable which are detailed below.

Assigned Variable Assigning Variable Semantics
single partition Gather
partition single Scatter
partition partition Local copy

As in the last row of the table , if the two partitions are the same type then a simple copy is performed. However, if they are different then an error will be generated as Mesham disallows differently typed partitions to be assigned to each other.

The programmer can also read and write to each element in the partitioned data directly. Either the global coordinates or the block ID its local coordinates can be supplied. This will deduce whether or not the block is on another process, issue any communication as required and complete in that single assignment or access. Because this completes in that expression rather than waiting for a synchronisation, non local data movement is potentially an expensive operation.

Dot operators

Horizontal blocks also support a variety of dot operators to provide meta data

Dot operation Semantics
high Largest global coordinate wrt a block in specific block dimension
low Smallest global coordinate wrt a block in specific block dimension
top Largest global coordinate in specific block dimension
localblocks Number of blocks held on local process
localblockid[i] Id number of ith local block

Since: Version 0.41b