Package 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 Object
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

    Constructors
    Constructor
    Description
    Construct a new parallel construct.
  • Method Summary

    Modifier and Type
    Method
    Description
    final 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.
    Returns the parallel region of code within which a parallel team is executing this parallel construct.
    Returns the parallel team that is executing this parallel construct.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public final ParallelTeam 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

      public final ParallelRegion 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 calling getThreadIndex() is not part of the parallel team executing this parallel construct.