Next: Reductions
Up: Collective Communications
Previous: Collective Communications
Contents
We already described two characteristic example of the
regular communications, remap() and writeHalo(), in depth.
In this section we describe other regular collective communications.
The method shift() is a communication schedule for shifting the elements
of a distributed array along one of its dimensions, placing the result in
another array.
In general we have the signatures:
and
where the variable
runs over all primitive types and Object, and
the notation 
# means a multiarray of arbitrary rank, with elements
of type
.
The first form applies only for one
dimensional multiarrays. The second form applies to multiarrays
of any rank. The shiftAmount argument, which may be negative,
specifies the amount and direction of the shift. In the second form the
dimension argument is in the range
where
is the rank of the arrays: it selects the array dimension in which the
shift occurs. The source and destination arrays must have the
same shape, and they must also be identically aligned.
By design,
shift() implements a simpler pattern of communication than general
remap(). The alignment relation allows for a more efficient
implementation. The library incorporates runtime checks on alignment
relations between arguments, where these are required.
The shift() operation does not copy values from source that
would go past the edge of destination, and at the other extreme
of the range elements of destination that are not targetted by
elements from source are unchanged from their input value.
The related operation cshift() is essentially identical to shift()
except that it implements a circular shift, rather than an ``edge-off''
shift.
Finally we mention the function broadcast(), which is actually a
simplified form of remap(). There are two signatures:
and
The first form takes rank-0 distributed array as argument and
broadcasts the element value to all processes of the active process group.
Typically it is used with a scalar section to broadcast
an element of a general array to all members of the active process group,
as here:
The second form of broadcast() just takes an ordinary Java value
as the source. This value should be defined on the process or group
of processes identified by root. It is broadcast to all
members of the active process group.
Next: Reductions
Up: Collective Communications
Previous: Collective Communications
Contents
Bryan Carpenter
2004-06-09