Recovery from Magic number missing (trr write error?)

GROMACS version: GROMACS 2020
GROMACS modification: No

I have a 36GB simulation file and a 100GB file that represents an extension of the original simulation that has been successfully running for a few days (with multiple successful checkpoint based restarts) but now that the simulation is complete when I try to concat the two files together I am getting a “magic number” error. It seems I can gmx dump the first 155 frames without any issues, but I am not sure if there is any way to recover from this. If it was an xtc I would just use gmx rescue (from years gone by), but I am not sure if this will work for trr’s generated by gromacs 2020.

Any thoughts?


Does gmx trjconv -e time_where_corrupted help you to cut away the part that is corrupted?

I can cut up to the corrupted portion but I can’t skip over the corrupted frames using gmx trjcat.

Using split and a hex editor (thanks to someone in my group) we could manually rescue the trajectories (after 4 ‘broken/corrupted’ frames the rest of the trajectory was fine), but we’ve not come up with a way to automate this in case it happens again in the future.

gmxrescue was a small program that could be used to skip over bad XTC parts. Together with trjcat you could reconstuct a good trajectory with only a few frames missing.

One of my students worked with gmxrescue a while back when we had widespread trajectory corruption due to file transfer issues; see — see if this does anything for you, but no promises. We haven’t really used it since we put it up and it’s not really supported by us.

(A very long time ago in a country far, far away I modified a version of gmxrescue to work on 64 bit; it is possible that the source code is still available at ; I haven’t looked at it for at least 10 years so apart from the link there’s not much else I can contribute. I think the source in the GitHub repo is the same as the one at that link.)


This is great! Thank you for the source code. I was trying to modify gmx rescue also so it is nice to see someone else’s take as well.