<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
Hi,<br><br>Apparently I didn't try to compile it myself, there is a pointer dereference missing.<br>Pleae try the fix below.<br><br>Cheers,<br><br>Berk<br><br>--- a/src/tools/gmx_bar.c<br>+++ b/src/tools/gmx_bar.c<br>@@ -2049,7 +2049,7 @@ static void read_bar_xvg(char *fn, real *temp, lambda_t *lambda_head)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gmx_fatal(FARGS,"File '%s' contains fewer than two columns", fn);<br>&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;<br>-&nbsp;&nbsp;&nbsp; if ( ( *temp != barsim-&gt;temp) &amp;&amp; (*temp &gt; 0) )<br>+&nbsp;&nbsp;&nbsp; if ( !gmx_within_tol(*temp,barsim-&gt;temp,GMX_FLOAT_EPS) &amp;&amp; (*temp &gt; 0) )<br>&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gmx_fatal(FARGS,"Temperature in file %s different from earlier files or setting\n", fn);<br>&nbsp;&nbsp;&nbsp;&nbsp; }<br><br><br><div><div id="SkyDrivePlaceholder"></div>&gt; Date: Tue, 20 Mar 2012 09:23:38 +0100<br>&gt; From: tomkirch@mis.mpg.de<br>&gt; To: gmx-users@gromacs.org<br>&gt; Subject: [gmx-users] Re: RE: problem with g_bar<br>&gt; <br>&gt; Hi Berk,<br>&gt; <br>&gt; Thanks a lot for your answer.<br>&gt; <br>&gt; I changed the line and recompiled Gromacs, sadly I got this error:<br>&gt; <br>&gt; gmx_bar.c: In function "read_bar_xvg":<br>&gt; gmx_bar.c:2052:5: error: incompatible type for argument 1 of <br>&gt; "gmx_within_tol"<br>&gt; ../../include/maths.h:125:1: note: expected "double" but argument is of <br>&gt; type "real *"<br>&gt; make[3]: *** [gmx_bar.lo] Error 1<br>&gt; <br>&gt; Best,<br>&gt; Tom<br>&gt; <br>&gt; On 03/20/2012 03:15 AM, gmx-users-request@gromacs.org wrote:<br>&gt; &gt; ------------------------------ Message: 3 Date: Mon, 19 Mar 2012 <br>&gt; &gt; 18:34:31 +0100 From: Berk Hess &lt;gmx3@hotmail.com&gt; Subject: RE: <br>&gt; &gt; [gmx-users] problem with g_bar To: Discussion list for GROMACS users <br>&gt; &gt; &lt;gmx-users@gromacs.org&gt; Message-ID: <br>&gt; &gt; &lt;COL113-W32C019BA58913FEC173E168E420@phx.gbl&gt; Content-Type: <br>&gt; &gt; text/plain; charset="iso-8859-1" Hi, Yes, there is a problem with <br>&gt; &gt; different temperature variables being single and double precision. <br>&gt; &gt; Does the one line change below fix the problem? Cheers, Berk - if ( ( <br>&gt; &gt; *temp != barsim-&gt;temp) &amp;&amp; (*temp &gt; 0) ) + if ( <br>&gt; &gt; !gmx_within_tol(temp,barsim-&gt;temp,GMX_FLOAT_EPS) &amp;&amp; (*temp &gt; 0) )<br>&gt; &gt;&gt; &gt;  Date: Mon, 19 Mar 2012 13:57:51 +0100<br>&gt; &gt;&gt; &gt;  From:tomkirch@mis.mpg.de<br>&gt; &gt;&gt; &gt;  To:gmx-users@gromacs.org<br>&gt; &gt;&gt; &gt;  Subject: [gmx-users] problem with g_bar<br>&gt; &gt;&gt; &gt;  <br>&gt; &gt;&gt; &gt;  Dear all,<br>&gt; &gt;&gt; &gt;  <br>&gt; &gt;&gt; &gt;  Recently I posted my problem with g_bar on this mailing list but got no<br>&gt; &gt;&gt; &gt;  solution for it. After additional testing I decided to send an enhanced<br>&gt; &gt;&gt; &gt;  description of my problem.<br>&gt; &gt;&gt; &gt;  <br>&gt; &gt;&gt; &gt;  I am doing Free Energy calculation. The dhdl values are put in separate<br>&gt; &gt;&gt; &gt;  .xvg files. The routine g_bar is then started using:<br>&gt; &gt;&gt; &gt;  <br>&gt; &gt;&gt; &gt;  g_bar -b 100 -f md_*.xvg -o -oi -oh<br>&gt; &gt;&gt; &gt;  <br>&gt; &gt;&gt; &gt;  With the result:<br>&gt; &gt;&gt; &gt;  <br>&gt; &gt;&gt; &gt;  Program g_bar, VERSION 4.5.5<br>&gt; &gt;&gt; &gt;  Source code file: .../src/gromacs-4.5.5/src/tools/gmx_bar.c, line: 2054<br>&gt; &gt;&gt; &gt;  <br>&gt; &gt;&gt; &gt;  Fatal error:<br>&gt; &gt;&gt; &gt;  Temperature in file md_0.05.xvg different from earlier files or setting<br>&gt; &gt;&gt; &gt;  <br>&gt; &gt;&gt; &gt;  <br>&gt; &gt;&gt; &gt;  Checking the header of all .xvg files showed the same line for the<br>&gt; &gt;&gt; &gt;  temperature for all files:<br>&gt; &gt;&gt; &gt;  <br>&gt; &gt;&gt; &gt;  @ subtitle "T = 298.15 (K), \xl\f{} = 0.025"<br>&gt; &gt;&gt; &gt;  <br>&gt; &gt;&gt; &gt;  Changing the temperature manually to any integer (but still with .0) let<br>&gt; &gt;&gt; &gt;  g_bar run fine.<br>&gt; &gt;&gt; &gt;  <br>&gt; &gt;&gt; &gt;  sed -i 's/T\ \=\ 298.15/T\ \=\ 298.0/g' md*<br>&gt; &gt;&gt; &gt;  <br>&gt; &gt;&gt; &gt;  Do you have any suggestions what's wrong here?<br>&gt; &gt;&gt; &gt;  <br>&gt; &gt;&gt; &gt;  I'm not that familiar with C, but my suggestion would be an error with<br>&gt; &gt;&gt; &gt;  floating point arithmetic in line 2052 of gmx_bar.c<br>&gt; &gt;&gt; &gt;  <br>&gt; &gt;&gt; &gt;        if ( ( *temp != barsim-&gt;temp)&amp;&amp;  (*temp&gt;  0) )<br>&gt; &gt;&gt; &gt;  <br>&gt; &gt;&gt; &gt;  where *temp and barsim-&gt;temp are compared. Maybe it has something to do<br>&gt; &gt;&gt; &gt;  with the input as long double (%lf) and statement "real *temp" in the<br>&gt; &gt;&gt; &gt;  function header?<br>&gt; &gt;&gt; &gt;  <br>&gt; &gt;&gt; &gt;  I appreciate any hints.<br>&gt; &gt;&gt; &gt;  <br>&gt; &gt;&gt; &gt;  Best regards<br>&gt; &gt;&gt; &gt;  Tom<br>&gt; <br>&gt; -- <br>&gt; gmx-users mailing list    gmx-users@gromacs.org<br>&gt; http://lists.gromacs.org/mailman/listinfo/gmx-users<br>&gt; Please search the archive at http://www.gromacs.org/Support/Mailing_Lists/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/Support/Mailing_Lists<br></div>                                               </div></body>
</html>