/* Determine the home charge group sizes */
const t_block &globalAtomGroups = dd->comm->cgs_gl;
- dd->atomGroups_.clear();
+ dd->atomGrouping_.clear();
for (int i = 0; i < dd->ncg_home; i++)
{
- dd->atomGroups_.appendBlock(globalAtomGroups.blockSize(dd->globalAtomGroupIndices[i]));
+ dd->atomGrouping_.appendBlock(globalAtomGroups.blockSize(dd->globalAtomGroupIndices[i]));
}
if (debug)
comm = dd->comm;
- const RangePartitioning &atomGroups = dd->atomGroups();
+ const RangePartitioning &atomGrouping = dd->atomGrouping();
nzone = 1;
nat_tot = comm->atomRanges.numHomeAtoms();
{
for (int g : ind.index)
{
- for (int j : atomGroups.block(g))
+ for (int j : atomGrouping.block(g))
{
sendBuffer[n] = x[j];
n++;
{
for (int g : ind.index)
{
- for (int j : atomGroups.block(g))
+ for (int j : atomGrouping.block(g))
{
/* We need to shift the coordinates */
for (int d = 0; d < DIM; d++)
{
for (int g : ind.index)
{
- for (int j : atomGroups.block(g))
+ for (int j : atomGrouping.block(g))
{
/* Shift x */
sendBuffer[n][XX] = x[j][XX] + shift[XX];
comm = dd->comm;
- const RangePartitioning &atomGroups = dd->atomGroups();
+ const RangePartitioning &atomGrouping = dd->atomGrouping();
nzone = comm->zones.n/2;
nat_tot = comm->atomRanges.end(DDAtomRanges::Type::Zones);
{
for (int g : ind.index)
{
- for (int j : atomGroups.block(g))
+ for (int j : atomGrouping.block(g))
{
for (int d = 0; d < DIM; d++)
{
assert(NULL != fshift);
for (int g : ind.index)
{
- for (int j : atomGroups.block(g))
+ for (int j : atomGrouping.block(g))
{
for (int d = 0; d < DIM; d++)
{
{
for (int g : ind.index)
{
- for (int j : atomGroups.block(g))
+ for (int j : atomGrouping.block(g))
{
/* Rotate the force */
f[j][XX] += receiveBuffer[n][XX];
comm = dd->comm;
- const RangePartitioning &atomGroups = dd->atomGroups();
+ const RangePartitioning &atomGrouping = dd->atomGrouping();
nzone = 1;
nat_tot = comm->atomRanges.numHomeAtoms();
int n = 0;
for (int g : ind.index)
{
- for (int j : atomGroups.block(g))
+ for (int j : atomGrouping.block(g))
{
sendBuffer[n++] = v[j];
}
comm = dd->comm;
- const gmx::RangePartitioning &atomGroups = dd->atomGroups();
+ const gmx::RangePartitioning &atomGrouping = dd->atomGrouping();
nzone = comm->zones.n/2;
nat_tot = comm->atomRanges.end(DDAtomRanges::Type::Zones);
int n = 0;
for (int g : ind.index)
{
- for (int j : atomGroups.block(g))
+ for (int j : atomGrouping.block(g))
{
v[j] += receiveBuffer[n];
n++;
if (i < dd->comm->atomRanges.end(DDAtomRanges::Type::Zones))
{
c = 0;
- while (i >= dd->atomGroups().subRange(0, dd->comm->zones.cg_range[c + 1]).end())
+ while (i >= dd->atomGrouping().subRange(0, dd->comm->zones.cg_range[c + 1]).end())
{
c++;
}
gmx::ArrayRef<const int> atomGroupsState = state->cg_gl;
std::vector<int> &globalAtomGroupIndices = dd->globalAtomGroupIndices;
- gmx::RangePartitioning &atomGroups = dd->atomGroups_;
+ gmx::RangePartitioning &atomGrouping = dd->atomGrouping_;
globalAtomGroupIndices.resize(atomGroupsState.size());
- atomGroups.clear();
+ atomGrouping.clear();
/* Copy back the global charge group indices from state
* and rebuild the local charge group to atom index.
const int atomGroupGlobal = atomGroupsState[i];
const int groupSize = gcgs_index[atomGroupGlobal + 1] - gcgs_index[atomGroupGlobal];
globalAtomGroupIndices[i] = atomGroupGlobal;
- atomGroups.appendBlock(groupSize);
+ atomGrouping.appendBlock(groupSize);
}
dd->ncg_home = atomGroupsState.size();
- dd->comm->atomRanges.setEnd(DDAtomRanges::Type::Home, atomGroups.fullRange().end());
+ dd->comm->atomRanges.setEnd(DDAtomRanges::Type::Home, atomGrouping.fullRange().end());
set_zones_ncg_home(dd);
}
}
/* Make the local to global and global to local atom index */
- int a = dd->atomGroups().subRange(cg_start, cg_start).begin();
+ int a = dd->atomGrouping().subRange(cg_start, cg_start).begin();
globalAtomIndices.resize(a);
for (int zone = 0; zone < numZones; zone++)
{
/* Get the cg's for this pulse in this zone */
get_zone_pulse_cgs(dd, zonei, zone, cg0_th, cg1_th,
dd->globalAtomGroupIndices,
- dd->atomGroups(),
+ dd->atomGrouping(),
dim, dim_ind, dim0, dim1, dim2,
r_comm2, r_bcomm2,
box, distanceIsTriclinic,
cg_gl = dd->globalAtomGroupIndices[pos_cg];
fr->cginfo[pos_cg] = ddcginfo(cginfo_mb, cg_gl);
nrcg = GET_CGINFO_NATOMS(fr->cginfo[pos_cg]);
- dd->atomGroups_.appendBlock(nrcg);
+ dd->atomGrouping_.appendBlock(nrcg);
if (bBondComm)
{
/* Update the charge group presence,
else
{
/* This part of the code is never executed with bBondComm. */
- std::vector<int> &atomGroupsIndex = dd->atomGroups_.rawIndex();
+ std::vector<int> &atomGroupsIndex = dd->atomGrouping_.rawIndex();
atomGroupsIndex.resize(numAtomGroupsNew + 1);
merge_cg_buffers(nzone, cd, p, zone_cg_range,
if (!cd->receiveInPlace)
{
/* Store the atom block for easy copying of communication buffers */
- make_cell2at_index(cd, nzone, zone_cg_range[nzone], dd->atomGroups());
+ make_cell2at_index(cd, nzone, zone_cg_range[nzone], dd->atomGrouping());
}
nzone += nzone;
}
gmx_incons("unimplemented");
}
- const gmx::RangePartitioning &atomGroups = dd->atomGroups();
+ const gmx::RangePartitioning &atomGrouping = dd->atomGrouping();
/* We alloc with the old size, since cgindex is still old */
- GMX_ASSERT(atomGroups.numBlocks() == dd->ncg_home, "atomGroups and dd should be consistent");
- DDBufferAccess<gmx::RVec> rvecBuffer(dd->comm->rvecBuffer, atomGroups.fullRange().end());
+ GMX_ASSERT(atomGrouping.numBlocks() == dd->ncg_home, "atomGroups and dd should be consistent");
+ DDBufferAccess<gmx::RVec> rvecBuffer(dd->comm->rvecBuffer, atomGrouping.fullRange().end());
- const gmx::RangePartitioning *atomGroupsPtr = (dd->comm->bCGs ? &atomGroups : nullptr);
+ const gmx::RangePartitioning *atomGroupsPtr = (dd->comm->bCGs ? &atomGrouping : nullptr);
/* Set the new home atom/charge group count */
dd->ncg_home = sort->sorted.size();
gmx::RangePartitioning ordered;
for (const gmx_cgsort_t &entry : cgsort)
{
- ordered.appendBlock(atomGroups.block(entry.ind).size());
+ ordered.appendBlock(atomGrouping.block(entry.ind).size());
}
- dd->atomGroups_ = ordered;
+ dd->atomGrouping_ = ordered;
}
else
{
- dd->atomGroups_.setAllBlocksSizeOne(dd->ncg_home);
+ dd->atomGrouping_.setAllBlocksSizeOne(dd->ncg_home);
}
/* Set the home atom number */
- dd->comm->atomRanges.setEnd(DDAtomRanges::Type::Home, dd->atomGroups().fullRange().end());
+ dd->comm->atomRanges.setEnd(DDAtomRanges::Type::Home, dd->atomGrouping().fullRange().end());
if (fr->cutoff_scheme == ecutsVERLET)
{
{
if (GET_CGINFO_SETTLE(cginfo[cg]))
{
- for (int a : dd->atomGroups().block(cg))
+ for (int a : dd->atomGrouping().block(cg))
{
int a_gl = dd->globalAtomIndices[a];
int a_mol;
{
if (GET_CGINFO_CONSTR(cginfo[cg]))
{
- for (int a : dd->atomGroups().block(cg))
+ for (int a : dd->atomGrouping().block(cg))
{
int a_gl = dd->globalAtomIndices[a];
int molnr, a_mol;
/* Global atom group indices for the home and all non-home groups */
std::vector<int> globalAtomGroupIndices;
/* The atom groups for the home and all non-home groups, todo: make private */
- gmx::RangePartitioning atomGroups_;
- const gmx::RangePartitioning &atomGroups() const
+ gmx::RangePartitioning atomGrouping_;
+ const gmx::RangePartitioning &atomGrouping() const
{
- return atomGroups_;
+ return atomGrouping_;
}
/* Local atom to local atom-group index, only used for checking bondeds */
std::vector<int> localAtomGroupFromAtom;
/*! \brief Build the index that maps each local atom to its local atom group */
static void makeLocalAtomGroupsFromAtoms(gmx_domdec_t *dd)
{
- const gmx::RangePartitioning &atomGroups = dd->atomGroups();
+ const gmx::RangePartitioning &atomGrouping = dd->atomGrouping();
dd->localAtomGroupFromAtom.clear();
for (size_t g = 0; g < dd->globalAtomGroupIndices.size(); g++)
{
- for (int gmx_unused a : atomGroups.block(g))
+ for (int gmx_unused a : atomGrouping.block(g))
{
dd->localAtomGroupFromAtom.push_back(g);
}
int iz,
t_blocka *lexcls)
{
- const auto zone = dd->atomGroups().subRange(zones->cg_range[iz],
- zones->cg_range[iz + 1]);
+ const auto zone = dd->atomGrouping().subRange(zones->cg_range[iz],
+ zones->cg_range[iz + 1]);
for (int a : zone)
{
ga2la = dd->ga2la;
- const auto jRange = dd->atomGroups().subRange(zones->izone[iz].jcg0,
- zones->izone[iz].jcg1);
+ const auto jRange = dd->atomGrouping().subRange(zones->izone[iz].jcg0,
+ zones->izone[iz].jcg1);
n_excl_at_max = dd->reverse_top->n_excl_at_max;
/* We set the end index, but note that we might not start at zero here */
- lexcls->nr = dd->atomGroups().subRange(0, cg_end).size();
+ lexcls->nr = dd->atomGrouping().subRange(0, cg_end).size();
int n = lexcls->nra;
int count = 0;
lexcls->nalloc_a = over_alloc_large(n + (cg_end - cg_start)*n_excl_at_max);
srenew(lexcls->a, lexcls->nalloc_a);
}
- const auto atomGroup = dd->atomGroups().block(cg);
+ const auto atomGroup = dd->atomGrouping().block(cg);
if (GET_CGINFO_EXCL_INTER(cginfo[cg]) ||
!GET_CGINFO_EXCL_INTRA(cginfo[cg]))
{
ga2la = dd->ga2la;
- const auto jRange = dd->atomGroups().subRange(zones->izone[iz].jcg0,
- zones->izone[iz].jcg1);
+ const auto jRange = dd->atomGrouping().subRange(zones->izone[iz].jcg0,
+ zones->izone[iz].jcg1);
n_excl_at_max = dd->reverse_top->n_excl_at_max;
static void check_exclusions_alloc(gmx_domdec_t *dd, gmx_domdec_zones_t *zones,
t_blocka *lexcls)
{
- int nr = dd->atomGroups().subRange(0, zones->izone[zones->nizone - 1].cg1).size();
+ int nr = dd->atomGrouping().subRange(0, zones->izone[zones->nizone - 1].cg1).size();
check_alloc_index(lexcls, nr);
t_blocka *lexcls)
{
const auto nonhomeIzonesAtomRange =
- dd->atomGroups().subRange(zones->izone[0].cg1,
- zones->izone[zones->nizone - 1].cg1);
+ dd->atomGrouping().subRange(zones->izone[0].cg1,
+ zones->izone[zones->nizone - 1].cg1);
if (dd->n_intercg_excl == 0)
{
idef_t,
vsite_pbc, vsite_pbc_nalloc,
izone,
- dd->atomGroups().subRange(cg0t, cg1t));
+ dd->atomGrouping().subRange(cg0t, cg1t));
if (izone < nzone_excl)
{
excl_t->nra = 0;
}
- if (dd->atomGroups().allBlocksHaveSizeOne() &&
+ if (dd->atomGrouping().allBlocksHaveSizeOne() &&
!rt->bExclRequired)
{
/* No charge groups and no distance check required */
void dd_make_local_cgs(gmx_domdec_t *dd, t_block *lcgs)
{
lcgs->nr = dd->globalAtomGroupIndices.size();
- lcgs->index = dd->atomGroups_.rawIndex().data();
+ lcgs->index = dd->atomGrouping_.rawIndex().data();
}
void dd_make_local_top(gmx_domdec_t *dd, gmx_domdec_zones_t *zones,
{
fprintf(fplog, "%s %d moved more than the distance allowed by the domain decomposition (%f) in direction %c\n",
dd->comm->bCGs ? "The charge group starting at atom" : "Atom",
- ddglatnr(dd, dd->atomGroups().block(cg).begin()), limitd, dim2char(dim));
+ ddglatnr(dd, dd->atomGrouping().block(cg).begin()), limitd, dim2char(dim));
}
else
{
/* We don't have a limiting distance available: don't print it */
fprintf(fplog, "%s %d moved more than the distance allowed by the domain decomposition in direction %c\n",
dd->comm->bCGs ? "The charge group starting at atom" : "Atom",
- ddglatnr(dd, dd->atomGroups().block(cg).begin()), dim2char(dim));
+ ddglatnr(dd, dd->atomGrouping().block(cg).begin()), dim2char(dim));
}
fprintf(fplog, "distance out of cell %f\n",
dir == 1 ? pos_d - comm->cell_x1[dim] : pos_d - comm->cell_x0[dim]);
make_tric_corr_matrix(npbcdim, state->box, tcm);
- const gmx::RangePartitioning &atomGroups = dd->atomGroups();
+ const gmx::RangePartitioning &atomGrouping = dd->atomGrouping();
nthread = gmx_omp_nthreads_get(emntDomdec);
{
calc_cg_move(fplog, step, dd, state, tric_dir, tcm,
cell_x0, cell_x1, limitd, limit0, limit1,
- atomGroups,
+ atomGrouping,
( thread *dd->ncg_home)/nthread,
((thread+1)*dd->ncg_home)/nthread,
fr->cutoff_scheme == ecutsGROUP ? cg_cm : as_rvec_array(state->x.data()),
* and the place where the charge group should go
* in the next 6 bits. This saves some communication volume.
*/
- nrcg = atomGroups.block(cg).size();
+ nrcg = atomGrouping.block(cg).size();
cggl_flag[ncg[mc]*DD_CGIBS+1] = nrcg | flag;
ncg[mc] += 1;
nat[mc] += nrcg;
* but that could give rise to rounding issues.
*/
home_pos_cg =
- compact_and_copy_vec_cg(dd->ncg_home, move, dd->atomGroups(),
+ compact_and_copy_vec_cg(dd->ncg_home, move, dd->atomGrouping(),
nvec, cg_cm, comm, bCompact);
break;
case ecutsVERLET:
* many conditionals for both for with and without charge groups.
*/
home_pos_cg =
- compact_and_copy_vec_cg(dd->ncg_home, move, dd->atomGroups(),
+ compact_and_copy_vec_cg(dd->ncg_home, move, dd->atomGrouping(),
nvec, as_rvec_array(state->x.data()), comm, FALSE);
if (bCompact)
{
vec = 0;
home_pos_at =
- compact_and_copy_vec_at(dd->ncg_home, move, dd->atomGroups(),
+ compact_and_copy_vec_at(dd->ncg_home, move, dd->atomGrouping(),
nvec, vec++, as_rvec_array(state->x.data()),
comm, bCompact);
if (bV)
{
- compact_and_copy_vec_at(dd->ncg_home, move, dd->atomGroups(),
+ compact_and_copy_vec_at(dd->ncg_home, move, dd->atomGrouping(),
nvec, vec++, as_rvec_array(state->v.data()),
comm, bCompact);
}
if (bCGP)
{
- compact_and_copy_vec_at(dd->ncg_home, move, dd->atomGroups(),
+ compact_and_copy_vec_at(dd->ncg_home, move, dd->atomGrouping(),
nvec, vec++, as_rvec_array(state->cg_p.data()),
comm, bCompact);
}
if (bCompact)
{
compact_ind(dd->ncg_home, move,
- dd->globalAtomGroupIndices, &dd->atomGroups_, dd->globalAtomIndices,
+ dd->globalAtomGroupIndices, &dd->atomGrouping_, dd->globalAtomIndices,
dd->ga2la, comm->bLocalCG,
fr->cginfo);
}
}
clear_and_mark_ind(dd->ncg_home, move,
- dd->globalAtomGroupIndices, dd->atomGroups(), dd->globalAtomIndices,
+ dd->globalAtomGroupIndices, dd->atomGrouping(), dd->globalAtomIndices,
dd->ga2la, comm->bLocalCG,
moved);
}
/* Now we can remove the excess global atom-group indices from the list */
dd->globalAtomGroupIndices.resize(home_pos_cg);
- dd->atomGroups_.reduceNumBlocks(home_pos_cg);
+ dd->atomGrouping_.reduceNumBlocks(home_pos_cg);
/* We reuse the intBuffer without reacquiring since we are in the same scope */
DDBufferAccess<int> &flagBuffer = moveBuffer;
/* Set the global charge group index and size */
const int globalAtomGroupIndex = flagBuffer.buffer[cg*DD_CGIBS];
dd->globalAtomGroupIndices.push_back(globalAtomGroupIndex);
- dd->atomGroups_.appendBlock(nrcg);
+ dd->atomGrouping_.appendBlock(nrcg);
/* Copy the state from the buffer */
if (fr->cutoff_scheme == ecutsGROUP)
{
for (zi = 0; zi < dd_zones->n; zi++)
{
- ca1[zi] = dd->atomGroups().block(dd_zones->cg_range[zi + 1]).begin();
+ ca1[zi] = dd->atomGrouping().block(dd_zones->cg_range[zi + 1]).begin();
}
i = 0;
for (zi = 0; zi < dd_zones->nizone && zi < dd_zones->n; zi++)