edu.rit.pj
Class ParallelConstruct
- java.lang.Object
-
- edu.rit.pj.ParallelConstruct
-
- Direct Known Subclasses:
- BarrierAction, ParallelForLoop, ParallelIteration, ParallelRegion, ParallelSection
public abstract class ParallelConstruct extends java.lang.ObjectClass ParallelConstruct is the common base class for all parallel constructs that are executed by a ParallelTeam.
-
-
Constructor Summary
Constructors Constructor and Description ParallelConstruct()Construct a new parallel construct.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetThreadCount()Determine the number of threads in the parallel team executing this parallel construct.intgetThreadIndex()Determine the index of the calling thread in the parallel team executing this parallel construct.booleanisExecutingInParallel()Determine if a parallel team is executing this parallel construct.ParallelRegionregion()Returns the parallel region of code within which a parallel team is executing this parallel construct.ParallelTeamteam()Returns the parallel team that is executing this parallel construct.
-
-
-
Method Detail
-
isExecutingInParallel
public final boolean isExecutingInParallel()
Determine if a parallel team is executing this parallel construct.- Returns:
- True if a parallel team is executing this parallel construct, false otherwise.
-
team
public final ParallelTeam team()
Returns the parallel team that is executing this parallel construct.- Returns:
- Parallel team.
- Throws:
java.lang.IllegalStateException- (unchecked exception) Thrown if no parallel team is executing this parallel construct.
-
region
public final ParallelRegion region()
Returns the parallel region of code within which a parallel team is executing this parallel construct.- Returns:
- Parallel region.
- Throws:
java.lang.IllegalStateException- (unchecked exception) Thrown if no parallel team is executing this parallel construct.
-
getThreadCount
public final int getThreadCount()
Determine the number of threads in the parallel team executing this parallel construct.- Returns:
- Number of threads in the thread team.
- Throws:
java.lang.IllegalStateException- (unchecked exception) Thrown if no parallel team is executing this parallel construct.
-
getThreadIndex
public final int getThreadIndex()
Determine the index of the calling thread in the parallel team executing this parallel construct.- Returns:
- Index of the calling thread in the range 0 .. getThreadCount()-1.
- Throws:
java.lang.IllegalStateException- (unchecked exception) Thrown if no parallel team is executing this parallel construct. Thrown if the thread calling getThreadIndex() is not part of the parallel team executing this parallel construct.
-
-
DMelt 3.0 © DataMelt by jWork.ORG