gmxForceCalculator_->compute(coordinates, forces);
}
-void ForceCalculator::updatePairList(gmx::ArrayRef<const int> particleInfoAllVdW,
- gmx::ArrayRef<Vec3> coordinates,
- const Box& box)
+void ForceCalculator::updatePairList(gmx::ArrayRef<const int64_t> particleInfoAllVdW,
+ gmx::ArrayRef<Vec3> coordinates,
+ const Box& box)
{
gmxForceCalculator_->setParticlesOnGrid(particleInfoAllVdW, coordinates, box);
}
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2020, by the GROMACS development team, led by
+ * Copyright (c) 2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
* \param coordinates The coordinates to be placed on grids
* \param[in] box The system simulation box
*/
- void updatePairList(gmx::ArrayRef<const int> particleInfoAllVdW,
- gmx::ArrayRef<Vec3> coordinates,
- const Box& box);
+ void updatePairList(gmx::ArrayRef<const int64_t> particleInfoAllVdW,
+ gmx::ArrayRef<Vec3> coordinates,
+ const Box& box);
private:
//! GROMACS force calculator to compute forces
nbv_->atomdata_add_nbat_f_to_f(gmx::AtomLocality::All, forceOutput);
}
-void GmxForceCalculator::setParticlesOnGrid(gmx::ArrayRef<const int> particleInfoAllVdw,
+void GmxForceCalculator::setParticlesOnGrid(gmx::ArrayRef<const int64_t> particleInfoAllVdw,
gmx::ArrayRef<const gmx::RVec> coordinates,
const Box& box)
{
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2020, by the GROMACS development team, led by
+ * Copyright (c) 2020,2021, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
void compute(gmx::ArrayRef<const gmx::RVec> coordinateInput, gmx::ArrayRef<gmx::RVec> forceOutput);
//! Puts particles on a grid based on bounds specified by the box (for every NS step)
- void setParticlesOnGrid(gmx::ArrayRef<const int> particleInfoAllVdw,
+ void setParticlesOnGrid(gmx::ArrayRef<const int64_t> particleInfoAllVdw,
gmx::ArrayRef<const gmx::RVec> coordinates,
const Box& box);
std::vector<real> nonbondedParameters_;
//! Particle info where all particles are marked to have Van der Waals interactions
- std::vector<int> particleInfoAllVdw_;
+ std::vector<int64_t> particleInfoAllVdw_;
//! GROMACS force calculator to compute forces
std::unique_ptr<GmxForceCalculator> gmxForceCalculator_;
/*! \brief Looks up SETTLE constraints for a range of charge-groups */
static void atoms_to_settles(gmx_domdec_t* dd,
const gmx_mtop_t& mtop,
- const int* atomInfo,
+ gmx::ArrayRef<const int64_t> atomInfo,
gmx::ArrayRef<const std::vector<int>> at2settle_mt,
int cg_start,
int cg_end,
/*! \brief Looks up constraint for the local atoms */
static void atoms_to_constraints(gmx_domdec_t* dd,
const gmx_mtop_t& mtop,
- const int* atomInfo,
+ gmx::ArrayRef<const int64_t> atomInfo,
gmx::ArrayRef<const ListOfLists<int>> at2con_mt,
int nrec,
InteractionList* ilc_local,
int dd_make_local_constraints(gmx_domdec_t* dd,
int at_start,
const struct gmx_mtop_t& mtop,
- const int* atomInfo,
+ gmx::ArrayRef<const int64_t> atomInfo,
gmx::Constraints* constr,
int nrec,
gmx::ArrayRef<InteractionList> il_local)
int dd_make_local_constraints(struct gmx_domdec_t* dd,
int at_start,
const struct gmx_mtop_t& mtop,
- const int* atomInfo,
+ gmx::ArrayRef<const int64_t> atomInfo,
gmx::Constraints* constr,
int nrec,
gmx::ArrayRef<InteractionList> il_local);
std::vector<gmx_cgsort_t> moved;
/**< Integer buffer for sorting */
std::vector<int> intBuffer;
+ /**< Int64 buffer for sorting */
+ std::vector<int64_t> int64Buffer;
} gmx_domdec_sort_t;
/*! \brief Manages atom ranges and order for the local state atom vectors */
gmx_domdec_zones_t* zones,
ArrayRef<const MolblockIndices> molblockIndices,
const std::vector<gmx_moltype_t>& moltype,
- const int* atomInfo,
+ gmx::ArrayRef<const int64_t> atomInfo,
ListOfLists<int>* lexcls,
int iz,
int at_start,
static int make_local_bondeds_excls(gmx_domdec_t* dd,
gmx_domdec_zones_t* zones,
const gmx_mtop_t& mtop,
- const int* atomInfo,
+ ArrayRef<const int64_t> atomInfo,
const bool checkDistanceMultiBody,
const ivec rcheck,
const gmx_bool checkDistanceTwoBody,
int numBondedInteractionsToReduce = make_local_bondeds_excls(dd,
zones,
mtop,
- fr->atomInfo.data(),
+ fr->atomInfo,
checkDistanceMultiBody,
rcheck,
checkDistanceTwoBody,
{
gmx::ArrayRef<gmx::AtomInfoWithinMoleculeBlock> atomInfoForEachMoleculeBlock =
fr->atomInfoForEachMoleculeBlock;
- gmx::ArrayRef<int> atomInfo = fr->atomInfo;
+ gmx::ArrayRef<int64_t> atomInfo = fr->atomInfo;
for (int cg = cg0; cg < cg1; cg++)
{
gmx::ArrayRef<gmx::RVec> x,
gmx::ArrayRef<const gmx::RVec> recv_vr,
gmx::ArrayRef<gmx::AtomInfoWithinMoleculeBlock> atomInfoForEachMoleculeBlock,
- gmx::ArrayRef<int> atomInfo)
+ gmx::ArrayRef<int64_t> atomInfo)
{
gmx_domdec_ind_t *ind, *ind_p;
int p, cell, c, cg, cg0, cg1, cg_gl;
gmx_bool bDist2B,
gmx_bool bDistMB,
gmx::ArrayRef<const gmx::RVec> coordinates,
- gmx::ArrayRef<const int> atomInfo,
+ gmx::ArrayRef<const int64_t> atomInfo,
std::vector<int>* localAtomGroups,
dd_comm_setup_work_t* work)
{
/* Reorder the global cg index */
orderVector<int>(cgsort, dd->globalAtomGroupIndices, &sort->intBuffer);
/* Reorder the atom info */
- orderVector<int>(cgsort, fr->atomInfo, &sort->intBuffer);
+ orderVector<int64_t>(cgsort, fr->atomInfo, &sort->int64Buffer);
/* Set the home atom number */
dd->comm->atomRanges.setEnd(DDAtomRanges::Type::Home, dd->numHomeAtoms);
n = dd_make_local_constraints(dd,
n,
top_global,
- fr->atomInfo.data(),
+ fr->atomInfo,
constr,
inputrec.nProjOrder,
top_local->idef.il);
for (int a = 0; a < molt.atoms.nr; a++)
{
const t_atom& atom = molt.atoms.atom[a];
- int& atomInfo = atomInfoOfMoleculeBlock.atomInfo[moleculeOffsetInBlock + a];
+ int64_t& atomInfo = atomInfoOfMoleculeBlock.atomInfo[moleculeOffsetInBlock + a];
/* Store the energy group in atomInfo */
int gid = getGroupType(mtop.groups,
return atomInfoForEachMoleculeBlock;
}
-static std::vector<int> expandAtomInfo(const int nmb,
- gmx::ArrayRef<const gmx::AtomInfoWithinMoleculeBlock> atomInfoForEachMoleculeBlock)
+static std::vector<int64_t> expandAtomInfo(const int nmb,
+ gmx::ArrayRef<const gmx::AtomInfoWithinMoleculeBlock> atomInfoForEachMoleculeBlock)
{
const int numAtoms = atomInfoForEachMoleculeBlock[nmb - 1].indexOfLastAtomInMoleculeBlock;
- std::vector<int> atomInfo(numAtoms);
+ std::vector<int64_t> atomInfo(numAtoms);
int mb = 0;
for (int a = 0; a < numAtoms; a++)
namespace gmx
{
-/*! \brief Constants whose bit describes properties of atoms in
+/*! \brief Constants whose bit describes a property of an atom in
* AtomInfoWithinMoleculeBlock.atomInfo.
*
* No bit should exceed 1 << 63, so that it fits into a 64-bit
* here, reserving bits 0-7 for the energy-group ID.
*/
//! \{
-static constexpr int sc_atomInfo_FreeEnergyPerturbation = 1 << 15;
-static constexpr int sc_atomInfo_Exclusion = 1 << 17;
-static constexpr int sc_atomInfo_Constraint = 1 << 20;
-static constexpr int sc_atomInfo_Settle = 1 << 21;
-static constexpr int sc_atomInfo_BondCommunication = 1 << 22;
-static constexpr int sc_atomInfo_HasVdw = 1 << 23;
-static constexpr int sc_atomInfo_HasCharge = 1 << 24;
+static constexpr int64_t sc_atomInfo_FreeEnergyPerturbation = 1 << 15;
+static constexpr int64_t sc_atomInfo_Exclusion = 1 << 17;
+static constexpr int64_t sc_atomInfo_Constraint = 1 << 20;
+static constexpr int64_t sc_atomInfo_Settle = 1 << 21;
+static constexpr int64_t sc_atomInfo_BondCommunication = 1 << 22;
+static constexpr int64_t sc_atomInfo_HasVdw = 1 << 23;
+static constexpr int64_t sc_atomInfo_HasCharge = 1 << 24;
//! \}
//! The first 8 bits are reserved for energy-group ID
-static constexpr int sc_atomInfo_EnergyGroupIdMask = 0b11111111;
+static constexpr int64_t sc_atomInfo_EnergyGroupIdMask = 0b11111111;
/*! \brief Contains information about each atom in a molecule block of
* the global topology. */
*
* The vector needs to be indexed accordingly.
*/
- std::vector<int> atomInfo;
+ std::vector<int64_t> atomInfo;
};
} // namespace gmx
/* Information about atom properties for the molecule blocks in the global topology */
std::vector<gmx::AtomInfoWithinMoleculeBlock> atomInfoForEachMoleculeBlock;
/* Information about atom properties for local and non-local atoms */
- std::vector<int> atomInfo;
+ std::vector<int64_t> atomInfo;
std::vector<gmx::RVec> shift_vec;
}
/* Copies the energy group indices to a reordered and packed array */
-static void copy_egp_to_nbat_egps(const int* a,
- int na,
- int na_round,
- int na_c,
- int bit_shift,
- ArrayRef<const int> atomInfo,
- int* atomInfoNb)
+static void copy_egp_to_nbat_egps(const int* a,
+ int na,
+ int na_round,
+ int na_c,
+ int bit_shift,
+ ArrayRef<const int64_t> atomInfo,
+ int* atomInfoNb)
{
int i = 0, j = 0;
for (; i < na; i += na_c)
/* Set the energy group indices for atoms in nbnxn_atomdata_t */
static void nbnxn_atomdata_set_energygroups(nbnxn_atomdata_t::Params* params,
const Nbnxm::GridSet& gridSet,
- ArrayRef<const int> atomInfo)
+ ArrayRef<const int64_t> atomInfo)
{
if (params->nenergrp == 1)
{
}
/* Sets all required atom parameter data in nbnxn_atomdata_t */
-void nbnxn_atomdata_set(nbnxn_atomdata_t* nbat,
- const Nbnxm::GridSet& gridSet,
- ArrayRef<const int> atomTypes,
- ArrayRef<const real> atomCharges,
- ArrayRef<const int> atomInfo)
+void nbnxn_atomdata_set(nbnxn_atomdata_t* nbat,
+ const Nbnxm::GridSet& gridSet,
+ ArrayRef<const int> atomTypes,
+ ArrayRef<const real> atomCharges,
+ ArrayRef<const int64_t> atomInfo)
{
nbnxn_atomdata_t::Params& params = nbat->paramsDeprecated();
};
//! Sets the atomdata after pair search
-void nbnxn_atomdata_set(nbnxn_atomdata_t* nbat,
- const Nbnxm::GridSet& gridSet,
- gmx::ArrayRef<const int> atomTypes,
- gmx::ArrayRef<const real> atomCharges,
- gmx::ArrayRef<const int> atomInfo);
+void nbnxn_atomdata_set(nbnxn_atomdata_t* nbat,
+ const Nbnxm::GridSet& gridSet,
+ gmx::ArrayRef<const int> atomTypes,
+ gmx::ArrayRef<const real> atomCharges,
+ gmx::ArrayRef<const int64_t> atomInfo);
//! Copy the shift vectors to nbat
void nbnxn_atomdata_copy_shiftvec(bool dynamic_box, gmx::ArrayRef<gmx::RVec> shift_vec, nbnxn_atomdata_t* nbat);
const rvec lowerCorner = { 0, 0, 0 };
const rvec upperCorner = { system.box[XX][XX], system.box[YY][YY], system.box[ZZ][ZZ] };
- gmx::ArrayRef<const int> atomInfo;
+ gmx::ArrayRef<const int64_t> atomInfo;
if (options.useHalfLJOptimization)
{
atomInfo = system.atomInfoOxygenVdw;
//! Storage for atom partial charges.
std::vector<real> charges;
//! Atom info where all atoms are marked to have Van der Waals interactions
- std::vector<int> atomInfoAllVdw;
+ std::vector<int64_t> atomInfoAllVdw;
//! Atom info where only oxygen atoms are marked to have Van der Waals interactions
- std::vector<int> atomInfoOxygenVdw;
+ std::vector<int64_t> atomInfoOxygenVdw;
//! Information about exclusions.
ListOfLists<int> excls;
//! Storage for atom positions.
*
* Sorts atoms on LJ coefficients: !=0 first, ==0 at the end.
*/
-static void sort_cluster_on_flag(int numAtomsInCluster,
- int atomStart,
- int atomEnd,
- gmx::ArrayRef<const int> atomInfo,
- gmx::ArrayRef<int> order,
- int* flags)
+static void sort_cluster_on_flag(int numAtomsInCluster,
+ int atomStart,
+ int atomEnd,
+ gmx::ArrayRef<const int64_t> atomInfo,
+ gmx::ArrayRef<int> order,
+ int* flags)
{
constexpr int c_maxNumAtomsInCluster = 8;
int sort1[c_maxNumAtomsInCluster];
nbnxn_atomdata_t* nbat,
int atomStart,
int atomEnd,
- gmx::ArrayRef<const int> atomInfo,
+ gmx::ArrayRef<const int64_t> atomInfo,
gmx::ArrayRef<const gmx::RVec> x,
BoundingBox gmx_unused* bb_work_aligned)
{
void Grid::sortColumnsCpuGeometry(GridSetData* gridSetData,
int dd_zone,
- gmx::ArrayRef<const int> atomInfo,
+ gmx::ArrayRef<const int64_t> atomInfo,
gmx::ArrayRef<const gmx::RVec> x,
nbnxn_atomdata_t* nbat,
const gmx::Range<int> columnRange,
/* Spatially sort the atoms within one grid column */
void Grid::sortColumnsGpuGeometry(GridSetData* gridSetData,
int dd_zone,
- gmx::ArrayRef<const int> atomInfo,
+ gmx::ArrayRef<const int64_t> atomInfo,
gmx::ArrayRef<const gmx::RVec> x,
nbnxn_atomdata_t* nbat,
const gmx::Range<int> columnRange,
GridSetData* gridSetData,
gmx::ArrayRef<GridWork> gridWork,
const gmx::Range<int> atomRange,
- gmx::ArrayRef<const int> atomInfo,
+ gmx::ArrayRef<const int64_t> atomInfo,
gmx::ArrayRef<const gmx::RVec> x,
const int numAtomsMoved,
nbnxn_atomdata_t* nbat)
GridSetData* gridSetData,
gmx::ArrayRef<GridWork> gridWork,
gmx::Range<int> atomRange,
- gmx::ArrayRef<const int> atomInfo,
+ gmx::ArrayRef<const int64_t> atomInfo,
gmx::ArrayRef<const gmx::RVec> x,
int numAtomsMoved,
nbnxn_atomdata_t* nbat);
nbnxn_atomdata_t* nbat,
int atomStart,
int atomEnd,
- gmx::ArrayRef<const int> atomInfo,
+ gmx::ArrayRef<const int64_t> atomInfo,
gmx::ArrayRef<const gmx::RVec> x,
BoundingBox gmx_unused* bb_work_aligned);
//! Spatially sort the atoms within the given column range, for CPU geometry
void sortColumnsCpuGeometry(GridSetData* gridSetData,
int dd_zone,
- gmx::ArrayRef<const int> atomInfo,
+ gmx::ArrayRef<const int64_t> atomInfo,
gmx::ArrayRef<const gmx::RVec> x,
nbnxn_atomdata_t* nbat,
gmx::Range<int> columnRange,
//! Spatially sort the atoms within the given column range, for GPU geometry
void sortColumnsGpuGeometry(GridSetData* gridSetData,
int dd_zone,
- gmx::ArrayRef<const int> atomInfo,
+ gmx::ArrayRef<const int64_t> atomInfo,
gmx::ArrayRef<const gmx::RVec> x,
nbnxn_atomdata_t* nbat,
gmx::Range<int> columnRange,
const gmx::UpdateGroupsCog* updateGroupsCog,
const gmx::Range<int> atomRange,
real atomDensity,
- gmx::ArrayRef<const int> atomInfo,
+ gmx::ArrayRef<const int64_t> atomInfo,
gmx::ArrayRef<const gmx::RVec> x,
const int numAtomsMoved,
const int* move,
const gmx::UpdateGroupsCog* updateGroupsCog,
gmx::Range<int> atomRange,
real atomDensity,
- gmx::ArrayRef<const int> atomInfo,
+ gmx::ArrayRef<const int64_t> atomInfo,
gmx::ArrayRef<const gmx::RVec> x,
int numAtomsMoved,
const int* move,
const gmx::UpdateGroupsCog* updateGroupsCog,
gmx::Range<int> atomRange,
real atomDensity,
- gmx::ArrayRef<const int> atomInfo,
+ gmx::ArrayRef<const int64_t> atomInfo,
gmx::ArrayRef<const gmx::RVec> x,
int numAtomsMoved,
const int* move)
/* Calls nbnxn_put_on_grid for all non-local domains */
void nbnxn_put_on_grid_nonlocal(nonbonded_verlet_t* nbv,
const struct gmx_domdec_zones_t* zones,
- gmx::ArrayRef<const int> atomInfo,
+ gmx::ArrayRef<const int64_t> atomInfo,
gmx::ArrayRef<const gmx::RVec> x)
{
for (int zone = 1; zone < zones->n; zone++)
pairSearch_->setLocalAtomOrder();
}
-void nonbonded_verlet_t::setAtomProperties(gmx::ArrayRef<const int> atomTypes,
- gmx::ArrayRef<const real> atomCharges,
- gmx::ArrayRef<const int> atomInfo) const
+void nonbonded_verlet_t::setAtomProperties(gmx::ArrayRef<const int> atomTypes,
+ gmx::ArrayRef<const real> atomCharges,
+ gmx::ArrayRef<const int64_t> atomInfo) const
{
nbnxn_atomdata_set(nbat.get(), pairSearch_->gridSet(), atomTypes, atomCharges, atomInfo);
}
t_nrnb* nrnb) const;
//! Updates all the atom properties in Nbnxm
- void setAtomProperties(gmx::ArrayRef<const int> atomTypes,
- gmx::ArrayRef<const real> atomCharges,
- gmx::ArrayRef<const int> atomInfo) const;
+ void setAtomProperties(gmx::ArrayRef<const int> atomTypes,
+ gmx::ArrayRef<const real> atomCharges,
+ gmx::ArrayRef<const int64_t> atomInfo) const;
/*!\brief Convert the coordinates to NBNXM format for the given locality.
*
const gmx::UpdateGroupsCog* updateGroupsCog,
gmx::Range<int> atomRange,
real atomDensity,
- gmx::ArrayRef<const int> atomInfo,
+ gmx::ArrayRef<const int64_t> atomInfo,
gmx::ArrayRef<const gmx::RVec> x,
int numAtomsMoved,
const int* move);
*/
void nbnxn_put_on_grid_nonlocal(nonbonded_verlet_t* nb_verlet,
const struct gmx_domdec_zones_t* zones,
- gmx::ArrayRef<const int> atomInfo,
+ gmx::ArrayRef<const int64_t> atomInfo,
gmx::ArrayRef<const gmx::RVec> x);
/*! \brief Check if GROMACS has been built with GPU support.
const gmx::UpdateGroupsCog* updateGroupsCog,
gmx::Range<int> atomRange,
real atomDensity,
- gmx::ArrayRef<const int> atomInfo,
+ gmx::ArrayRef<const int64_t> atomInfo,
gmx::ArrayRef<const gmx::RVec> x,
int numAtomsMoved,
const int* move,