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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfinish()Perform finalization actions after parallel execution ends.double[]getGrid()Getter for the fieldgrid.intgetNatoms.intgetNsymm()getNsymm.introwIndexForYZ(int giy, int giz) rowIndexForYZ.voidrun()Execute parallel code.voidSelect atoms that should be included.voidSetter for the fieldatoms.final voidsetCrystal(Crystal crystal, int gX, int gY, int gZ) Setter for the fieldcrystal.voidsetDensityLoop(RowLoop[] loops) setDensityLoop.voidsetInitValue(double initValue) Setter for the fieldinitValue.voidstart()Perform initialization actions before parallel execution begins.intyFromRowIndex(int i) yFromRowIndex.intzFromRowIndex(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, executeMethods 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- the grid array.nSymm- a int.threadCount- a int.atoms- an array ofAtomobjects.coordinates- the atomic coordinate array.
-
-
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:
finishin classParallelRegion
-
getGrid
public double[] getGrid()Getter for the fieldgrid.- Returns:
- the grid array.
-
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:
runin 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 ofAtomobjects.
-
setCrystal
Setter for the fieldcrystal.- Parameters:
crystal- aCrystalobject.gX- a int.gY- a int.gZ- a int.
-
setDensityLoop
setDensityLoop.- Parameters:
loops- an array ofRowLoopobjects.
-
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:
startin 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.
-