Package ffx.potential.nonbonded
Class PairwiseSchedule
java.lang.Object
edu.rit.pj.Schedule
edu.rit.pj.IntegerSchedule
ffx.potential.nonbonded.PairwiseSchedule
A fixed schedule that balances pairwise work across threads.
- Since:
- 1.0
- Author:
- Michael J. Schnieders
-
Constructor Summary
ConstructorDescriptionPairwiseSchedule
(int nThreads, int nAtoms, Range[] ranges) Constructor for PairwiseSchedule. -
Method Summary
-
Constructor Details
-
PairwiseSchedule
Constructor for PairwiseSchedule.- Parameters:
nThreads
- a int.nAtoms
- a int.ranges
- an array ofRange
objects.
-
-
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 classIntegerSchedule
- Returns:
- True if this is a fixed schedule, false otherwise.
-
next
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 thestart()
method. The returned range object's lower bound and upper bound are contained within the range given to thestart()
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. Thenext()
method must be multiple thread safe.- Specified by:
next
in classIntegerSchedule
- Parameters:
threadID
- Thread index in the range 0 .. K-1.- Returns:
- Chunk of iterations, or null if no more iterations.
-
setAtoms
public void setAtoms(int nAtoms) setAtoms.- Parameters:
nAtoms
- a int.
-
start
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 classIntegerSchedule
- 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.
-