Parallel Region model element

ParallelRegion defines a piece of code that can be run in parallel on a shared memory parallel (SMP) computer

The element encapsulates access to Parallel Region in the Parallel Java library.

Usage

To add a parallel region element to your model, drag the icon element to the list of your model elements and edit the desired code. This code can make use of the following predefined constants and methods:

The element implements the following basic methods:

Example of use

pjRegion.execute(4); // runs the parallel code using 4 threads 
pjRegion.execute(0); // runs the parallel code using the default number of threads
_println ("The region executed on "+pjRegion.getThreadCount()+" threads,");
_println ("and took "+pjRegion.getExecutionTime()+" milliseconds.");