"The index count and number of indices should match");
#if GMX_MPI
- MPI_Send(buffer.data(), domainGroups.numAtoms * sizeof(gmx::RVec), MPI_BYTE, rank,
- rank, dd->mpi_comm_all);
+ MPI_Send(buffer.data(), domainGroups.numAtoms * sizeof(gmx::RVec), MPI_BYTE, rank, rank, dd->mpi_comm_all);
#endif
}
}
{
#if GMX_MPI
int numHomeAtoms = dd->comm->atomRanges.numHomeAtoms();
- MPI_Recv(localVec.data(), numHomeAtoms * sizeof(gmx::RVec), MPI_BYTE, dd->masterrank,
- MPI_ANY_TAG, dd->mpi_comm_all, MPI_STATUS_IGNORE);
+ MPI_Recv(localVec.data(),
+ numHomeAtoms * sizeof(gmx::RVec),
+ MPI_BYTE,
+ dd->masterrank,
+ MPI_ANY_TAG,
+ dd->mpi_comm_all,
+ MPI_STATUS_IGNORE);
#endif
}
}
}
int numHomeAtoms = dd->comm->atomRanges.numHomeAtoms();
- dd_scatterv(dd, sendCounts, displacements, DDMASTER(dd) ? dd->ma->rvecBuffer.data() : nullptr,
- numHomeAtoms * sizeof(gmx::RVec), localVec.data());
+ dd_scatterv(dd,
+ sendCounts,
+ displacements,
+ DDMASTER(dd) ? dd->ma->rvecBuffer.data() : nullptr,
+ numHomeAtoms * sizeof(gmx::RVec),
+ localVec.data());
}
static void distributeVec(gmx_domdec_t* dd,
{
for (int g = 0; g < updateGrouping.numBlocks(); g++)
{
- const auto& block = updateGrouping.block(g);
- const int atomBegin = atomOffset + block.begin();
- const int atomEnd = atomOffset + block.end();
- const int domainIndex =
- computeAtomGroupDomainIndex(*dd, ddbox, triclinicCorrectionMatrix,
- cellBoundaries, atomBegin, atomEnd, box, pos);
+ const auto& block = updateGrouping.block(g);
+ const int atomBegin = atomOffset + block.begin();
+ const int atomEnd = atomOffset + block.end();
+ const int domainIndex = computeAtomGroupDomainIndex(
+ *dd, ddbox, triclinicCorrectionMatrix, cellBoundaries, atomBegin, atomEnd, box, pos);
for (int atomIndex : block)
{
/* Compute the center of geometry for all atoms */
for (int atom = 0; atom < mtop.natoms; atom++)
{
- int domainIndex = computeAtomGroupDomainIndex(*dd, ddbox, triclinicCorrectionMatrix,
- cellBoundaries, atom, atom + 1, box, pos);
+ int domainIndex = computeAtomGroupDomainIndex(
+ *dd, ddbox, triclinicCorrectionMatrix, cellBoundaries, atom, atom + 1, box, pos);
indices[domainIndex].push_back(atom);
ma.domainGroups[domainIndex].numAtoms += 1;
GMX_LOG(mdlog.info)
.appendTextFormatted(
"Atom distribution over %d domains: av %d stddev %d min %d max %d",
- dd->nnodes, nat_sum,
+ dd->nnodes,
+ nat_sum,
gmx::roundToInt(std::sqrt(nat2_sum - gmx::square(static_cast<double>(nat_sum)))),
- nat_min, nat_max);
+ nat_min,
+ nat_max);
}
return indices;
ma->intBuffer[rank] = groupIndices[rank].size() * sizeof(int);
ma->intBuffer[dd->nnodes + rank] = groupOffset * sizeof(int);
- ma->atomGroups.insert(ma->atomGroups.end(), groupIndices[rank].begin(),
- groupIndices[rank].end());
+ ma->atomGroups.insert(
+ ma->atomGroups.end(), groupIndices[rank].begin(), groupIndices[rank].end());
ma->domainGroups[rank].atomGroups = gmx::constArrayRefFromArray(
ma->atomGroups.data() + groupOffset, groupIndices[rank].size());
}
}
- dd_scatterv(dd, bMaster ? ma->intBuffer.data() : nullptr,
+ dd_scatterv(dd,
+ bMaster ? ma->intBuffer.data() : nullptr,
bMaster ? ma->intBuffer.data() + dd->nnodes : nullptr,
- bMaster ? ma->atomGroups.data() : nullptr, dd->ncg_home * sizeof(int),
+ bMaster ? ma->atomGroups.data() : nullptr,
+ dd->ncg_home * sizeof(int),
dd->globalAtomGroupIndices.data());
if (debug)