Merge branch release-5-1 into release-2016
authorMark Abraham <mark.j.abraham@gmail.com>
Tue, 15 Aug 2017 13:26:34 +0000 (15:26 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 15 Aug 2017 14:40:23 +0000 (16:40 +0200)
Change-Id: Ib769849746a3e55f3e7ae4067f0b6f549e66bd2c

1  2 
docs/user-guide/mdrun-performance.rst
src/gromacs/ewald/pme-load-balancing.cpp
src/gromacs/mdlib/forcerec.cpp
src/programs/mdrun/md.cpp
src/programs/mdrun/mdrun.cpp

Simple merge
index a028c1cb987b011236930bf7075969c2d9996284,b7d45657886015fca3a3a80d0402c002e9f7970f..292624fb4d783b2c356701c8b72837d9e267be6d
@@@ -359,9 -373,47 +361,14 @@@ static gmx_bool pme_loadbal_increase_cu
      }
      else
      {
+         /* TODO Remove these lines and pme_lb->cutoff_scheme */
          tmpr_coulomb          = set->rcut_coulomb + pme_lb->rbuf_coulomb;
          tmpr_vdw              = pme_lb->rcut_vdw + pme_lb->rbuf_vdw;
+         /* Two (known) bugs with cutoff-scheme=group here:
+          * - This modification of rlist results in incorrect DD comunication.
+          * - We should set fr->bTwinRange = (fr->rlistlong > fr->rlist).
+          */
          set->rlist            = std::min(tmpr_coulomb, tmpr_vdw);
 -        set->rlistlong        = std::max(tmpr_coulomb, tmpr_vdw);
 -
 -        /* Set the long-range update frequency */
 -        if (set->rlist == set->rlistlong)
 -        {
 -            /* No long-range interactions if the short-/long-range cutoffs are identical */
 -            set->nstcalclr = 0;
 -        }
 -        else if (pme_lb->nstcalclr_start == 0 || pme_lb->nstcalclr_start == 1)
 -        {
 -            /* We were not doing long-range before, but now we are since rlist!=rlistlong */
 -            set->nstcalclr = 1;
 -        }
 -        else
 -        {
 -            /* We were already doing long-range interactions from the start */
 -            if (pme_lb->rcut_vdw > pme_lb->rcut_coulomb_start)
 -            {
 -                /* We were originally doing long-range VdW-only interactions.
 -                 * If rvdw is still longer than rcoulomb we keep the original nstcalclr,
 -                 * but if the coulomb cutoff has become longer we should update the long-range
 -                 * part every step.
 -                 */
 -                set->nstcalclr = (tmpr_vdw > tmpr_coulomb) ? pme_lb->nstcalclr_start : 1;
 -            }
 -            else
 -            {
 -                /* We were not doing any long-range interaction from the start,
 -                 * since it is not possible to do twin-range coulomb for the PME interaction.
 -                 */
 -                set->nstcalclr = 1;
 -            }
 -        }
      }
  
      set->spacing      = sp;
@@@ -768,7 -820,8 +775,8 @@@ pme_load_balance(pme_load_balancing_
      /* TODO: centralize the code that sets the potentials shifts */
      if (ic->coulomb_modifier == eintmodPOTSHIFT)
      {
-         ic->sh_ewald = std::erfc(ic->ewaldcoeff_q*ic->rcoulomb);
+         GMX_RELEASE_ASSERT(ic->rcoulomb != 0, "Cutoff radius cannot be zero");
 -        ic->sh_ewald = gmx_erfc(ic->ewaldcoeff_q*ic->rcoulomb) / ic->rcoulomb;
++        ic->sh_ewald = std::erfc(ic->ewaldcoeff_q*ic->rcoulomb) / ic->rcoulomb;
      }
      if (EVDW_PME(ic->vdwtype))
      {
index 6b5a102f83a2f9adc68960e8b672e1c253384ca1,dcc0c73cc39a073ac9e4fa5b2b8af21fd82052f0..7c3a56e8133fb23a1148c1f2fdbb186376bf84e2
@@@ -2056,9 -2096,10 +2056,10 @@@ init_interaction_const(FIL
      ic->epsfac           = fr->epsfac;
      ic->ewaldcoeff_q     = fr->ewaldcoeff_q;
  
-     if (fr->coulomb_modifier == eintmodPOTSHIFT)
+     if (EEL_PME_EWALD(ic->eeltype) && ic->coulomb_modifier == eintmodPOTSHIFT)
      {
-         ic->sh_ewald = std::erfc(ic->ewaldcoeff_q*ic->rcoulomb);
+         GMX_RELEASE_ASSERT(ic->rcoulomb != 0, "Cutoff radius cannot be zero");
 -        ic->sh_ewald = gmx_erfc(ic->ewaldcoeff_q*ic->rcoulomb) / ic->rcoulomb;
++        ic->sh_ewald = std::erfc(ic->ewaldcoeff_q*ic->rcoulomb) / ic->rcoulomb;
      }
      else
      {
Simple merge
index 7829a823a444275ed73b151559277993c710e31e,9decf38cf088b6438cdafdff3ea45ca737a46fd5..798f7682742304554848fcc85b505101ffa6cad9
@@@ -370,9 -372,11 +370,9 @@@ int gmx_mdrun(int argc, char *argv[]
          { "-nstlist", FALSE, etINT, {&nstlist},
            "Set nstlist when using a Verlet buffer tolerance (0 is guess)" },
          { "-tunepme", FALSE, etBOOL, {&bTunePME},
-           "Optimize PME load between PP/PME ranks or GPU/CPU" },
+           "Optimize PME load between PP/PME ranks or GPU/CPU (only with the Verlet cut-off scheme)" },
          { "-v",       FALSE, etBOOL, {&bVerbose},
            "Be loud and noisy" },
 -        { "-compact", FALSE, etBOOL, {&bCompact},
 -          "Write a compact log file" },
          { "-pforce",  FALSE, etREAL, {&pforce},
            "Print all forces larger than this (kJ/mol nm)" },
          { "-reprod",  FALSE, etBOOL, {&bReproducible},