Project

General

Profile

Bug #17

Double precision gromacs truncates in memory coordinates to single precision when writting XTC file.

Added by Ramon Garcia almost 15 years ago. Updated almost 15 years ago.

Status:
Closed
Priority:
High
Assignee:
Erik Lindahl
Category:
mdrun
Target version:
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

When mdrun_d writes an xtc file, in addition to the obvious truncation of the
data stored in disk, Gromacs also truncates the coordinates stored in the
simulation state.

I noticed because I am modifying Gromacs implementation of Rahman Parrinello. I
noticed some unexpected changes in state->x0 and so placed a watchpoint in the
debugger, which showed that the routine xdr3drcoord in xdrd.c truncates not only
the coordinates that will be stored in disk, but also the original copy of the
simulation state.

I deleted the code that copies the truncated coordinates to the original copy
received by the routine. That is, I removed the lines

for(i=0; (i<isize); i++)
fp[i]=ffp[i];

But I am not sure if this change is correct. Is this routine supposed to return
the modified coordinates to report the caller? In that case the caller should
have made a copy.

Note that this problem can affect the correctness of simulations in double
precision.

History

#1 Updated by Erik Lindahl almost 15 years ago

Fixed in 3.3 branch.

Also available in: Atom PDF