Difference between revisions of "Arraydist"

From Mesham
Jump to navigationJump to search
(Created page with '== Syntax == arraydist[integer array] == Semantics == Will distribute data blocks amongst the processes dependant on the integer array supplied. The number of elements in this…')
 
m (1 revision imported)
 
(No difference)

Latest revision as of 15:45, 15 April 2019

Syntax

arraydist[integer array]

Semantics

Will distribute data blocks amongst the processes dependant on the integer array supplied. The number of elements in this array must equal the number of blocks. The index of each element corresponds to the block Id and the value at this location the process that it resides upon. For example, the value 5 at location 2 will place block number 2 onto process 5.

Example

function void main() {
   var d:array[Int,4];
   d[0]:=3;
   d[1]:=0;
   d[2]:=2;
   d[3]:=1;

   var a:array[Int,16,16] :: allocated[horizontal[4] :: single[arraydist[d]]];
   var b:array[Int,16,16] :: allocated[single[on[1]]];
   a:=b;
};

In this example the array is split using horizontal partitioning into 4 blocks, the first block held on process 3, the second on process 0, third on process 2 and lastly the fourth on process 1. In the assignment on line 10 the data in array b is distributed to the correct blocks which are held on the appropriate processes depending on the array distribution. To change what data goes where one can simply modify the values in array d.

Since: Version 1.0