Package edu.rit.pj
Class ParallelConstruct
java.lang.Object
edu.rit.pj.ParallelConstruct
- Direct Known Subclasses:
BarrierAction
,ParallelForLoop
,ParallelIteration
,ParallelRegion
,ParallelSection
Class ParallelConstruct is the common base class for all parallel constructs
that are executed by a ParallelTeam.
- Version:
- 20-Dec-2007
- Author:
- Alan Kaminsky
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal int
Determine the number of threads in the parallel team executing this parallel construct.final int
Determine the index of the calling thread in the parallel team executing this parallel construct.final boolean
Determine if a parallel team is executing this parallel construct.final ParallelRegion
region()
Returns the parallel region of code within which a parallel team is executing this parallel construct.final ParallelTeam
team()
Returns the parallel team that is executing this parallel construct.
-
Constructor Details
-
ParallelConstruct
public ParallelConstruct()Construct a new parallel construct.
-
-
Method Details
-
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
Returns the parallel team that is executing this parallel construct.- Returns:
- Parallel team.
- Throws:
IllegalStateException
- (unchecked exception) Thrown if no parallel team is executing this parallel construct.
-
region
Returns the parallel region of code within which a parallel team is executing this parallel construct.- Returns:
- Parallel region.
- Throws:
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:
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:
IllegalStateException
- (unchecked exception) Thrown if no parallel team is executing this parallel construct. Thrown if the thread callinggetThreadIndex()
is not part of the parallel team executing this parallel construct.
-