* To help us fund GROMACS development, we humbly ask that you cite
* the research papers on the package. Check out http://www.gromacs.org.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
#include <stdio.h>
-#include "typedefs.h"
-#include "vsite.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "nrnb.h"
-#include "vec.h"
-#include "network.h"
-#include "mshift.h"
-#include "pbc.h"
-#include "domdec.h"
-#include "mtop_util.h"
-#include "gmx_omp_nthreads.h"
+#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/legacyheaders/types/commrec.h"
+#include "gromacs/legacyheaders/vsite.h"
+#include "gromacs/legacyheaders/macros.h"
+#include "gromacs/legacyheaders/nrnb.h"
+#include "gromacs/math/vec.h"
+#include "gromacs/legacyheaders/network.h"
+#include "gromacs/legacyheaders/domdec.h"
+#include "gromacs/topology/mtop_util.h"
+#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
+
+#include "gromacs/pbcutil/ishift.h"
+#include "gromacs/pbcutil/mshift.h"
+#include "gromacs/pbcutil/pbc.h"
#include "gromacs/utility/gmxomp.h"
+#include "gromacs/utility/smalloc.h"
/* Routines to send/recieve coordinates and force
* of constructing atoms.
}
void split_vsites_over_threads(const t_ilist *ilist,
+ const t_iparams *ip,
const t_mdatoms *mdatoms,
gmx_bool bLimitRange,
gmx_vsite_t *vsite)
vsite_atom_range = -1;
for (ftype = 0; ftype < F_NRE; ftype++)
{
- if ((interaction_function[ftype].flags & IF_VSITE) &&
- ftype != F_VSITEN)
+ if (interaction_function[ftype].flags & IF_VSITE)
{
- nral1 = 1 + NRAL(ftype);
- iat = ilist[ftype].iatoms;
- for (i = 0; i < ilist[ftype].nr; i += nral1)
+ if (ftype != F_VSITEN)
{
- for (j = i+1; j < i+nral1; j++)
+ nral1 = 1 + NRAL(ftype);
+ iat = ilist[ftype].iatoms;
+ for (i = 0; i < ilist[ftype].nr; i += nral1)
{
- vsite_atom_range = max(vsite_atom_range, iat[j]);
+ for (j = i + 1; j < i + nral1; j++)
+ {
+ vsite_atom_range = max(vsite_atom_range, iat[j]);
+ }
+ }
+ }
+ else
+ {
+ int vs_ind_end;
+
+ iat = ilist[ftype].iatoms;
+
+ i = 0;
+ while (i < ilist[ftype].nr)
+ {
+ /* The 3 below is from 1+NRAL(ftype)=3 */
+ vs_ind_end = i + ip[iat[i]].vsiten.n*3;
+
+ vsite_atom_range = max(vsite_atom_range, iat[i+1]);
+ while (i < vs_ind_end)
+ {
+ vsite_atom_range = max(vsite_atom_range, iat[i+2]);
+ i += 3;
+ }
}
}
}
for (ftype = 0; ftype < F_NRE; ftype++)
{
- if ((interaction_function[ftype].flags & IF_VSITE) &&
- ftype != F_VSITEN)
+ if (interaction_function[ftype].flags & IF_VSITE)
{
nral1 = 1 + NRAL(ftype);
inc = nral1;
*/
if (ftype != F_VSITEN)
{
- for (j = i+2; j < i+nral1; j++)
+ for (j = i + 2; j < i + nral1; j++)
{
if (th_ind[iat[j]] != th)
{
}
else
{
- inc = iat[i];
- for (j = i+2; j < i+inc; j += 3)
+ /* The 3 below is from 1+NRAL(ftype)=3 */
+ inc = ip[iat[i]].vsiten.n*3;
+ for (j = i + 2; j < i + inc; j += 3)
{
if (th_ind[iat[j]] != th)
{
}
/* Copy this vsite to the thread data struct of thread th */
il_th = &vsite->tdata[th].ilist[ftype];
- for (j = i; j < i+inc; j++)
+ for (j = i; j < i + inc; j++)
{
il_th->iatoms[il_th->nr++] = iat[j];
}
gmx_fatal(FARGS, "The combination of threading, virtual sites and charge groups is not implemented");
}
- split_vsites_over_threads(top->idef.il, md, !DOMAINDECOMP(cr), vsite);
+ split_vsites_over_threads(top->idef.il, top->idef.iparams,
+ md, !DOMAINDECOMP(cr), vsite);
}
}