[gmx-developers] Re: Bug 597 and previous diff: any hint to a confused gromacs source code newbie?

Mark Abraham Mark.Abraham at anu.edu.au
Fri Nov 12 18:13:44 CET 2010


On 12/11/2010 9:26 PM, ms wrote:
> On 12/11/10 01:57, Mark Abraham wrote:
>> On 12/11/2010 7:52 AM, Shirts, Michael (mrs5pt) wrote:
>>> My understanding is that the 4.5.x code has corrected this error
>>> independently from my commit. So what is in the master now is 
>>> correct. So
>>> I assume your question is how to backport the fix into 4.0.7? Someone
>>> correct me if am wrong in either of these assumptions.
>>
>> The code in src/gmxlib/dihres.c is unchanged from that of a year ago
>> (master or release-4-5-patches), so I think this error is not fixed.
>
> Yes, that's what looked like to me on the git web interface.
>
> I also have another question: I actually copied the code snippet 
> (well, I reimplemented it verbatim in Python) and I looked at the 
> potential it generates -at a glance, it seems fully consistent with 
> what is expected, a periodic flat-bottomed harmonic potential centered 
> around phi0... so I am unsure of what is the bug.

As I said in my opening bugzilla comment 
http://bugzilla.gromacs.org/show_bug.cgi?id=597,

> Testing for (fabs(dp)>  dphi) before taking the modulo can't be right.

Per the code there, if:

phi = dphi + 2 * PI - 0.001 - phi0

then

dp = phi - phi0 = dphi + 2 * PI - 0.001

for which the test

fabs(dp) > dphi

is true, when (per manual equation 4.75) dp should be

dp = dphi + 2 * PI - 0.001 [MOD 2*PI]

which is

dp = dphi - 0.001

and that fabs test is false.

Mark

>
>> Mark
>>
>>> Best,
>>> ~~~~~~~~~~~~
>>> Michael Shirts
>>> Assistant Professor
>>> Department of Chemical Engineering
>>> University of Virginia
>>> michael.shirts at virginia.edu
>>> (434)-243-1821
>>>
>>>
>>>> From: ms<devicerandom at gmail.com>
>>>> Date: Thu, 11 Nov 2010 14:59:19 -0500
>>>> To: "gmx-developers at gromacs.org"<gmx-developers at gromacs.org>
>>>> Cc: "michael.shirts at virginia.edu"<michael.shirts at virginia.edu>
>>>> Subject: Bug 597 and previous diff: any hint to a confused gromacs
>>>> source code
>>>> newbie?
>>>>
>>>> Hi,
>>>>
>>>> I have to correct bug 597. To understand if and why, the bugzilla 
>>>> thread
>>>> and the thread on the users mailing list:
>>>> http://lists.gromacs.org/pipermail/gmx-users/2010-October/054950.html
>>>> can help :)
>>>>
>>>> Now, I am trying to make sense of it, but before I noticed that 
>>>> Michael
>>>> Shirts has indeed already tried to fix the code. However the commit 
>>>> was
>>>> part of a huge "mistake" commit from a personal branch, as 
>>>> evidenced in
>>>> this mail:
>>>>
>>>> http://lists.gromacs.org/pipermail/gmx-developers/2010-January/003884.html 
>>>>
>>>>
>>>>
>>>> Now, what I can't make sense of, are:
>>>>
>>>> 1)Is that patch fine to fix bug 597?
>>>>
>>>> 2)Is it enough for me to gather from that commit the dihres.c and
>>>> possibly the (new) functions it calls, and go from there, or is there
>>>> someone (possibly the author) who can explain me what are also the
>>>> relevant parts to patch? It seems to me that it changes quite a lot in
>>>> the file and I don't think I understand it all.
>>>>
>>>> Thanks a lot. While I am an acquainted Python programmer, I have 
>>>> little
>>>> C experience and none with Gromacs source, so bear with me!
>>>>
>>>> Yours truly,
>>>> Massimo
>>>> -- 
>>>> Massimo Sandal, Ph.D.
>>>> http://devicerandom.org
>>
>
>




More information about the gromacs.org_gmx-developers mailing list