<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'><div style="text-align: left;">Hi,<br><br>I now realized that my fix what completely incorrect.<br>I wanted to multiply the margin of 0.0001 by 2, not the factor 0.5.<br>But my mistake means that is now given an error when the off diagonal<br>element is relatively more than 1 instead of more than 0.5.<br>This is a far too weak check.<br>So I would not expect any fatal errors any more with this incorrect check.<br>Therefore I don't understand why you still get errors.<br><br>Could you try changing BOX_MARGIN to 0.5005, as it currently is in version 4.0?<br><br>Berk.<br><br></div><br><br><hr id="stopSpelling">&gt; Date: Wed, 5 Mar 2008 09:40:58 +0100<br>&gt; From: reich@mpikg.mpg.de<br>&gt; To: gmx-users@gromacs.org<br>&gt; Subject: [gmx-users] Skewed box using Parrinello-Rahman pressure coupling<br>&gt; <br>&gt; Hi Berk,<br>&gt; <br>&gt; some of my simulations crashed again, basically with the same error message:<br>&gt; <br>&gt; "Source code file: ns.c, line: 313<br>&gt; <br>&gt; Fatal error:<br>&gt; Could not correct too skewed box"<br>&gt; <br>&gt; Right now I have factored all occurrences of BOX_MARGIN by 2 in<br>&gt; src/gmxlib/pbc.c but kept the original value of 0.5001 for BOX_MARGIN in<br>&gt; include/pbc.h. Could the bug maybe fixed by setting BOX_MARGIN to 0.5005<br>&gt; while multiplying all instances in src/gmxlib/pbc.c by 2?<br>&gt; <br>&gt; <br>&gt; Best<br>&gt; <br>&gt; Luther<br>&gt; <br>&gt; <br>&gt; &gt; All occurrences of BOX_MARGIN in pbc.c should have the factor of 2:<br>&gt; &gt;<br>&gt; &gt; #ifdef ALLOW_OFFDIAG_LT_HALFDIAG<br>&gt; &gt;   else if ((fabs(box[YY][XX])+fabs(box[ZZ][XX])&gt;<br>&gt; 2*BOX_MARGIN*box[XX][XX])<br>&gt; &gt; ||<br>&gt; &gt;            (fabs(box[ZZ][YY])&gt; 2*BOX_MARGIN*box[YY][YY]))<br>&gt; &gt; #else<br>&gt; &gt;   else if ((fabs(box[YY][XX])&gt; 2*BOX_MARGIN*box[XX][XX]) ||<br>&gt; &gt;            (fabs(box[ZZ][XX])&gt; 2*BOX_MARGIN*box[XX][XX]) ||<br>&gt; &gt;            (fabs(box[ZZ][YY])&gt; 2*BOX_MARGIN*box[YY][YY]))<br>&gt; &gt;<br>&gt; &gt; You can leave BOX_MARGIN at 0.5001.<br>&gt; &gt;<br>&gt; &gt; All these things are not critical for correct results.<br>&gt; &gt; The only annoying thing is that the "old" 3.3 code can give a fatal<br>&gt; error<br>&gt; &gt; due to a rounding issue.<br>&gt; &gt;<br>&gt; &gt; Berk.<br>&gt; &gt;<br>&gt; &gt;&gt; Date: Thu, 14 Feb 2008 14:31:15 +0100<br>&gt; &gt;&gt; From: reich@mpikg.mpg.de<br>&gt; &gt;&gt; To: gmx-users@gromacs.org<br>&gt; &gt;&gt; Subject: [gmx-users] Skewed box using Parrinello-Rahman pressure coupling<br>&gt; &gt;&gt; Hi Berk,<br>&gt; &gt;&gt; thanks again. I am not sure though whether I have understood what<br>&gt; modifications you have suggested. In src/gmxlib/pbc.c there are several<br>&gt; occurrences of BOX_MARGIN, some with and some without a factor of two.<br>&gt; Should each occurrence be multiplied by two (so those that have the<br>&gt; factor<br>&gt; &gt;&gt; already are left as they are and all others get multiplied)? Could you<br>&gt; post the lines 71 to 76 of src/gmxlib/pbc.c with the right corrections<br>&gt; so<br>&gt; &gt;&gt; that I can be sure to implement them correctly?<br>&gt; &gt;&gt; Also, should I leave the value for BOX_MARGIN in include/pbc.h at<br>&gt; 0.5005<br>&gt; &gt;&gt; or change it back to 0.5001 ?<br>&gt; &gt;&gt; Best<br>&gt; &gt;&gt; Luther<br>&gt; &gt;&gt; &gt; That good news.<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; While looking at the code again just now,<br>&gt; &gt;&gt; &gt; I realized what the actual problem is.<br>&gt; &gt;&gt; &gt; The check before and after the box correction are both done with<br>&gt; BOX_MARGIN,<br>&gt; &gt;&gt; &gt; which can lead to the problem you observed when the last bit of the<br>&gt; &gt;&gt; box<br>&gt; &gt;&gt; &gt; is rounded in an unlucky fashion. So even with your change the<br>&gt; problem<br>&gt; &gt;&gt; &gt; could still occur.<br>&gt; &gt;&gt; &gt; A real fix is adding a factor 2 (2*) in front of BOX_MARGIN in<br>&gt; src/gmxlib/pbc.c.<br>&gt; &gt;&gt; &gt; I have added this fix for the 3.3.3 release.<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt; Berk.<br>&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;&gt; Date: Wed, 13 Feb 2008 16:37:55 +0100<br>&gt; &gt;&gt; &gt;&gt; From: reich@mpikg.mpg.de<br>&gt; &gt;&gt; &gt;&gt; To: gmx-users@gromacs.org<br>&gt; &gt;&gt; &gt;&gt; Subject: [gmx-users] Skewed box using Parrinello-Rahman pressure<br>&gt; coupling<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; Hi Berk,<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; the change of parameter worked! My simulation finished without<br>&gt; &gt;&gt; crashing.<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; Thanks for your help<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; Luther<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; Dear Gromacs-users,<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; I have been performing simulations with cubic and<br>&gt; &gt;&gt; octahedron-shaped<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; boxes<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; using Parrinello-Rahman pressure coupling. After some time I get<br>&gt; &gt;&gt; the<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; error<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; message "Could not correct too skewed box" and the simulations<br>&gt; &gt;&gt; crash.<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; I set the parameters for the coupling as listed below:<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; pcoupltype               = isotropic<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; tau_p                    = 5.0<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; compressibility          = 5e-5<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; ref_p                    = 1.0<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; I have never encountered the same problems when using Berendsen<br>&gt; &gt;&gt; &gt;&gt; pressure<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; coupling so I suppose I must have made a bad choice for some<br>&gt; &gt;&gt; &gt;&gt; parameter<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; for<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; the Parrinello-Rahman barostat. I tried to equilibrate my system<br>&gt; &gt;&gt; &gt;&gt; using a<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; Berendsen barostat before switching to Parrinello-Rahman for 1ns<br>&gt; &gt;&gt; (and<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; tau_p=1.0) but this didnīt help. Do you have any clue about where<br>&gt; &gt;&gt; the<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; problem originates from?<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; Best<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt;<br>&gt; &gt;&gt; &gt;&gt; &gt;&gt; Luther<br>&gt; &gt;&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;&gt; &gt; I guess this is a rounding issue in the box checking/correcting<br>&gt; &gt;&gt; &gt;&gt; routines.<br>&gt; &gt;&gt; &gt;&gt; &gt; Could you change BOX_MARGIN in include/pbc.h from 0.5001 to<br>&gt; 0.5005,<br>&gt; &gt;&gt; &gt;&gt; &gt; recompile gmxlib, mdlib and mdrun and see if the problem still<br>&gt; &gt;&gt; occurs?<br>&gt; &gt;&gt; &gt;&gt; &gt; Please report back, so we can fix this for 3.3.3.<br>&gt; &gt;&gt; &gt;&gt; &gt;<br>&gt; &gt;&gt; &gt;&gt; &gt; Berk.<br>&gt; <br>&gt; <br>&gt; <br>&gt; _______________________________________________<br>&gt; gmx-users mailing list    gmx-users@gromacs.org<br>&gt; http://www.gromacs.org/mailman/listinfo/gmx-users<br>&gt; Please search the archive at http://www.gromacs.org/search before posting!<br>&gt; Please don't post (un)subscribe requests to the list. Use the <br>&gt; www interface or send it to gmx-users-request@gromacs.org.<br>&gt; Can't post? Read http://www.gromacs.org/mailing_lists/users.php<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>