Only report intra-sim communication with multiple ranks
authorKevin Boyd <kevin.boyd@uconn.edu>
Tue, 25 Dec 2018 01:46:48 +0000 (20:46 -0500)
committerPaul Bauer <paul.bauer.q@gmail.com>
Mon, 31 Dec 2018 12:35:16 +0000 (13:35 +0100)
Fixes #2807

Change-Id: I01bec8cf9983dc37cd5ad8f29031073c31b2a384

src/gromacs/mdlib/md_support.cpp
src/gromacs/mdlib/md_support.h
src/gromacs/mdrun/md.cpp

index 85fac9fa337f725876684c61f46b8c78f9630e23..2069668f825ad96a769946eb973f127b6ca77281 100644 (file)
@@ -445,7 +445,7 @@ static int lcd4(int i1, int i2, int i3, int i4)
     return nst;
 }
 
-int check_nstglobalcomm(const gmx::MDLogger &mdlog, int nstglobalcomm, t_inputrec *ir)
+int check_nstglobalcomm(const gmx::MDLogger &mdlog, int nstglobalcomm, t_inputrec *ir, const t_commrec * cr)
 {
     if (!EI_DYNAMICS(ir->eI))
     {
@@ -528,9 +528,13 @@ int check_nstglobalcomm(const gmx::MDLogger &mdlog, int nstglobalcomm, t_inputre
         ir->nstcomm = nstglobalcomm;
     }
 
-    GMX_LOG(mdlog.info).appendTextFormatted(
-            "Intra-simulation communication will occur every %d steps.\n", nstglobalcomm);
+    if (cr->nnodes > 1)
+    {
+        GMX_LOG(mdlog.info).appendTextFormatted(
+                "Intra-simulation communication will occur every %d steps.\n", nstglobalcomm);
+    }
     return nstglobalcomm;
+
 }
 
 void rerun_parallel_comm(t_commrec *cr, t_trxframe *fr,
index 5e57ce7c19906e6fab79023a62c2d7113c791401..b45012de168ee48eb9d001805d8ad4e06ca90389 100644 (file)
@@ -95,7 +95,8 @@ class SimulationSignaller;
  * inputrec and the value of mdrun -gcom. */
 int check_nstglobalcomm(const gmx::MDLogger &mdlog,
                         int                  nstglobalcomm,
-                        t_inputrec          *ir);
+                        t_inputrec          *ir,
+                        const t_commrec    * cr);
 
 /*! \brief Return true if the \p value is equal across the set of multi-simulations
  *
index ee93053af17439e8af65a94aa54a298cdcff8e79..a49a15df53a4246970f4f4a00e542f1c9a7cedbe 100644 (file)
@@ -235,7 +235,7 @@ void gmx::Integrator::do_md()
     const bool bRerunMD      = false;
     int        nstglobalcomm = mdrunOptions.globalCommunicationInterval;
 
-    nstglobalcomm   = check_nstglobalcomm(mdlog, nstglobalcomm, ir);
+    nstglobalcomm   = check_nstglobalcomm(mdlog, nstglobalcomm, ir, cr);
     bGStatEveryStep = (nstglobalcomm == 1);
 
     groups = &top_global->groups;