Alltoall

From Mesham
Revision as of 19:35, 10 January 2010 by Polas (talk | contribs) (Created page with '== Syntax == alltoall[elementsoneach] == Semantics == Will cause each process to send some elements (the number being equal to ''elementsoneach'') to every other process in th…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Syntax

alltoall[elementsoneach]

Semantics

Will cause each process to send some elements (the number being equal to elementsoneach) to every other process in the group.

Example

x:array[Int,12]::allocated[multiple[]];
var r:array[Int,3]::allocated[multiple[]];
var p;
par p from 0 to 3
{
   (x:alltoall[3]):=r;
};

In this example each process sends every other process three elements (the elements in its r.) Therefore each process ends up with twelve elements in x, the location of each is based on the source processes's PID.