{
zones->cg_range[i] = dd->ncg_home;
}
+ /* zone_ncg1[0] should always be equal to ncg_home */
+ dd->comm->zone_ncg1[0] = dd->ncg_home;
}
static void rebuild_cgindex(gmx_domdec_t *dd,
t_block *cgs_gl;
gmx_large_int_t step_pcoupl;
rvec cell_ns_x0, cell_ns_x1;
- int i, j, n, cg0 = 0, ncg_home_old = -1, ncg_moved, nat_f_novirsum;
+ int i, j, n, ncgindex_set, ncg_home_old = -1, ncg_moved, nat_f_novirsum;
gmx_bool bBoxChanged, bNStGlobalComm, bDoDLB, bCheckDLB, bTurnOnDLB, bLogLoad;
gmx_bool bRedist, bSortCG, bResortAll;
ivec ncells_old = {0, 0, 0}, ncells_new = {0, 0, 0}, np;
{
/* Clear the old state */
clear_dd_indices(dd, 0, 0);
+ ncgindex_set = 0;
set_ddbox(dd, bMasterState, cr, ir, state_global->box,
TRUE, cgs_gl, state_global->x, &ddbox);
inc_nrnb(nrnb, eNR_CGCM, dd->nat_home);
dd_set_cginfo(dd->index_gl, 0, dd->ncg_home, fr, comm->bLocalCG);
-
- cg0 = 0;
}
else if (state_local->ddp_count != dd->ddp_count)
{
/* Build the new indices */
rebuild_cgindex(dd, cgs_gl->index, state_local);
make_dd_indices(dd, cgs_gl->index, 0);
+ ncgindex_set = dd->ncg_home;
if (fr->cutoff_scheme == ecutsGROUP)
{
/* Clear the non-home indices */
clear_dd_indices(dd, dd->ncg_home, dd->nat_home);
+ ncgindex_set = 0;
/* Avoid global communication for dim's without pbc and -gcom */
if (!bNStGlobalComm)
dd_redistribute_cg(fplog, step, dd, ddbox.tric_dir,
state_local, f, fr, mdatoms,
- !bSortCG, nrnb, &cg0, &ncg_moved);
+ !bSortCG, nrnb, &ncgindex_set, &ncg_moved);
wallcycle_sub_stop(wcycle, ewcsDD_REDIST);
}
dd_sort_state(dd, ir->ePBC, fr->cg_cm, fr, state_local,
bResortAll ? -1 : ncg_home_old);
/* Rebuild all the indices */
- cg0 = 0;
ga2la_clear(dd->ga2la);
+ ncgindex_set = 0;
wallcycle_sub_stop(wcycle, ewcsDD_GRID);
}
setup_dd_communication(dd, state_local->box, &ddbox, fr, state_local, f);
/* Set the indices */
- make_dd_indices(dd, cgs_gl->index, cg0);
+ make_dd_indices(dd, cgs_gl->index, ncgindex_set);
/* Set the charge group boundaries for neighbor searching */
set_cg_boundaries(&comm->zones);