--- branches/development/src/parallel/ForceMatrixDecomposition.hpp 2011/05/26 13:55:04 1569 +++ branches/development/src/parallel/ForceMatrixDecomposition.hpp 2012/06/18 18:23:20 1756 @@ -36,7 +36,8 @@ * [1] Meineke, et al., J. Comp. Chem. 26, 252-271 (2005). * [2] Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006). * [3] Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008). - * [4] Vardeman & Gezelter, in progress (2009). + * [4] Kuang & Gezelter, J. Chem. Phys. 133, 164101 (2010). + * [5] Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011). */ #ifndef PARALLEL_FORCEMATRIXDECOMPOSITION_HPP @@ -55,19 +56,22 @@ namespace OpenMD { class ForceMatrixDecomposition : public ForceDecomposition { public: - ForceMatrixDecomposition(SimInfo* info) : ForceDecomposition(info) {}; + ForceMatrixDecomposition(SimInfo* info, InteractionManager* iMan); void distributeInitialData(); + void zeroWorkArrays(); void distributeData(); void collectIntermediateData(); void distributeIntermediateData(); + void collectSelfData(); void collectData(); // neighbor list routines vector > buildNeighborList(); // group bookkeeping - pair getGroupTypes(int cg1, int cg2); + groupCutoffs getGroupCutoffs(int cg1, int cg2); + Vector3d getGroupVelocityColumn(int cg2); // Group->atom bookkeeping vector getAtomsInGroupRow(int cg1); @@ -82,27 +86,31 @@ namespace OpenMD { Vector3d getInteratomicVector(int atom1, int atom2); // atom bookkeeping - vector getAtomList(); - vector getSkipsForAtom(int atom1); - bool skipAtomPair(int atom1, int atom2); + int getNAtomsInRow(); + int getTopologicalDistance(int atom1, int atom2); + vector getExcludesForAtom(int atom1); + bool skipAtomPair(int atom1, int atom2, int cg1, int cg2); + bool excludeAtomPair(int atom1, int atom2); void addForceToAtomRow(int atom1, Vector3d fg); void addForceToAtomColumn(int atom2, Vector3d fg); + Vector3d getAtomVelocityColumn(int atom2); // filling interaction blocks with pointers - InteractionData fillInteractionData(int atom1, int atom2); - InteractionData fillSkipData(int atom1, int atom2); + void fillInteractionData(InteractionData &idat, int atom1, int atom2); + void unpackInteractionData(InteractionData &idat, int atom1, int atom2); private: + void createGtypeCutoffMap(); + int nLocal_; int nGroups_; vector AtomLocalToGlobal; vector cgLocalToGlobal; - vector pot_local; - vector massFactorsLocal; + vector groupCutoff; + vector groupToGtype; #ifdef IS_MPI - DataStorage atomRowData; - DataStorage atomColData; + DataStorage atomRowData; DataStorage atomColData; DataStorage cgRowData; DataStorage cgColData; @@ -111,33 +119,49 @@ namespace OpenMD { int nGroupsInRow_; int nGroupsInCol_; - Communicator* AtomCommIntRow; - Communicator* AtomCommRealRow; - Communicator* AtomCommVectorRow; - Communicator* AtomCommMatrixRow; + Communicator rowComm; + Communicator colComm; - Communicator* AtomCommIntColumn; - Communicator* AtomCommRealColumn; - Communicator* AtomCommVectorColumn; - Communicator* AtomCommMatrixColumn; + Plan* AtomPlanIntRow; + Plan* AtomPlanRealRow; + Plan* AtomPlanVectorRow; + Plan* AtomPlanMatrixRow; + Plan* AtomPlanPotRow; - Communicator* cgCommIntRow; - Communicator* cgCommVectorRow; - Communicator* cgCommIntColumn; - Communicator* cgCommVectorColumn; + Plan* AtomPlanIntColumn; + Plan* AtomPlanRealColumn; + Plan* AtomPlanVectorColumn; + Plan* AtomPlanMatrixColumn; + Plan* AtomPlanPotColumn; - vector > pot_row; - vector > pot_col; + Plan* cgPlanIntRow; + Plan* cgPlanVectorRow; + Plan* cgPlanIntColumn; + Plan* cgPlanVectorColumn; + // work arrays for assembling potential energy + vector pot_row; + vector pot_col; + vector identsRow; vector identsCol; + vector atypesRow; + vector atypesCol; + vector AtomRowToGlobal; vector AtomColToGlobal; +public: vector cgRowToGlobal; vector cgColToGlobal; +private: + vector groupCutoffRow; + vector groupCutoffCol; + vector groupColToGtype; + vector groupRowToGtype; + vector > cellListRow_; vector > cellListCol_; @@ -146,7 +170,6 @@ namespace OpenMD { vector massFactorsRow; vector massFactorsCol; - #endif };