Class SpatialDensitySchedule

java.lang.Object
edu.rit.pj.Schedule
edu.rit.pj.IntegerSchedule
ffx.potential.nonbonded.SpatialDensitySchedule

public class SpatialDensitySchedule extends IntegerSchedule
A fixed schedule that load balances work chunks across threads.
Since:
1.0
Author:
Michael J. Schnieders
  • Method Details

    • 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.

      This is a fixed schedule.

      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.