<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.
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> </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. <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> </o:p></p>
<p class=MsoPlainText>Eli<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>>>Musselman,
Eli D wrote:<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>>><i>
This works great but ***here’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"'>>><i>
exceedingly slow when I use such a high number of defined
‘energygrps’*. <o:p></o:p></i></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>>><i>
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"'>>><i>
roughly 25 ns/day (which, as always with GROMACS, is amazingly fast!). <o:p></o:p></i></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>>><i>
With the applied potential functions and ‘energygrps’ however I am
only <o:p></o:p></i></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>>><i>
getting 1.5 ns/day. 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"'>>><i>
that ‘mdrun’ 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"'>>><i>
this out as a possibility because when I increased my ‘nstenergy’
in my <o:p></o:p></i></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>>><i>
*.mdp file by 100 fold ‘mdrun’ still runs at the same slow
rate. The <o:p></o:p></i></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>>><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"'>>><i>
‘energygrps.’. To confirm this, I decreased the number of
‘energygrps’ <o:p></o:p></i></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>>><i>
to 3 (by lumping all ‘C1’ and ‘C2’ atoms together into
one ‘energygrp’ <o:p></o:p></i></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>>><i>
and all ‘O1’ and ‘O2’ atoms into another
‘energygrp’) and this <o:p></o:p></i></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>>><i>
accelerated 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"'>>><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"'>>><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"'>><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>>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"'>>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"'>>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"'>>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"'>>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"'>>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"'>><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>>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"'>>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"'>>lead
to fewer cache misses.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:10.0pt;font-family:"Courier New"'>>Mark<o:p></o:p></span></p>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>