Horizontal

From Mesham
Revision as of 21:16, 10 January 2010 by Polas (talk | contribs) (Semantics)
Jump to navigationJump to search

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.

Horiz.jpg

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