public class ModuleZ extends ModuleY
runtimeInitialized
Modifier | Constructor and Description |
---|---|
protected |
ModuleZ()
Private constructor to disallow instance creation.
|
Modifier and Type | Method and Description |
---|---|
static <T> void |
abort()
Aborts the currently executing task.
|
static void |
asyncFastPhased(HjPhasedBody... phases)
Launches an async which participates in a fast barrier computation where individual phase computation can be
skipped if a sibling task already signals (offers a eureka) for that phase.
|
static void |
asyncWhen(HjExpression.HjAwaitExpression expression,
HjRunnable runnable)
Mechanism to create an asynchronous task where the await expression is designed to coordinate relationships of
this parallel tasks with other tasks (using the
HjFuture handles. |
static void |
asyncWhen(HjExpression.HjBooleanExpression expression,
HjRunnable runnable)
Mechanism to create an asynchronous task where the await expression is designed to coordinate relationships of
this parallel tasks with other tasks (using the
HjFuture handles. |
static void |
asyncWhen(HjFuture<?> future,
HjRunnable runnable)
Mechanism to create an asynchronous task where the await expression is designed to coordinate relationships of
this parallel tasks with other tasks (using the
HjFuture handles. |
static <T> void |
checkEureka(T eurekaValue)
Associates a value with the registered eureka.
|
static void |
finish(HjEureka<?,?,?> hjEureka,
HjSuspendable suspendable)
Registers a HjEureka with the finish scope and continues to execute the body of the finish scope.
|
static <V> HjFuture<V> |
futureWhen(HjExpression.HjAwaitExpression expression,
HjCallable<V> runnable)
Mechanism to create an asynchronous task where the await expression is designed to coordinate relationships of
this parallel tasks with other tasks (using the
HjFuture handles. |
static <V> HjFuture<V> |
futureWhen(HjExpression.HjBooleanExpression expression,
HjCallable<V> runnable)
Mechanism to create an asynchronous task where the await expression is designed to coordinate relationships of
this parallel tasks with other tasks (using the
HjFuture handles. |
static <V> HjFuture<V> |
futureWhen(HjFuture<?> future,
HjCallable<V> runnable)
Mechanism to create an asynchronous task where the await expression is designed to coordinate relationships of
this parallel tasks with other tasks (using the
HjFuture handles. |
static <L,R> HjBinaryEureka<L,R> |
newBinaryEureka(HjLogicalOperator operator,
HjEureka<L,Object,L> leftEureka,
HjEureka<R,Object,R> rightEureka)
Factory method to create a new
HjBinaryEureka instance. |
static <T> HjConvergenceEureka<T> |
newConvergenceEureka(T initialValue,
java.util.function.BiPredicate<T,T> checker)
Factory method to create a new
HjConvergenceEureka instance. |
static <T> HjConvergenceEureka<T> |
newConvergenceEureka(T initialValue,
java.util.function.BiPredicate<T,T> checker,
HjProcedure<T> convergenceCallback)
Factory method to create a new
HjConvergenceEureka instance. |
static <T> HjCountEureka<T> |
newCountEureka(long maxCount,
int spaceForResult)
Factory method to create a new
HjCountEureka instance. |
static <T> HjEngineEureka<T> |
newEngineEureka(int maxUnits)
Factory method to create a new
HjEngineEureka instance. |
static <T> HjSearchEureka<T> |
newEureka()
Factory method to create a new
HjSearchEureka instance. |
static <T> HjExtremaEureka<T> |
newExtremaEureka(T initialValue,
Comparator<T> comparator)
Factory method to create a new
HjExtremaEureka instance. |
static <T> HjExtremaEureka<T> |
newExtremaEureka(T initialValue,
Comparator<T> comparator,
boolean shouldAbortOnOffer)
Factory method to create a new
HjExtremaEureka instance. |
static HjFastBarrierEureka |
newFastBarrierEureka(int numPhases)
Factory method to create a new
HjFastBarrierEureka instance. |
static <T> HjSearchEureka<T> |
newSearchEureka(T initialValue)
Factory method to create a new
HjSearchEureka instance. |
static <T> HjTimerEureka<T> |
newTimerEureka(int timeUnitsInMillis)
Factory method to create a new
HjTimerEureka instance. |
static <T> HjVersionEureka<T> |
newVersionEureka(int n)
Factory method to create a new
HjVersionEureka instance. |
static <T> void |
offerEureka(T eurekaValue)
Associates a value with the registered eureka.
|
static <T1,T2> void |
offerEurekaPair(T1 leftValue,
T2 rightValue)
Associates a value with the registered eureka.
|
static <T> T |
readEureka()
Return the current value stored on the registered eureka.
|
static <T> HjEureka<T,T,T> |
retrieveEureka()
Return the eureka to be registered in the finish scope.
|
forallItems, forallItems, forallItems, forallItemsSusp, forallItemsSusp, forallItemsSusp, forasyncItems, forasyncItems, forasyncItems, forasyncItemsSusp, forasyncItemsSusp, forasyncItemsSusp
newDoubleArrayView1D, newDoubleArrayView1D, newDoubleArrayView2D, newDoubleArrayView2D, newDoubleArrayView3D, newDoubleArrayView3D, newIntArrayView1D, newIntArrayView1D, newIntArrayView2D, newIntArrayView2D, newIntArrayView3D, newIntArrayView3D
newEventCount, newEventCount
isolated, isolated, isolated, isolated, isolated, isolatedWithReturn, isolatedWithReturn, isolatedWithReturn, isolatedWithReturn, isolatedWithReturn, newActor, readMode, writeMode
async, asyncAwait, asyncAwait, asyncAwait, asyncAwait, forall, forall, forall, forall, forall, forall, forallChunked, forallChunked, forallChunked, forallChunked, forallChunked, forallChunked, forasync, forasync, forasync, forasync, forasync, forasync, forasyncChunked, forasyncChunked, forasyncChunked, forasyncChunked, forasyncChunked, forseq, forseq, forseq, forseq, forseq, forseq, future, futureAwait, futureAwait, futureAwait, futureAwait
abstractMetrics, asyncNb, asyncNbAt, asyncNbAwait, asyncNbAwait, asyncNbAwait, asyncNbAwait, asyncNbSeq, asyncNbSeq, asyncPhased, asyncPhased, asyncPhased, computeDefaultChunkSize, doWait, doWork, dumpEventLog, emergencyShutdown, finalizeHabanero, finish, finish, finish, finish, finish, forallNb, forallNb, forallNb, forallNb, forallNb, forallNb, forallNbChunked, forallNbChunked, forallNbChunked, forallNbChunked, forallNbChunked, forallNbChunked, forallPhased, forallPhased, forasync, forasyncChunked, forasyncNb, forasyncNb, forasyncNb, forasyncNb, forasyncNb, forasyncNbChunked, forasyncNbChunked, forasyncNbChunked, forasyncNbChunked, forasyncPhased, forasyncPhased, forasyncPhased, forseqNb, forseqNb, forseqNb, forseqNb, forseqNb, forseqNb, futureNb, futureNbAwait, futureNbAwait, futureNbAwait, futureNbAwait, futureNbSeq, futureNbSeq, group, group, here, initializeHabanero, launchHabaneroApp, launchHabaneroApp, myGroup, myGroup, newDataDrivenFuture, newDataDrivenFuture, newDDF, newDDF, newFinishAccumulator, newPhaser, newPhaser, newPoint, newRectangularRegion1D, newRectangularRegion2D, newRectangularRegion3D, next, numPlaces, numWorkerThreads, place, printBuildInfo, signal, waitAll, waitAny
public static void asyncWhen(HjFuture<?> future, HjRunnable runnable)
HjFuture
handles.
Delegates to asyncWhen(HjExpression.leaf(expression), runnable)
future
- The futureNb whose resolution that controls when the async is ready for execution.runnable
- The body of the async.asyncWhen(edu.rice.hj.experimental.api.HjExpression.HjBooleanExpression, edu.rice.hj.api.HjRunnable)
public static void asyncWhen(HjExpression.HjBooleanExpression expression, HjRunnable runnable)
HjFuture
handles.
Delegates to asyncWhen(HjExpression.awaitExpr(expression), runnable)
expression
- The expression that controls when the async is ready for execution.runnable
- The body of the async.asyncWhen(edu.rice.hj.experimental.api.HjExpression.HjAwaitExpression, edu.rice.hj.api.HjRunnable)
public static void asyncWhen(HjExpression.HjAwaitExpression expression, HjRunnable runnable)
HjFuture
handles.
The body of this async is only executed when the expression evaluates to true, the expression can only be safely evaluated after all the futures involved in the expression have been resolved when in strict mode (expression contains a NOT). There is also a short-circuit mode (expression contains only AND and OR) where the expression is evaluated early and the asynchronous computation triggered even when some of the other dependent tasks may not yet have completed execution.
The semantics of
asyncWhen(awaitExpr, () -> S1)
are as follows:
async(() -> {
boolean exprVal = expr.evaluate();
if (exprVal) {
S1;
}
});
expression
- The expression that controls when the async is ready for execution.runnable
- The body of the async.HjRuntime.asyncWhen(edu.rice.hj.experimental.api.HjExpression.HjAwaitExpression,
edu.rice.hj.api.HjRunnable)
public static <V> HjFuture<V> futureWhen(HjFuture<?> future, HjCallable<V> runnable)
HjFuture
handles.
Delegates to asyncWhen(HjExpression.leaf(expression), runnable)
future
- The futureNb whose resolution that controls when the async is ready for execution.runnable
- The body of the async.futureWhen(edu.rice.hj.experimental.api.HjExpression.HjBooleanExpression,
edu.rice.hj.api.HjCallable)
public static <V> HjFuture<V> futureWhen(HjExpression.HjBooleanExpression expression, HjCallable<V> runnable)
HjFuture
handles.
Delegates to futureWhen(HjExpression.awaitExpr(expression), runnable)
expression
- The expression that controls when the async is ready for execution.runnable
- The body of the async.futureWhen(edu.rice.hj.experimental.api.HjExpression.HjAwaitExpression, edu.rice.hj.api.HjCallable)
public static <V> HjFuture<V> futureWhen(HjExpression.HjAwaitExpression expression, HjCallable<V> runnable)
HjFuture
handles. Also returns the
futureNb object representing the value of the computation.
The body of this async is only executed when the expression evaluates to true, the expression can only be safely evaluated after all the futures involved in the expression have been resolved when in strict mode (expression contains a NOT). There is also a short-circuit mode (expression contains only AND and OR) where the expression is evaluated early and the asynchronous computation triggered even when some of the other dependent tasks may not yet have completed execution.
The semantics of
futureWhen(awaitExpr, () -> S1)
are as follows:
async(() -> {
boolean exprVal = expr.evaluate();
if (exprVal) {
S1;
} else {
throw new RuntimeException("clause failed!");
}
});
expression
- The expression that controls when the async is ready for execution.runnable
- The body of the async.HjRuntime.futureWhen(edu.rice.hj.experimental.api.HjExpression.HjAwaitExpression,
edu.rice.hj.api.HjCallable)
public static void finish(HjEureka<?,?,?> hjEureka, HjSuspendable suspendable) throws SuspendableException
hjEureka
- the eureka to be registeredsuspendable
- the body of the finish scopeSuspendableException
HjRuntime.finish(edu.rice.hj.experimental.api.HjEureka, edu.rice.hj.api.HjSuspendable)
public static <T> HjSearchEureka<T> newEureka()
HjSearchEureka
instance.
It delegates the call to HjRuntime.newSearchEureka(Object)
.
T
- The type of value stored inside the Eureka event.HjSearchEureka
instanceHjRuntime.newSearchEureka(Object)
public static <T> HjSearchEureka<T> newSearchEureka(T initialValue)
HjSearchEureka
instance.T
- The type of value stored inside the Eureka event.initialValue
- The initial value of the search eureka objectHjSearchEureka
instanceHjRuntime.newSearchEureka(Object)
public static <T> HjExtremaEureka<T> newExtremaEureka(T initialValue, Comparator<T> comparator)
HjExtremaEureka
instance.initialValue
- The initial value of the extrema, it should be smaller than expected result.comparator
- The comparator used to maximize the extrema value.HjExtremaEureka
instance.HjRuntime.newExtremaEureka(Object, java.util.Comparator, boolean)
public static <T> HjExtremaEureka<T> newExtremaEureka(T initialValue, Comparator<T> comparator, boolean shouldAbortOnOffer)
HjExtremaEureka
instance.initialValue
- The initial value of the extrema, it should be smaller than expected result.comparator
- The comparator used to maximize the extrema value.shouldAbortOnOffer
- Whether a successful offer should abort the current taskHjExtremaEureka
instance.HjRuntime.newExtremaEureka(Object, java.util.Comparator, boolean)
public static <T> HjConvergenceEureka<T> newConvergenceEureka(T initialValue, java.util.function.BiPredicate<T,T> checker)
HjConvergenceEureka
instance.initialValue
- The initial value of the eureka.checker
- The predicate used to check for convergence.HjConvergenceEureka
instance.HjRuntime.newConvergenceEureka(Object, java.util.function.BiPredicate,
edu.rice.hj.api.HjProcedure)
public static <T> HjConvergenceEureka<T> newConvergenceEureka(T initialValue, java.util.function.BiPredicate<T,T> checker, HjProcedure<T> convergenceCallback)
HjConvergenceEureka
instance.initialValue
- The initial value of the eureka.checker
- The predicate used to check for convergence.convergenceCallback
- A callback invoked once the eureka has converged.HjConvergenceEureka
instance.HjRuntime.newConvergenceEureka(Object, java.util.function.BiPredicate,
edu.rice.hj.api.HjProcedure)
public static HjFastBarrierEureka newFastBarrierEureka(int numPhases)
HjFastBarrierEureka
instance.numPhases
- The number of phases in the fast barrier.HjFastBarrierEureka
instance.HjRuntime.newFastBarrierEureka(int)
public static <T> HjCountEureka<T> newCountEureka(long maxCount, int spaceForResult)
HjCountEureka
instance.maxCount
- The maximum number of eureka events before the eureka is resolved.spaceForResult
- The maximum number of results to store in the eureka.HjCountEureka
instance.HjRuntime.newCountEureka(long, int)
public static <T> HjVersionEureka<T> newVersionEureka(int n)
HjVersionEureka
instance.n
- The number of items that need to match before the eureka is resolved.HjVersionEureka
instance.HjRuntime.newVersionEureka(int)
public static <T> HjEngineEureka<T> newEngineEureka(int maxUnits)
HjEngineEureka
instance.maxUnits
- The maximum number of time units in the eureka.HjEngineEureka
instance.HjRuntime.newEngineEureka(int)
public static <T> HjTimerEureka<T> newTimerEureka(int timeUnitsInMillis)
HjTimerEureka
instance.timeUnitsInMillis
- The maximum number of milliseconds before the eureka is considered resolved.HjTimerEureka
instance.HjRuntime.newTimerEureka(int)
public static <L,R> HjBinaryEureka<L,R> newBinaryEureka(HjLogicalOperator operator, HjEureka<L,Object,L> leftEureka, HjEureka<R,Object,R> rightEureka)
HjBinaryEureka
instance.operator
- The maximum number of milliseconds before the eureka is considered resolved.leftEureka
- The left eureka instance.rightEureka
- The right eureka instance.HjBinaryEureka
instance.(int)
public static void asyncFastPhased(HjPhasedBody... phases)
phases
- The bodies of the different phases in the computationpublic static <T> HjEureka<T,T,T> retrieveEureka()
HjRuntime.retrieveEureka()
public static <T> void offerEureka(T eurekaValue) throws SuspendableException
T
- The type of value stored in the EurekaeurekaValue
- The value to be associated with the eurekaSuspendableException
HjRuntime.offerEureka(Object)
public static <T1,T2> void offerEurekaPair(T1 leftValue, T2 rightValue) throws SuspendableException
T1
- The type of value stored in the first EurekaT2
- The type of value stored in the second EurekaleftValue
- The value to be associated with the eurekarightValue
- The value to be associated with the eurekaSuspendableException
HjRuntime.offerEureka(Object)
public static <T> void checkEureka(T eurekaValue) throws SuspendableException
T
- The type of value stored in the EurekaeurekaValue
- The value to be associated with the eurekaSuspendableException
HjRuntime.checkEureka(Object)
public static <T> T readEureka()
T
- The type of value stored in the EurekaHjRuntime.readEureka()
public static <T> void abort() throws SuspendableException
SuspendableException
HjRuntime.abort()
Copyright © 2015 Rice University - Department of Computer Science. All rights reserved.