Skip to content

Gromacs tpr gives EOF error with version 2.10.0 not with 2.9.0 #5145

@hsantila

Description

@hsantila

Expected behavior

Error-free read-in of gromacs trajectory and tpr to the universe

Actual behavior

The 2.10.0 topology-utility gives an EOF error for few gromacs version 100 tprs I tested, not with all of them. Works without issues in 2.9.0. Haven't been able to figure out what is the difference between topologies that work and those which don't but it seems possible that issue is related to added velocity/positions-functionality in 2.10.0 (#4873). The universe is created fine when using .gro-file as the topology instead. The error is as follows:

Code to reproduce the behavior

>>> import MDAnalysis as mda
>>> import pkg_resources
>>> u=mda.Universe('281.tpr','281.xtc')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/databank_dev/lib/python3.11/site-packages/MDAnalysis/core/universe.py", line 569, in __init__
    topology = _topology_from_file_like(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/databank_dev/lib/python3.11/site-packages/MDAnalysis/core/universe.py", line 229, in _topology_from_file_like
    topology = p.parse(**kwargs)
               ^^^^^^^^^^^^^^^^^
  File "/databank_dev/lib/python3.11/site-packages/MDAnalysis/topology/TPRParser.py", line 250, in parse
    tpr_top = tpr_utils.do_mtop(
              ^^^^^^^^^^^^^^^^^^
  File "/databank_dev/lib/python3.11/site-packages/MDAnalysis/topology/tpr/utils.py", line 473, in do_mtop
    ndo_real(data, 4)
  File "/home/hant23/databank_dev/lib/python3.11/site-packages/MDAnalysis/topology/tpr/utils.py", line 189, in ndo_real
    return [data.unpack_real() for i in range(n)]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hant23/databank_dev/lib/python3.11/site-packages/MDAnalysis/topology/tpr/utils.py", line 189, in <listcomp>
    return [data.unpack_real() for i in range(n)]
            ^^^^^^^^^^^^^^^^^^
  File "/home/hant23/databank_dev/lib/python3.11/site-packages/mda_xdrlib/xdrlib.py", line 192, in unpack_float
    raise EOFError
EOFError
>>> pkg_resources.get_distribution('MDAnalysis').version
'2.10.0'

The tpr is here: 10.5281/zenodo.11614468

Current version of MDAnalysis

  • Which version are you using? 2.9.0 (works fine) and 2.10.0 (causes the issue)
  • Which version of Python 3.11
  • Which operating system? Linux (Debian 6.1.147-1 (2025-08-02) x86_64 GNU/Linux)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions