DPJRuntime
Class RuntimeState

java.lang.Object
  extended by DPJRuntime.RuntimeState

public class RuntimeState
extends java.lang.Object

This class stores the program state maintained by the DPJ runtime.


Field Summary
static int dpjForeachCutoff
          The minimum number of foreach iterations to be allocated to a single task.
static int dpjForeachSplit
          The number of ways to split a foreach loop.
static int dpjNumThreads
          The number of worker threads.
static boolean insideParallelTask
          Flag indicating whether we are inside a task forked by a DPJ cobegin or foreach construct.
static jsr166y.forkjoin.ForkJoinPool pool
          The ForkJoinPool that the runtime uses to launch ForkJoinTasks.
 
Constructor Summary
RuntimeState()
           
 
Method Summary
static java.lang.String[] initialize(java.lang.String[] args)
          Processes command-line arguments and initializes the runtime parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

insideParallelTask

public static boolean insideParallelTask
Flag indicating whether we are inside a task forked by a DPJ cobegin or foreach construct. This is necessary because the ForkJoinTask framework requires that we handle the outermost invocation of a cobegin or foreach differently from one nested inside another.

This variable is set only by the DPJ compiler and should never be set by user code.


pool

public static jsr166y.forkjoin.ForkJoinPool pool
The ForkJoinPool that the runtime uses to launch ForkJoinTasks.

This variable is set only by the DPJ compiler and should never be set by user code.


dpjForeachCutoff

public static int dpjForeachCutoff
The minimum number of foreach iterations to be allocated to a single task. Beyond this point, no more parallel splitting of a foreach loop occurs. The default is 128. This variable may be set to value n at the start of program execution by passing --dpj-foreach-cutoff=n as a command-line argument to the DPJ program. All DPJ command-line arguments must come first. This variable may also be set directly in the DPJ program, if a different cutoff is desired for different foreach loops.


dpjForeachSplit

public static int dpjForeachSplit
The number of ways to split a foreach loop. The loop is recursively split into this many branches, until the dpjForeachCutoff is reached. The default is 2.

This variable may be set to value n at the start of program execution by passing --dpj-foreach-split=n as a command-line argument to the DPJ program. All DPJ command-line arguments must come first. This variable may also be set directly in the DPJ program, if a different splitting factor is desired for different foreach loops.


dpjNumThreads

public static int dpjNumThreads
The number of worker threads. The default is the number of available processors.

This variable may be set to value n at the start of program execution by passing --dpj-foreach-split=n as a command-line argument to the DPJ program. Thereafter it may not be changed.

Constructor Detail

RuntimeState

public RuntimeState()
             [unknown]
Method Detail

initialize

public static java.lang.String[] initialize(java.lang.String[] args)
                                     writes Root : *
Processes command-line arguments and initializes the runtime parameters. The command-line options are as follows:

--dpj-foreach-split=n: Set dpjForeachSplit to n.
--dpj-foreach-cutoff=n: Set dpjForeachCutoff to n.
--dpj-num-threads=n: Set dpjNumThreads to n.

The DPJ options may appear in any order, but they must precede any command-line arguments to the program. The rest of the arguments are passed to the DPJ program to be processed by it.