Difference between revisions of "Horizontal"

From Mesham
Jump to navigationJump to search
(Semantics)
m
Line 38: Line 38:
  
 
[[Category:Type Library]]
 
[[Category:Type Library]]
[[Category:Composite Types]]
+
[[Category:Compound Types]]
 
[[Category:Partition Types]]
 
[[Category:Partition Types]]

Revision as of 17:52, 12 January 2013

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 horizontal partition, 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.

Horizontal blocks also support .high and .low, which will return the top and bottom bounds of the block