Hi,<div><br></div><div>it is caused by gcc using expf instead of exp.</div><div><br></div><div>By changing pme.c in the two places where exp is called this way:</div><div><div>-                    tmp1[kx]  = exp(tmp1[kx]);</div>


<div>+                    double t = tmp1[kx];</div><div>+                    tmp1[kx]  = exp(t);</div><div>                 </div><div>gcc 4.3.4 is as fast as gcc 4.4.2. </div><div><br></div><div>See also <a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35202" target="_blank">http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35202</a></div>


<div>(The bug is not related to performance but it discusses the replacement from exp-&gt;expf)</div><div><br></div><div>But what I don&#39;t understand at all is why expf is so much slower (expf 7-8x as slow in pme.c than exp (*)). A small test program which computes exp on an array, compiled with gcc 4.3.4 is actually faster than with 4.4.2 (30%). Thus for the test-program the expf seams to be faster. Why expf is so slow in pme.c is odd.</div>


<div><br></div><div>*) Got that measurement form HPCToolkit. Shows performance line-by-line. Thus it was easy to pin-point the cause.</div><div><br></div><div>Roland</div><div>                 </div></div><div><br><div class="gmail_quote">


On Fri, May 14, 2010 at 10:43 AM, Berk Hess <span dir="ltr">&lt;<a href="mailto:hess@cbr.su.se" target="_blank">hess@cbr.su.se</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


Hi,<br>
<br>
The PME code in git master is a lot faster than the current 4.0.7<br>
release code.<br>
However, there seems to be a bug in gcc version 4.3.3 and 4.3.4 (4.3.2<br>
and 4.4.1 are fine)<br>
that make the pme_solve part 5 times (!) slower than with proper<br>
compiler versions.<br>
This is between 10% and 20% of the total mdrun performance.<br>
We are currently trying to figure out what triggers this issue and we<br>
are sending<br>
a bug report to the gcc mailing list.<br>
<br>
I someone has a hint, please reply.<br>
<br>
Berk<br>
<font color="#888888"><br>
--<br>
gmx-developers mailing list<br>
<a href="mailto:gmx-developers@gromacs.org" target="_blank">gmx-developers@gromacs.org</a><br>
<a href="http://lists.gromacs.org/mailman/listinfo/gmx-developers" target="_blank">http://lists.gromacs.org/mailman/listinfo/gmx-developers</a><br>
Please don&#39;t post (un)subscribe requests to the list. Use the<br>
www interface or send it to <a href="mailto:gmx-developers-request@gromacs.org" target="_blank">gmx-developers-request@gromacs.org</a>.<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>ORNL/UT Center for Molecular Biophysics <a href="http://cmb.ornl.gov" target="_blank">cmb.ornl.gov</a><br>865-241-1537, ORNL PO BOX 2008 MS6309<br>
</div>