Initializes and updates local atom sets in the do_md loop.
An instance of local atom sets manager is set up in do_md. Domain
decomposition triggers update to local atom indices.
Change-Id: I361ce33220c423cbce2e6af617dbc5164291ce0a
#include "gromacs/domdec/dlbtiming.h"
#include "gromacs/domdec/domdec_network.h"
#include "gromacs/domdec/ga2la.h"
+#include "gromacs/domdec/localatomsetmanager.h"
#include "gromacs/ewald/pme.h"
#include "gromacs/fileio/gmxfio.h"
#include "gromacs/fileio/pdbio.h"
const gmx_mtop_t *mtop,
const t_inputrec *ir,
const matrix box,
- gmx::ArrayRef<const gmx::RVec> xGlobal)
+ gmx::ArrayRef<const gmx::RVec> xGlobal,
+ gmx::LocalAtomSetManager *atomSets)
{
gmx_domdec_t *dd;
clear_dd_cycle_counts(dd);
+ dd->atomSets = atomSets;
+
return dd;
}
dd_make_local_swap_groups(dd, ir->swap);
}
+ if (dd->atomSets != nullptr)
+ {
+ /* Update the local atom sets */
+ dd->atomSets->setIndicesInDomainDecomposition(*(dd->ga2la));
+ }
+
/* Update the local atoms to be communicated via the IMD protocol if bIMD is TRUE. */
dd_make_local_IMD_atoms(ir->bIMD, dd, ir->imd);
{
class Constraints;
class MDAtoms;
+class LocalAtomSetManager;
} // namespace
/*! \brief Returns the global topology atom number belonging to local atom index i.
const gmx_mtop_t *mtop,
const t_inputrec *ir,
const matrix box,
- gmx::ArrayRef<const gmx::RVec> xGlobal);
+ gmx::ArrayRef<const gmx::RVec> xGlobal,
+ gmx::LocalAtomSetManager *atomSets);
/*! \brief Initialize data structures for bonded interactions */
void dd_init_bondeds(FILE *fplog,
struct gmx_pme_comm_n_box_t;
struct gmx_reverse_top_t;
+namespace gmx
+{
+class LocalAtomSetManager;
+}
+
typedef struct {
int j0; /* j-zone start */
int j1; /* j-zone end */
/* The partioning count, to keep track of the state */
gmx_int64_t ddp_count;
+ /* The managed atom sets that are updated in domain decomposition */
+ gmx::LocalAtomSetManager * atomSets;
/* gmx_pme_recv_f buffer */
int pme_recv_f_alloc = 0;
#include "gromacs/commandline/filenm.h"
#include "gromacs/domdec/domdec.h"
#include "gromacs/domdec/domdec_struct.h"
+#include "gromacs/domdec/localatomsetmanager.h"
#include "gromacs/ewald/ewald-utils.h"
#include "gromacs/ewald/pme.h"
#include "gromacs/ewald/pme-gpu-program.h"
useGpuForNonbonded || (emulateGpuNonbonded == EmulateGpuNonbonded::Yes), *hwinfo->cpuInfo);
}
- /* Initalize the domain decomposition */
+ LocalAtomSetManager atomSets;
+
if (PAR(cr) && !(EI_TPI(inputrec->eI) ||
inputrec->eI == eiNM))
{
cr->dd = init_domain_decomposition(fplog, cr, domdecOptions, mdrunOptions,
&mtop, inputrec,
- box, positionsFromStatePointer(globalState.get()));
+ box, positionsFromStatePointer(globalState.get()),
+ &atomSets);
// Note that local state still does not exist yet.
}
else