Next: Effect and Restrictions
Up: The Java Adlib API
Previous: Effect and Restrictions
Contents
Shift
A shift() method is a communication schedule for shifting the elements
of a distributed array along one of its dimensions, placing the result in
another array. The source and destination arrays must have the same shape
and element-type, and they must be identically aligned.
The shift() operation does not copy values from source array that would
go past the edge of destination array, and at the other extreme of the
range elements of destination that are not targeted by elements from
source array are unchanged from their input value.
The related operation cshift() is essentially identical to
shift() except that it implements a circular shift, rather then an
``edge-off'' shift.
General signatures of shift() function are
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 0, ...,
-1 where
is the rank of the arrays.
The shift method is implemented by a schedule object with HPspmd
class Shift
. Each primitive type and Object has
its own schedule class.
This class has a constructor with arguments identical to the method above,
and has one public method with no arguments called execute(),
which executes the schedule.
The effective public interface of the Shift
class is
The source array is the source and the destination array is
destination.
The shift mount is given by shiftAmount. The dimension argument
selects the array dimension in which the shift occurs. The flag mode
specifies the type of shift. It takes one of the values Adlib.CYCL,
Adlib.EDGE, or Adlib.NONE.
Subsections
Next: Effect and Restrictions
Up: The Java Adlib API
Previous: Effect and Restrictions
Contents
Bryan Carpenter
2004-06-09