Package ffx.xray

Class GradientSchedule


public class GradientSchedule extends IntegerSchedule
GradientSchedule class.
Since:
1.0
Author:
Armin Avdic
  • Constructor Details

    • GradientSchedule

      protected GradientSchedule(int nThreads, int nAtoms)
      Constructor for GradientSchedule.
      Parameters:
      nThreads - a int.
      nAtoms - a int.
  • Method Details

    • getLowerBounds

      public int[] getLowerBounds()
      Getter for the field lowerBounds.
      Returns:
      an array of
      invalid reference
      int
      objects.
    • getThreadWeights

      public int[] getThreadWeights()
      getThreadWeights.
      Returns:
      an array of
      invalid reference
      int
      objects.
    • isFixedSchedule

      public boolean isFixedSchedule()
      Determine if this schedule is a fixed schedule. For a parallel team with K threads, a fixed schedule partitions the loop index range into exactly K chunks, one chunk for each thread, each chunk with predetermined upper and lower bounds.
      Specified by:
      isFixedSchedule in class IntegerSchedule
      Returns:
      True if this is a fixed schedule, false otherwise.
    • next

      public Range next(int threadID)
      Obtain the next chunk of iterations for the given thread index. If there are more iterations, a range object is returned whose lower bound, upper bound, and stride specify the chunk of iterations to perform. The returned range object's stride is the same as that given to the start() method. The returned range object's lower bound and upper bound are contained within the range given to the start() method. If there are no more iterations, null is returned.

      The next() method is called by multiple parallel team threads in the Parallel Java middleware. The next() method must be multiple thread safe.

      Specified by:
      next in class IntegerSchedule
      Parameters:
      threadID - Thread index in the range 0 .. K-1.
      Returns:
      Chunk of iterations, or null if no more iterations.
    • start

      public void start(int nThreads, Range chunkRange)
      Start generating chunks of iterations for a parallel for loop using this schedule.

      The start() method is only called by a single thread in the Parallel Java middleware.

      Specified by:
      start in class IntegerSchedule
      Parameters:
      nThreads - Number of threads in the parallel team.
      chunkRange - Range of iterations for the entire parallel for loop. The stride may be 1 or greater.