gmx g_rdf on parallel computer

Hello,

I would like to run the g_rdf command within an MPI environment in order to make use of parallel architecture to speed up calculation. is this even possible? When I tried it says ‘g_rdf” command not found. Here is the full command I used
mpirun gmx_mpi echo 3 3 | g_rdf -f run_0_2.xtc -s run_0_2.tpr -n index_2.ndx -o grOO.xvg

It takes simply too long to run g_rdf on a PC, at least in my case.

Thanks in advance

Hi,

There is a lot to unpack. But, in short, no, gmx rdf is a completely serial program and you cannot speed it up using MPI.

  1. The “command not found” error you are getting is related to the fact that g_rdf has not been a standalone program in GROMACS in over a decade. With GROMACS 5.0 or newer, you need to use gmx rdf.
  2. Even in newer GROMACS versions, gmx rdf cannot benefit from MPI.
  3. The command you are trying to run, mpirun gmx_mpi echo 3 3 | g_rdf, will not run g_rdf in parallel anyway. It will run gmx_mpi echo 3 3 in parallel (which will fail, since echo is not a valid GROMACS command), and then pass the output (that is, an error message) to g_rdf (which, even if it existed, would be started as a single process anyway because it is not launched via mpirun).

Thank you Al42And.
While you are it, could you help me out with the rdf 3 decimal point issue (which I have raised
not long ago). When I started using Gromacs, the rdf data had 5 decimal point. But recently it
has only 3. Is this due to differences in Gromacs versions (I have no control on which versions
our computer staff installs). I recently read a thread that Gromacs 2025 will have 6 digits.
Does the decimal points depend on the way the rdf is computed (trr or xtc file or other options
may be?).
Thanks in advance

I did the following test: from a previous trr file generated by Gromacs 4.5.5 I recalculated the rdf with the newer version (2024 I believe) currently installed in my lab. Gromacs 4.5.5 gave 6 decimal places for the rdf, while the 2024 version gave only 3.
This means that the developpers changed something in newer version which reduced the precision in the rdf calculation - which is dramatic !
Is there a way to contact the appropriate developper and transmit this info?
Perhaps the developpers have added an option to increase the precision in rdf - in that case which? Anybody knows the answer?
Thanks in advance

Hi!

GROMACS 2024 should output 6 decimal places for RDF, not 3. This was announced in a release note for 2024.0. The output precision depends on GROMACS version, not input file type.

Based on your results (3 decimal places), you’re likely running some older version of GROMACS, not 2024. Check your actual version with gmx --version / gmx_mpi --version (whichever you use for rdf: in some installations, they could be different versions).

Hope that helps!

FYI, in ~13 years between v4.5.5 and v2024.0, there were 11673 changes to GROMACS codebase in total. Since year 2014, the rdf tool was directly modified by 11 different people (it’s a bit of a hassle to look deeper into the history). While it’s definitely possible to find where the change from 5 to 3 digits happened in that time, that would require some software archeology.

1 Like