next up previous
Next: About this document ... Up: Introduction to Java-Ad Previous: Subgroups

Class libraries or syntax extensions?

We have presented the Java-Ad language using a fairly liberal number of syntax extensions. The main extensions are:

Besides distributed arrays, we introduced four base classes that have a special significance in the context of the above syntax extensions:

Some of the syntax extensions are less important than others. The special syntax for creating locations, subranges and subgroups could be relaced by members of Range and Group:

  Location Range.loc(int i)

  Range Range.subrng(int lb, int ub, int stride)

  Group Group.subgrp(Location i)
without much inconvenience to the programmer.

It would be possible to replace the special type signatures and constructors for distributed arrays with a series of ordinary class types,

  Array1int
  Array2int
  ...
  Array1float
  Array2float
  ...
  ...
and associated constructors. Array1int represents a the class of one-dimensional arrays of int, Array2int represents the class of two-dimensional arrays of int, and so on. The set of classes has to be quite large, and we must fix a finite limit on the rank of an array, and the set of array elements supported. Unless we allow the number of distinct array classes to grow exponentially, it becomes impractical to distinguish between distributed and sequential dimensions in the static type signature of an object. If an array is passed to a function (probably most arrays are) it is difficult for the compiler to deduce that a particular dimension is a sequential dimension. The compiler may end up generating code for global to local address conversion, even in sequential dimensions. This is probably a serious problem for efficiency, because sequential dimensions tend to be subscripted in an irregular way, not in uniform over loops. This problem could probably be overcome by requiring the subscripting operations for sequential and distributed dimensions explicitly differ (somehow) in the user's program. But that seems to complicate the language.

The syntax for the distributed control constructs and local subscripting seems more difficult to eliminate. In particular, the special syntax for over is critical. A Java-Ad translator will do the simple but tedious code transformations needed to replace distributed loops involving distributed arrays by local sequential loops involving local arrays, subscripted by expressions linear in the local loop indices. Unless the translator does this work, data-parallel programming becomes much less appealing. From our point of view this functionality is central to the SPMD data parallel model.


next up previous
Next: About this document ... Up: Introduction to Java-Ad Previous: Subgroups
Bryan Carpenter 2002-07-12