Clean up index handing in make_bondeds_zone
[alexxy/gromacs.git] / src / gromacs / domdec / partition.cpp
index 7dca75dc80ad03aa7315a1a9c56cb97fbc5c99c6..473ab3f92682470a1dbb7ed12a217727a1894a03 100644 (file)
@@ -636,7 +636,7 @@ static void clearDDStateIndices(gmx_domdec_t* dd, const bool keepLocalAtomIndice
     if (!keepLocalAtomIndices)
     {
         /* Clear the whole list without the overhead of searching */
-        ga2la.clear();
+        ga2la.clear(true);
     }
     else
     {
@@ -3141,7 +3141,7 @@ void dd_partition_system(FILE*                     fplog,
         state_change_natoms(state_local, comm->atomRanges.numHomeAtoms());
 
         /* Rebuild all the indices */
-        dd->ga2la->clear();
+        dd->ga2la->clear(false);
         ncgindex_set = 0;
 
         wallcycle_sub_stop(wcycle, WallCycleSubCounter::DDGrid);
@@ -3198,8 +3198,8 @@ void dd_partition_system(FILE*                     fplog,
     {
         numPulses[dd->dim[i]] = comm->cd[i].numPulses();
     }
-    int numBondedInteractionsToReduce = dd_make_local_top(dd,
-                                                          &comm->zones,
+    int numBondedInteractionsToReduce = dd_make_local_top(*dd,
+                                                          comm->zones,
                                                           dd->unitCellInfo.npbcdim,
                                                           state_local->box,
                                                           comm->cellsize_min,
@@ -3207,6 +3207,7 @@ void dd_partition_system(FILE*                     fplog,
                                                           fr,
                                                           state_local->x,
                                                           top_global,
+                                                          fr->atomInfo,
                                                           top_local);
     dd->localTopologyChecker->scheduleCheckOfLocalTopology(numBondedInteractionsToReduce);