<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
<br><br>&gt; Date: Wed, 26 Nov 2008 17:25:10 +0100<br>&gt; From: H.J.risselada@rug.nl<br>&gt; To: gmx-users@gromacs.org<br>&gt; Subject: Re: [gmx-users] Bugs in gromacs 4<br>&gt; <br>&gt; Jochen Hub wrote:<br>&gt; &gt; Jelger Risselada wrote:<br>&gt; &gt;   <br>&gt; &gt;&gt; Finally had a look through the gromacs 4.0 source code.<br>&gt; &gt;&gt; Don't know if this bug/points already have been reported and changed in<br>&gt; &gt;&gt; 4.0.2:<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; 1) There is never memory allocated for the pointers to the user defined<br>&gt; &gt;&gt; groups:<br>&gt; &gt;&gt;<br>&gt; &gt;&gt; mdatoms-&gt;cU1 etc.<br>&gt; &gt;&gt;     <br>&gt; &gt;<br>&gt; &gt; I'm not sure, but there is a<br>&gt; &gt;<br>&gt; &gt;     /* The user should fix this */<br>&gt; &gt;     if (FALSE)<br>&gt; &gt;       srenew(md-&gt;cU1,md-&gt;nalloc);<br>&gt; &gt;     if (FALSE)<br>&gt; &gt;       srenew(md-&gt;cU2,md-&gt;nalloc);<br>&gt; &gt;<br>&gt; &gt; in ./src/mdlib/mdatom.c.<br>&gt; &gt;<br>&gt; &gt; You can remove the FALSE and get the memory allocation, I guess.<br>&gt; &gt;<br>&gt; &gt; Jochen<br>&gt; &gt;<br>&gt; &gt;   <br>&gt; A hardcoded if(FALSE)  in the middle of no where with the command /*The <br>&gt; user should fix this */ .<br>&gt; How flexible...... ;-)<br>&gt; <br>&gt; greetings<br>&gt; <br>&gt; Jelger<br><br>That could indeed be done a bit more elegantly.<br>I committed a proper solution (see below).<br><br>Berk<br><br>&nbsp;&nbsp;&nbsp; /* Note that these user t_mdatoms array pointers are NULL<br>&nbsp;&nbsp;&nbsp;&nbsp; * when there is only one group present.<br>&nbsp;&nbsp;&nbsp;&nbsp; * Therefore, when adding code, the user should use something like:<br>&nbsp;&nbsp;&nbsp;&nbsp; * gprnrU1 = (md-&gt;cU1==NULL ? 0 : md-&gt;cU1[localatindex])<br>&nbsp;&nbsp;&nbsp;&nbsp; */<br>&nbsp;&nbsp;&nbsp; if (mtop-&gt;groups.grpnr[egcUser1] != NULL)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; srenew(md-&gt;cU1,md-&gt;nalloc);<br>&nbsp;&nbsp;&nbsp; if (mtop-&gt;groups.grpnr[egcUser2] != NULL)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; srenew(md-&gt;cU2,md-&gt;nalloc);<br><br><br /><hr />Express yourself instantly with MSN Messenger! <a href='http://clk.atdmt.com/AVE/go/onm00200471ave/direct/01/' target='_new'>MSN Messenger</a></body>
</html>