Package ffx.potential.nonbonded
Class RowRegion
java.lang.Object
edu.rit.pj.ParallelConstruct
edu.rit.pj.ParallelRegion
ffx.potential.nonbonded.RowRegion
- Direct Known Subclasses:
BulkSolventRowRegion
The RowRegion class is used to parallelize placing onto a 3D grid
1) Multipoles using B-splines or
2) Diffraction form factors.
Each "row" of 3D grid (i.e. fixed values of the z and y-coordinates) is operated on by only a single thread to logically enforce atomic updates of grid magnitudes.
- Author:
- Armin Avdic
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
finish()
Perform finalization actions after parallel execution ends.double[]
getGrid()
Getter for the fieldgrid
.int
getNatoms.int
getNsymm()
getNsymm.int
rowIndexForYZ
(int giy, int giz) rowIndexForYZ.void
run()
Execute parallel code.void
Select atoms that should be included.void
Setter for the fieldatoms
.final void
setCrystal
(Crystal crystal, int gX, int gY, int gZ) Setter for the fieldcrystal
.void
setDensityLoop
(RowLoop[] loops) setDensityLoop.void
setInitValue
(double initValue) Setter for the fieldinitValue
.void
start()
Perform initialization actions before parallel execution begins.int
yFromRowIndex
(int i) yFromRowIndex.int
zFromRowIndex
(int i) zFromRowIndex.Methods inherited from class edu.rit.pj.ParallelRegion
barrier, barrier, critical, critical, criticalNonexclusive, criticalNonexclusive, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute
Methods inherited from class edu.rit.pj.ParallelConstruct
getThreadCount, getThreadIndex, isExecutingInParallel, region, team
-
Field Details
-
buff
public int buff -
select
public boolean[][] select -
rowLoop
-
coordinates
protected double[][][] coordinates
-
-
Constructor Details
-
RowRegion
public RowRegion(int gX, int gY, int gZ, double[] grid, int nSymm, int threadCount, Atom[] atoms, double[][][] coordinates) Constructor for RowRegion.- Parameters:
gX
- a int.gY
- a int.gZ
- a int.grid
- an array ofinvalid reference
double
nSymm
- a int.threadCount
- a int.atoms
- an array ofAtom
objects.coordinates
- an array ofinvalid reference
double
-
-
Method Details
-
finish
public void finish()Perform finalization actions after parallel execution ends. Only one thread calls thefinish()
method.The
finish()
method may be overridden in a subclass. If not overridden, thefinish()
method does nothing.- Overrides:
finish
in classParallelRegion
-
getGrid
public double[] getGrid()Getter for the fieldgrid
.- Returns:
- an array of
invalid reference
double
-
getNatoms
public int getNatoms()getNatoms.- Returns:
- a int.
-
getNsymm
public int getNsymm()getNsymm.- Returns:
- a int.
-
rowIndexForYZ
public int rowIndexForYZ(int giy, int giz) rowIndexForYZ.- Parameters:
giy
- a int.giz
- a int.- Returns:
- a int.
-
run
Execute parallel code. All threads of the parallel team call therun()
method concurrently.The
run()
method must be implemented in a subclass.- Specified by:
run
in classParallelRegion
- Throws:
Exception
- Therun()
method may throw any exception.Exception
- if any.
-
selectAtoms
public void selectAtoms()Select atoms that should be included. The default is to include all atoms, which is set up in the constructor. This function should be over-ridden by subclasses that want finer control. -
setAtoms
Setter for the fieldatoms
.- Parameters:
atoms
- an array ofAtom
objects.
-
setCrystal
Setter for the fieldcrystal
.- Parameters:
crystal
- aCrystal
object.gX
- a int.gY
- a int.gZ
- a int.
-
setDensityLoop
setDensityLoop.- Parameters:
loops
- an array ofRowLoop
objects.
-
setInitValue
public void setInitValue(double initValue) Setter for the fieldinitValue
.- Parameters:
initValue
- a double.
-
start
public void start()Perform initialization actions before parallel execution begins. Only one thread calls thestart()
method.The
start()
method may be overridden in a subclass. If not overridden, thestart()
method does nothing.- Overrides:
start
in classParallelRegion
-
yFromRowIndex
public int yFromRowIndex(int i) yFromRowIndex.- Parameters:
i
- a int.- Returns:
- a int.
-
zFromRowIndex
public int zFromRowIndex(int i) zFromRowIndex.- Parameters:
i
- a int.- Returns:
- a int.
-