Difference between revisions of "Habanero"

From CSE231 Wiki
Jump to navigation Jump to search
(Created page with "==Async, Finish== Async and finish make up the fundamental building blocks of task-level parallelism in Habanero. [http://www.cse.wustl.edu/~cosgroved/courses/cse231/s17/java...")
 
Line 9: Line 9:
  
 
==Future==
 
==Future==
 +
Futures create tasks that return a value.
 +
 +
[http://www.cse.wustl.edu/~cosgroved/courses/cse231/s17/javadocs/edu/wustl/cse231s/rice/classic/HabaneroClassic.html#future-edu.rice.hj.api.HjSuspendingCallable- future(body)] returns an [http://www.cs.rice.edu/~vs3/hjlib/doc/edu/rice/hj/api/HjFuture.html HjFuture] with a [http://www.cs.rice.edu/~vs3/hjlib/doc/edu/rice/hj/api/HjFuture.html#get-- get()] method.
 +
 +
Futures are covered in [https://edge.edx.org/courses/RiceX/COMP322/1T2014R/courseware/a900dd0655384de3b5ef01e508ea09d7/9eacfea8754549a4bc42918149130a74/1 RiceX Topic 2.1].
  
 
==FinishAccumulator==
 
==FinishAccumulator==
Finish Accumulators provide a convenient way to keep track of a count (for example: the number of solutions in the n-queens problem) or perform a reduction in  
+
Finish Accumulators provide a convenient way to keep track of a count (for example: the number of solutions in the n-queens problem) or perform a reduction as in the [[MapReduce_Assignment]].
  
 
[http://www.cse.wustl.edu/~cosgroved/courses/cse231/s17/javadocs/edu/wustl/cse231s/rice/classic/HabaneroClassic.html#finish-edu.wustl.cse231s.rice.classic.options.RegisterAccumulatorsOption-edu.rice.hj.api.HjSuspendable- finish(register(accumulators), body)]
 
[http://www.cse.wustl.edu/~cosgroved/courses/cse231/s17/javadocs/edu/wustl/cse231s/rice/classic/HabaneroClassic.html#finish-edu.wustl.cse231s.rice.classic.options.RegisterAccumulatorsOption-edu.rice.hj.api.HjSuspendable- finish(register(accumulators), body)]
  
 
FinishAccumulators are covered in [https://edge.edx.org/courses/RiceX/COMP322/1T2014R/courseware/a900dd0655384de3b5ef01e508ea09d7/9eacfea8754549a4bc42918149130a74/7 RiceX Topic 2.3].
 
FinishAccumulators are covered in [https://edge.edx.org/courses/RiceX/COMP322/1T2014R/courseware/a900dd0655384de3b5ef01e508ea09d7/9eacfea8754549a4bc42918149130a74/7 RiceX Topic 2.3].

Revision as of 05:46, 3 March 2017

Async, Finish

Async and finish make up the fundamental building blocks of task-level parallelism in Habanero.

async(body) creates a new child task that can run before, after, or in parallel with all remaining statements of the parent task.

finish(body) executes body and waits for all child tasks to complete.

These concepts are first covered in RiceX Topic 1.1.

Future

Futures create tasks that return a value.

future(body) returns an HjFuture with a get() method.

Futures are covered in RiceX Topic 2.1.

FinishAccumulator

Finish Accumulators provide a convenient way to keep track of a count (for example: the number of solutions in the n-queens problem) or perform a reduction as in the MapReduce_Assignment.

finish(register(accumulators), body)

FinishAccumulators are covered in RiceX Topic 2.3.