<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (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:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
 /* 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:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.5pt;
        font-family:Consolas;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:Consolas;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoPlainText>Thanks Mark for your quick response and your suggestion.&nbsp;
I decreased <o:p></o:p></p>

<p class=MsoPlainText>the density of data points in each of my 274 table*.xvg
files <o:p></o:p></p>

<p class=MsoPlainText>(3 tables for each molecule and one table for all the
other atoms) by a factor of 10.<o:p></o:p></p>

<p class=MsoPlainText>I did notice a small increase in speed (1.584 ns/day to
1.590 ns/day), but obviously <o:p></o:p></p>

<p class=MsoPlainText>not as fast as without tables (~25ns/day). <o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>If there are other suggestions for speeding up the
simulations with a large number <o:p></o:p></p>

<p class=MsoPlainText>of tables (user-defined potentials), I would be more than
grateful.&nbsp; <o:p></o:p></p>

<p class=MsoPlainText>Again, thanks in advance for your help!<o:p></o:p></p>

<p class=MsoPlainText><o:p>&nbsp;</o:p></p>

<p class=MsoPlainText>Eli<o:p></o:p></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;&gt;Musselman,
Eli D wrote:<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;&gt;<i>
This works great but ***here&#8217;s the problem*** : *the simulations run <o:p></o:p></i></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;&gt;<i>
exceedingly slow when I use such a high number of defined
&#8216;energygrps&#8217;*. <o:p></o:p></i></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;&gt;<i>&nbsp;
Without using the user defined potential functions I was getting <o:p></o:p></i></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;&gt;<i>
roughly 25 ns/day (which, as always with GROMACS, is amazingly fast!).&nbsp; <o:p></o:p></i></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;&gt;<i>&nbsp;
With the applied potential functions and &#8216;energygrps&#8217; however I am
only <o:p></o:p></i></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;&gt;<i>
getting&nbsp; 1.5 ns/day.&nbsp; I thought one problem might be the number of
times <o:p></o:p></i></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;&gt;<i>
that &#8216;mdrun&#8217; spends writing to the energy (.edr) file, but I have
ruled <o:p></o:p></i></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;&gt;<i>
this out as a possibility because when I increased my &#8216;nstenergy&#8217;
in my <o:p></o:p></i></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;&gt;<i>
*.mdp file by 100 fold &#8216;mdrun&#8217; still runs at the same slow
rate.&nbsp; The <o:p></o:p></i></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;&gt;<i>
slowdown therefore appears to be directly related to the number of <o:p></o:p></i></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;&gt;<i>
&#8216;energygrps.&#8217;. To confirm this, I decreased the number of
&#8216;energygrps&#8217; <o:p></o:p></i></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;&gt;<i>
to 3 (by lumping all &#8216;C1&#8217; and &#8216;C2&#8217; atoms together into
one &#8216;energygrp&#8217; <o:p></o:p></i></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;&gt;<i>
and all &#8216;O1&#8217; and &#8216;O2&#8217; atoms into another
&#8216;energygrp&#8217;) and this <o:p></o:p></i></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;&gt;<i>
accelerated&nbsp; the simulations dramatically; however, the same user <o:p></o:p></i></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;&gt;<i>
defined potential functions are then applied to both **intra** and <o:p></o:p></i></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;&gt;<i>
**inter**molecular interactions, which is not what I want!<o:p></o:p></i></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;<o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;Good
diagnostics and description, thanks. It seems quite likely to me <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;that
this slowdown will be related to cache misses. 95 tables actually <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;uses
an appreciable amount of memory. More salient for the inner loops, <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;however
is that each time a new table is being used in each integration <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;step,
the code will have to go and fetch locations from main memory, and <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;when
these hit the caches they won't be reused much.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;<o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;The
only simple work-around I can suggest is to decrease the density of <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;data
points in the table. That will degrade the accuracy, but possibly <o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;lead
to fewer cache misses.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;<o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>&gt;Mark<o:p></o:p></span></p>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>