pme->nky == grid_size[YY] &&
pme->nkz == grid_size[ZZ])
{
+ /* Here we have found an existing PME data structure that suits us.
+ * However, in the GPU case, we have to reinitialize it - there's only one GPU structure.
+ * This should not cause actual GPU reallocations, at least (the allocated buffers are never shrunk).
+ * So, just some grid size updates in the GPU kernel parameters.
+ */
+ gmx_pme_reinit(&((*pmedata)[ind]), cr, pme, ir, grid_size, ewaldcoeff_q, ewaldcoeff_lj);
*pme_ret = pme;
-
return;
}
do
{
/* Domain decomposition */
+ bool atomSetChanged = false;
ret = gmx_pme_recv_coeffs_coords(pme_pp,
&natoms,
&chargeA, &chargeB,
&lambda_q, &lambda_lj,
&bEnerVir,
&step,
- grid_switch, &ewaldcoeff_q, &ewaldcoeff_lj);
+ grid_switch,
+ &ewaldcoeff_q,
+ &ewaldcoeff_lj,
+ &atomSetChanged);
if (ret == pmerecvqxSWITCHGRID)
{
gmx_pmeonly_switch(&npmedata, &pmedata, grid_switch, ewaldcoeff_q, ewaldcoeff_lj, cr, ir, &pme);
}
+ if (atomSetChanged)
+ {
+ gmx_pme_reinit_atoms(pme, natoms, chargeA);
+ }
+
if (ret == pmerecvqxRESETCOUNTERS)
{
/* Reset the cycle and flop counters */