Standard library logic error in GMX MSD

GROMACS version: 2023
GROMACS modification: No

Hello all,

I am attempting to calculate the mean square displacement for a single molecule in a cubic waterbox (4.5 nm side length). When running gmx msd, I get a standard library logic error:

>$ gmx msd -f bulk_md.trr -s bulk_md.tpr -o bulk_md_msd.xvg -n bulk.ndx

                    :-) GROMACS - gmx msd, 2023 (-:

Executable: /usr/local/gromacs-2023/bin/gmx
Data prefix: /usr/local/gromacs-2023
Working dir: /mnt/3a29b482-dac1-4563-be89-d63ad92354e9/membrane_permeation/solutes/BRIBP
Command line:
gmx msd -f bulk_md.trr -s bulk_md.tpr -o bulk_md_msd.xvg -n bulk.ndx

Available static index groups:
Group 0 “System” (9376 atoms)
Group 1 “LIG” (20 atoms)
Group 2 “BRI” (20 atoms)
Group 3 “NA” (1 atoms)
Group 4 “CL” (1 atoms)
Group 5 “Water” (9354 atoms)
Group 6 “SOL” (9354 atoms)
Group 7 “non-Water” (22 atoms)
Group 8 “Ion” (2 atoms)
Group 9 “Water_and_ions” (9356 atoms)
Specify any number of selections for option ‘sel’
(Selections to compute MSDs for from the reference):
(one per line, for status/groups, ‘help’ for help, Ctrl-D to end)

1
Selection ‘1’ parsed
Reading file bulk_md.tpr, VERSION 2023 (single precision)
Reading file bulk_md.tpr, VERSION 2023 (single precision)
trr version: GMX_trn_file (single precision)
Reading frame 1 time 0.001


Program: gmx msd, version 2023

Standard library logic error (bug):
(exception type: St12length_error)
vector::_M_default_append

I am able to parse the tpr and trr files with gmx velacc, so I’m confident the files are not corrupted.

Could anyone suggest what might be causing this error?

Hi,

One possibility is that your trajectory is saved with sub-picosecond frequency. gmx msd cannot handle such inputs in GROMACS 2023.

GROMACS 2023.4 and newer produce a proper warning, and GROMACS 2025.0 and newer can process such trajectories fine.

Please try with a newer GROMACS version. If you still see the problem with GROMACS 2025.3, please share a small sample of your trajectory so that we can reproduce and debug the issue.