return numBondedInteractions;
}
-int dd_make_local_top(gmx_domdec_t* dd,
- gmx_domdec_zones_t* zones,
- int npbcdim,
- matrix box,
- rvec cellsize_min,
- const ivec npulse,
- t_forcerec* fr,
- ArrayRef<const RVec> coordinates,
- const gmx_mtop_t& mtop,
- gmx_localtop_t* ltop)
+int dd_make_local_top(gmx_domdec_t* dd,
+ gmx_domdec_zones_t* zones,
+ int npbcdim,
+ matrix box,
+ rvec cellsize_min,
+ const ivec npulse,
+ t_forcerec* fr,
+ ArrayRef<const RVec> coordinates,
+ const gmx_mtop_t& mtop,
+ gmx::ArrayRef<const int64_t> atomInfo,
+ gmx_localtop_t* ltop)
{
real rc = -1;
ivec rcheck;
<op->idef,
<op->excls);
- /* The ilist is not sorted yet,
- * we can only do this when we have the charge arrays.
- */
- ltop->idef.ilsort = ilsortUNKNOWN;
-
- return numBondedInteractionsToReduce;
-}
-
-void dd_sort_local_top(const gmx_domdec_t& dd, gmx::ArrayRef<const int64_t> atomInfo, gmx_localtop_t* ltop)
-{
- if (dd.reverse_top->doSorting())
+ if (dd->reverse_top->doListedForcesSorting())
{
gmx_sort_ilist_fe(<op->idef, atomInfo);
}
{
ltop->idef.ilsort = ilsortNO_FE;
}
+
+ return numBondedInteractionsToReduce;
}
t_forcerec* fr,
gmx::ArrayRef<const gmx::RVec> coordinates,
const gmx_mtop_t& top,
+ gmx::ArrayRef<const int64_t> atomInfo,
gmx_localtop_t* ltop);
-/*! \brief Sort ltop->ilist when we are doing free energy. */
-void dd_sort_local_top(const gmx_domdec_t& dd, gmx::ArrayRef<const int64_t> atomInfo, gmx_localtop_t* ltop);
-
#endif
mdAtoms);
t_mdatoms* mdatoms = mdAtoms->mdatoms();
- if (usingDomDec)
- {
- dd_sort_local_top(*cr->dd, fr->atomInfo, top);
- }
- else
+ if (!usingDomDec)
{
gmx_mtop_generate_local_top(top_global, top, inputrec.efep != FreeEnergyPerturbationType::No);
}
fr,
state_local->x,
top_global,
+ fr->atomInfo,
top_local);
dd->localTopologyChecker->scheduleCheckOfLocalTopology(numBondedInteractionsToReduce);
std::vector<reverse_ilist_t> ril_mt;
//! \brief The size of ril_mt[?].index summed over all entries
int ril_mt_tot_size = 0;
- //! \brief The sorting state of bondeds for free energy
- int ilsort = ilsortUNKNOWN;
+ //! \brief Whether listed-force interaction lists should be sorted for free energy
+ bool doListedForcesSorting;
//! \brief molblock to global atom index for quick lookup of molblocks on atom index
std::vector<MolblockIndices> mbi;
return impl_->th_work;
}
-bool gmx_reverse_top_t::doSorting() const
+bool gmx_reverse_top_t::doListedForcesSorting() const
{
- return impl_->ilsort != ilsortNO_FE;
+ return impl_->doListedForcesSorting;
}
/*! \brief Generate the reverse topology */
*mtop.intermolecular_ilist, &atoms_global, options, AtomLinkRule::FirstAtom, &ril_intermol);
}
- if (useFreeEnergy && gmx_mtop_bondeds_free_energy(&mtop))
- {
- ilsort = ilsortFE_UNSORTED;
- }
- else
- {
- ilsort = ilsortNO_FE;
- }
+ doListedForcesSorting = useFreeEnergy && gmx_mtop_bondeds_free_energy(&mtop);
/* Make a molblock index for fast searching */
int i = 0;
bool hasPositionRestraints() const;
//! Returns the per-thread working structures for making the local topology
gmx::ArrayRef<thread_work_t> threadWorkObjects() const;
- //! Returns whether the local topology interactions should be sorted
- bool doSorting() const;
+ //! Returns whether the local topology listed-forces interactions should be sorted
+ bool doListedForcesSorting() const;
//! Private implementation definition
struct Impl;
{
ilsortUNKNOWN,
ilsortNO_FE,
- ilsortFE_UNSORTED,
ilsortFE_SORTED
};