Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 The The Habanero Java (HJ) language under development at Rice University builds on past work on X10 v1.5.  HJ is intended for use in teaching Computer Science at the undergraduate level (COMP 322), as well as to serve as a research testbed for new language, compiler, and runtime software technologies for extreme scale systems.  HJ proposes an execution model for multicore processors based on four orthogonal dimensions for portable parallelism:

  1. Lightweight dynamic task creation and termination using async, finish, future, forall, foreachforasync, ateach constructs.
  2. Collective and point-to-point synchronization using phasers
  3. Mutual exclusion and isolation using isolated
  4. Locality control using hierarchical place trees

...

More details can be found in the papers in the Habanero publications web page. 

A download of a research prototype of our the HJ implementation can be found here.


HJ Language Summary

(Following standard conventions for syntax specification, the [ ... ] square brackets below refer to optional clauses.)

async [at (place)] 

           [phased [(ph1<mode1>, ...)] ] 

           [seq (condition)]                              

           [when (conditionawait (ddf1, ...)] Stmt 

  • async — Asynchronously start a new child task to execute Stmt
  • at –- A destination place can may optionally be specified for where the task should execute
  • phased — Task may optionally be phased on a specified subset, (ph1<mode1>, ...), of its parent’s phasers specified subset of its parent’s phasers with specified modes (e.g., phaser ph1 with mode1), or on the entire set of the parent's phasers and modes (by default, if no subset is specified)
  • seq — A boolean condition may optionally be specified as a tuning parameter to determine if the async should just be executed sequentially in the parent task.  The seq clause can not be combined with phased or await clauses
  • await — Task may optionally be delayed to not start until the side-effect-free when condition evaluates to trueonly start after all specified events (data-driven futures) become available

finish [ (accum1, ...) ] finish Stmt

  • Execute Stmt, but wait until all (transitively) spawned asyncs and futures in Stmt’s scope have terminated
  • Propagate a multiset of all exceptions thrown by asyncs spawned asyncs in Stmt’s within Stmt’s scope
  • Optionally, a set of accumulators (e.g., accum1) can be specified as being registered with this finish scope

final future<T> f = async<T> [at (place)] 

                      [phased [(ph1<mode1>, ...)] ]                                                
                      [when (condition)] Expr ; Stmt-Block-with-Return

  • Asynchronously start a new child task to evaluate Expr with place/phased/when options as inStmt-Block-with-Return with optional at and phased clauses as in async
  • f is a reference to object of type future<T>, which is a container for the value to be computed by the future  task; T may be a primitive type (including void) or an object type (class)
  • Stmt-Block-with-Return is a statement block that dynamically terminates with a return statement as in a method body; a return statement is not needed if the return type is voidExpr is a statement sequence ending with return

f.get()

  • Wait until future f has completed execution, and propagate its return value  of type Tvalue; if T = void, then f.get() is evaluated as a statement (like a method call with a void return value)
  • get() also propagates any exception thrown by Exprby Stmt-Block-with-Return

point

  • A point is an n-dimensional tuple of int tuple 's
  • A point variable can hold values of different ranks e.g., point p; p = [1]; … p = [2,3]; …

...

  • Create multiple parallel instances of Stmt as child tasks, one per forall iteration in the rectangular region [lo1:hi1, …]
  • Implicit finish at end of An implicit finish is included for all iterations of the forall
  • Each forall has a  instance has an anonymous pre-allocated phaser shared by all its iterations; no explicit phased clause is permitted for a forall 

forasync foreach (point [i1, …] : [lo1:hi1, …]) [phased [(ph1<mode1>, ...)] ] Stmt

  • Like Like the forall, create multiple instances of Stmt as child tasks, one per foreach forasync iteration in the rectangular region [lo1:hi1, …]
    • No There is no implicit finish in foreach forasync
    • As with async, a foreach forasync iteration may optionally be phased on a specified subset, (ph1<mode1>, ...), of its parent’s phasers or on the entire set

isolated Stmt

  • Execute Stmt in isolation (mutual exclusion) relative to all other instances of isolated statements
  • Stmt must not contain any parallel constructs
  • Weak atomicity: no guarantee on interactions with non-isolated statements 

new phaser(mode1)

  • Allocate a phaser with the specified mode, which can be one of SIG, WAIT, SIG_WAIT, SINGLE
  • Scope of phaser is limited to immediately enclosing finish

...

  • signal each phaser that task is registered on with a signal capability (SIG, SIG_WAIT, SIGNAL)
  • signal is a non-blocking operation --- computation between signal and next serves as a “split phase barrier”

 

isolated Stmt

 

  • Execute Stmt in isolation (mutual exclusion) relative to all other instances of isolated statements
  • Stmt must not contain any parallel constructs
  • Weak atomicity: no guarantee of isolation with respect tonon-isolated statements 

complex32, complex64

  • HJ includes complex as a primitive type e.g.,  

...