<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hi,<br>
      <br>
      You are right. I filed a redmine issue:<br>
      <a class="moz-txt-link-freetext" href="http://redmine.gromacs.org/issues/1916">http://redmine.gromacs.org/issues/1916</a><br>
      And I uploaded a fix for the release-5-0 branch:<br>
      <a class="moz-txt-link-freetext" href="https://gerrit.gromacs.org/#/c/5701/">https://gerrit.gromacs.org/#/c/5701/</a><br>
      <br>
      Thanks for reporting this.<br>
      <br>
      Cheers,<br>
      <br>
      Berk<br>
      <br>
      On 03/08/2016 04:11 AM, Sheng Bi wrote:<br>
    </div>
    <blockquote cite="mid:56DE440E.044462.31937@mail.hust.edu.cn"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator" content="Microsoft Word 15 (filtered
        medium)">
      <style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.WordSection1
        {page:WordSection1;}
--></style>
      <div class="WordSection1">
        <p class="MsoNormal">Here we find gromacs goes wrong when using
          verlet and 3dc an run in parallel.</p>
        <p class="MsoNormal">For slab geometry, we need to do slab
          correction based on total charge dipole ( mu_tot=sum(qi*zi) ).
          If one performs such simulation in gromacs with Verlet and 3dc
          in parallel (especially using domain decomposition), the
          mu_tot is wrong. For example, if you run simulation in 16
          core, and the right global charge dipole is A, however in gmx
          4.6 and higher each core would get 16*A!</p>
        <p class="MsoNormal">I think the problem come out on this
          communication, for version 4.6, gmx sum charge dipole twice.
          In sim_util.c, line 1052:</p>
        <p class="MsoNormal">            /* When we don't need the total
          dipole we sum it in global_stat */</p>
        <p class="MsoNormal">            if (bStateChanged &amp;&amp;
          NEED_MUTOT(*inputrec))</p>
        <p class="MsoNormal">            {</p>
        <p class="MsoNormal">                gmx_sumd(2*DIM, mu, cr);</p>
        <p class="MsoNormal">            }</p>
        <p class="MsoNormal">if using domain decomposition, gmx will sum
          the dipole for the first time. However in line 1090:</p>
        <p class="MsoNormal">     if (bStateChanged &amp;&amp;
          NEED_MUTOT(*inputrec))</p>
        <p class="MsoNormal">    {</p>
        <p class="MsoNormal">        if (PAR(cr))</p>
        <p class="MsoNormal">        {</p>
        <p class="MsoNormal">            gmx_sumd(2*DIM, mu, cr);</p>
        <p class="MsoNormal">        }</p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">        for (i = 0; i &lt; 2; i++)</p>
        <p class="MsoNormal">        {</p>
        <p class="MsoNormal">            for (j = 0; j &lt; DIM; j++)</p>
        <p class="MsoNormal">            {</p>
        <p class="MsoNormal">                fr-&gt;mu_tot[i][j] =
          mu[i*DIM + j];</p>
        <p class="MsoNormal">            }</p>
        <p class="MsoNormal">        }</p>
        <p class="MsoNormal">    }</p>
        <p class="MsoNormal">gmx sum the dipole for second time only if
          run in parallel. So, if you perform simulation in 3dc with
          verlet and in domain decomposition, the mu_tot will go wrong.</p>
        <p class="MsoNormal">Since we performed a lot of slab geometry
          simulatin and gmx worked perfect in version 3.3 and 4.5, when
          we use 4.6 and higher, we find this problem. Is this a bug or
          my setup error in mdp<span style="font-family:DengXian"
            lang="ZH-CN">?</span></p>
        <p class="MsoNormal"><o:p> </o:p></p>
        <p class="MsoNormal">--<br>
          PhD student<br>
          State Key Laboratory of Coal Combustion,<br>
          School of Energy and Power Engineering,<br>
          Huazhong University of Science and Technology (HUST),<br>
          Room 302 Power Building, <br>
          1037 Luoyu Road, Wuhan, Hubei 430074 China<br>
          Email: <a class="moz-txt-link-abbreviated" href="mailto:chrishengbee@hust.edu.cn">chrishengbee@hust.edu.cn</a><br>
          Phone: (86)27-87548122 <br>
          <a class="moz-txt-link-freetext" href="http://itp.energy.hust.edu.cn">http://itp.energy.hust.edu.cn</a> </p>
        <p class="MsoNormal"><span
            style="font-size:12.0pt;font-family:&quot;Times New
            Roman&quot;,serif"><o:p> </o:p></span></p>
        <p class="MsoNormal"><o:p> </o:p></p>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    <br>
  </body>
</html>