Fix bonded atom communication performance
authorBerk Hess <hess@kth.se>
Mon, 18 Nov 2019 15:39:01 +0000 (16:39 +0100)
committerMagnus Lundborg <magnus.lundborg@scilifelab.se>
Tue, 19 Nov 2019 14:47:45 +0000 (15:47 +0100)
The filtering of atoms to communicate for bonded interactions that
are beyond the non-bonded cut-off was effectively missing, because
the home atom indices were not set. This lead to many more atoms
being communicated.

Change-Id: I4bd5b9b561a3077e055186f312939221dba6cefa

src/gromacs/domdec/partition.cpp

index dbd52b2049d1d0bdea7de1f5681467fe99025971..b00ceec520596409c50bc96b027913a0dc0e7749 100644 (file)
@@ -3044,11 +3044,15 @@ void dd_partition_system(FILE*                        fplog,
 
     wallcycle_sub_start(wcycle, ewcsDD_SETUPCOMM);
 
+    /* Set the induces for the home atoms */
+    set_zones_ncg_home(dd);
+    make_dd_indices(dd, ncgindex_set);
+
     /* Setup up the communication and communicate the coordinates */
     setup_dd_communication(dd, state_local->box, &ddbox, fr, state_local, f);
 
-    /* Set the indices */
-    make_dd_indices(dd, ncgindex_set);
+    /* Set the indices for the halo atoms */
+    make_dd_indices(dd, dd->ncg_home);
 
     /* Set the charge group boundaries for neighbor searching */
     set_cg_boundaries(&comm->zones);