154 |
|
AtomPlanIntRow->gather(AtomLocalToGlobal, AtomRowToGlobal); |
155 |
|
AtomPlanIntColumn->gather(AtomLocalToGlobal, AtomColToGlobal); |
156 |
|
|
157 |
– |
cerr << "Atoms in Local:\n"; |
158 |
– |
for (int i = 0; i < AtomLocalToGlobal.size(); i++) { |
159 |
– |
cerr << "i =\t" << i << "\t localAt =\t" << AtomLocalToGlobal[i] << "\n"; |
160 |
– |
} |
161 |
– |
cerr << "Atoms in Row:\n"; |
162 |
– |
for (int i = 0; i < AtomRowToGlobal.size(); i++) { |
163 |
– |
cerr << "i =\t" << i << "\t rowAt =\t" << AtomRowToGlobal[i] << "\n"; |
164 |
– |
} |
165 |
– |
cerr << "Atoms in Col:\n"; |
166 |
– |
for (int i = 0; i < AtomColToGlobal.size(); i++) { |
167 |
– |
cerr << "i =\t" << i << "\t colAt =\t" << AtomColToGlobal[i] << "\n"; |
168 |
– |
} |
169 |
– |
|
157 |
|
cgRowToGlobal.resize(nGroupsInRow_); |
158 |
|
cgColToGlobal.resize(nGroupsInCol_); |
159 |
|
cgPlanIntRow->gather(cgLocalToGlobal, cgRowToGlobal); |
160 |
|
cgPlanIntColumn->gather(cgLocalToGlobal, cgColToGlobal); |
174 |
– |
|
175 |
– |
cerr << "Gruops in Local:\n"; |
176 |
– |
for (int i = 0; i < cgLocalToGlobal.size(); i++) { |
177 |
– |
cerr << "i =\t" << i << "\t localCG =\t" << cgLocalToGlobal[i] << "\n"; |
178 |
– |
} |
179 |
– |
cerr << "Groups in Row:\n"; |
180 |
– |
for (int i = 0; i < cgRowToGlobal.size(); i++) { |
181 |
– |
cerr << "i =\t" << i << "\t rowCG =\t" << cgRowToGlobal[i] << "\n"; |
182 |
– |
} |
183 |
– |
cerr << "Groups in Col:\n"; |
184 |
– |
for (int i = 0; i < cgColToGlobal.size(); i++) { |
185 |
– |
cerr << "i =\t" << i << "\t colCG =\t" << cgColToGlobal[i] << "\n"; |
186 |
– |
} |
187 |
– |
|
161 |
|
|
162 |
|
massFactorsRow.resize(nAtomsInRow_); |
163 |
|
massFactorsCol.resize(nAtomsInCol_); |
548 |
|
atomColData.position); |
549 |
|
|
550 |
|
// gather up the cutoff group positions |
578 |
– |
|
579 |
– |
cerr << "before gather\n"; |
580 |
– |
for (int i = 0; i < snap_->cgData.position.size(); i++) { |
581 |
– |
cerr << "cgpos = " << snap_->cgData.position[i] << "\n"; |
582 |
– |
} |
551 |
|
|
552 |
|
cgPlanVectorRow->gather(snap_->cgData.position, |
553 |
|
cgRowData.position); |
554 |
|
|
587 |
– |
cerr << "after gather\n"; |
588 |
– |
for (int i = 0; i < cgRowData.position.size(); i++) { |
589 |
– |
cerr << "cgRpos = " << cgRowData.position[i] << "\n"; |
590 |
– |
} |
591 |
– |
|
555 |
|
cgPlanVectorColumn->gather(snap_->cgData.position, |
556 |
|
cgColData.position); |
594 |
– |
for (int i = 0; i < cgColData.position.size(); i++) { |
595 |
– |
cerr << "cgCpos = " << cgColData.position[i] << "\n"; |
596 |
– |
} |
557 |
|
|
558 |
|
|
559 |
|
// if needed, gather the atomic rotation matrices |
691 |
|
|
692 |
|
for (int ii = 0; ii < pot_temp.size(); ii++ ) |
693 |
|
pairwisePot += pot_temp[ii]; |
694 |
+ |
|
695 |
+ |
for (int ii = 0; ii < N_INTERACTION_FAMILIES; ii++) { |
696 |
+ |
RealType ploc1 = pairwisePot[ii]; |
697 |
+ |
RealType ploc2 = 0.0; |
698 |
+ |
MPI::COMM_WORLD.Allreduce(&ploc1, &ploc2, 1, MPI::REALTYPE, MPI::SUM); |
699 |
+ |
pairwisePot[ii] = ploc2; |
700 |
+ |
} |
701 |
+ |
|
702 |
|
#endif |
703 |
|
|
736 |
– |
cerr << "pairwisePot = " << pairwisePot << "\n"; |
704 |
|
} |
705 |
|
|
706 |
|
int ForceMatrixDecomposition::getNAtomsInRow() { |
735 |
|
|
736 |
|
#ifdef IS_MPI |
737 |
|
d = cgColData.position[cg2] - cgRowData.position[cg1]; |
771 |
– |
cerr << "cg1 = " << cg1 << "\tcg1p = " << cgRowData.position[cg1] << "\n"; |
772 |
– |
cerr << "cg2 = " << cg2 << "\tcg2p = " << cgColData.position[cg2] << "\n"; |
738 |
|
#else |
739 |
|
d = snap_->cgData.position[cg2] - snap_->cgData.position[cg1]; |
775 |
– |
cerr << "cg1 = " << cg1 << "\tcg1p = " << snap_->cgData.position[cg1] << "\n"; |
776 |
– |
cerr << "cg2 = " << cg2 << "\tcg2p = " << snap_->cgData.position[cg2] << "\n"; |
740 |
|
#endif |
741 |
|
|
742 |
|
snap_->wrapVector(d); |
812 |
|
bool ForceMatrixDecomposition::skipAtomPair(int atom1, int atom2) { |
813 |
|
int unique_id_1, unique_id_2; |
814 |
|
|
852 |
– |
|
853 |
– |
cerr << "sap with atom1, atom2 =\t" << atom1 << "\t" << atom2 << "\n"; |
815 |
|
#ifdef IS_MPI |
816 |
|
// in MPI, we have to look up the unique IDs for each atom |
817 |
|
unique_id_1 = AtomRowToGlobal[atom1]; |
818 |
|
unique_id_2 = AtomColToGlobal[atom2]; |
819 |
|
|
859 |
– |
cerr << "sap with uid1, uid2 =\t" << unique_id_1 << "\t" << unique_id_2 << "\n"; |
820 |
|
// this situation should only arise in MPI simulations |
821 |
|
if (unique_id_1 == unique_id_2) return true; |
822 |
|
|