[gmx-users] converting cpt between single and double precision

Mark Abraham Mark.Abraham at anu.edu.au
Thu Aug 18 02:31:13 CEST 2011


On 18/08/2011 3:07 AM, Peter C. Lai wrote:
> On 2011-08-16 08:16:52PM -0500, Mark Abraham wrote:
>> On 17/08/2011 6:13 AM, Peter C. Lai wrote:
>>> Is there a way to convert between single and double precision cpt files so
>>> I can use double precision grompp on it to change some parameters but still
>>> keep state information for continuity?
>>>
>>> Or can I just trjconv_d the last frame of the single precision trr and feed
>>> that to grompp -t?
>>>
>>> (A machine I am using for preprocessing only has double precision tools and
>>> it would be difficult to have both versions installed.)
>> Any GROMACS tool can read any of its binary formats written in either
>> precision, and write only in the precision with which the tool was compiled.
>>
> The problem is that when I use a double precision grompp and -t a single
> precision .cpt, I get notices that it is discarding state data due to the
> precision mismatch.
> This is on 4.5.4:
>
> Will read whole trajectory
> Velocities generated: ignoring velocities in input trajectory
> Precision mismatch for state entry box, code precision is double, file precision is float
> Precision mismatch for state entry box-rel, code precision is double, file precision is float
> Precision mismatch for state entry box-v, code precision is double, file precision is float
> Precision mismatch for state entry pres_prev, code precision is double, file precision is float
> Precision mismatch for state entry x, code precision is double, file precision is float
> Precision mismatch for state entry v, code precision is double, file precision is float
>
> the gmxdump of the resuling tpr confirms this:
> boxv (3x3):
>     boxv[    0]={ 0.00000e+00,  0.00000e+00,  0.00000e+00}
>     boxv[    1]={ 0.00000e+00,  0.00000e+00,  0.00000e+00}
>     boxv[    2]={ 0.00000e+00,  0.00000e+00,  0.00000e+00}
> pres_prev (3x3):
>     pres_prev[    0]={ 0.00000e+00,  0.00000e+00,  0.00000e+00}
>     pres_prev[    1]={ 0.00000e+00,  0.00000e+00,  0.00000e+00}
>     pres_prev[    2]={ 0.00000e+00,  0.00000e+00,  0.00000e+00}
> svir_prev (3x3):
>     svir_prev[    0]={ 0.00000e+00,  0.00000e+00,  0.00000e+00}
>     svir_prev[    1]={ 0.00000e+00,  0.00000e+00,  0.00000e+00}
>     svir_prev[    2]={ 0.00000e+00,  0.00000e+00,  0.00000e+00}
> fvir_prev (3x3):
>     fvir_prev[    0]={ 0.00000e+00,  0.00000e+00,  0.00000e+00}
>     fvir_prev[    1]={ 0.00000e+00,  0.00000e+00,  0.00000e+00}
>     fvir_prev[    2]={ 0.00000e+00,  0.00000e+00,  0.00000e+00}
> nosehoover_xi: not available
>
> Interestingly enough, box and box_rel are preserved, despite the messages
> to the contrary, but of course, the majority of the reason to use .cpt
> is to transfer the velocities and virial...
>

OK, that seems inconsistent. I would suppose there should be some 
capacity to interconvert precision by truncation/extension of the 
precision of these values - perhaps with a command line option to force 
that. Please file an issue at redmine.gromacs.org attaching input files 
and how to reproduce the issue.

Mark



More information about the gromacs.org_gmx-users mailing list