Suppress grompp/mdrun output files or support /dev/null output

GROMACS version: 2021
GROMACS modification: No

Is there a way to suppress some file output of the gmx tools? For example: grompp always write mdout.mdp (or some file set by the -po option), mdrun always outputs a .gro file.

I’m currently implementing a forcefield fitting tool which requires many (~10^5) runs of grompp and mdrun and doesn’t use mdout.mdp generated by grompp and may or may not use each .gro, .xtc and/or .trr files. Since most runs are quick EM runs which take less than a minute each, file reading/writing overhead is relevant compared to CPU time, especially in networked filesystems (LUSTRE does not like 10^5 small files!). Disk space is also affected and my code does some garage collecting, which adds even more IO overhead.

I didn’t find an obvious way to suppress those output files, since omitting the option sets a default value (mdout.mdp, ener.edr and so on) and adding /dev/null sometomes fail because the command line parser slaps on the extension:

$ gmx grompp -f NPT.mdp -c naphtalene_biphasic.gro -p naphtalene_biphasic.top -o naph -po /dev/null
[...]
System I/O error:
Could not open file '/dev/null.mdp'
  Reason: Permission denied
  (call to fopen() returned error code 13)

I intend to write a bug report/feature request in redmine and maybe make a PR with a fix, but first I’d like to know if I’m missing something.

Thanks!

You can eliminate the mdout.mdp file by changing it to be optional (requires modifying the source and recompiling) in src/gromacs/gmxpreprocess/grompp.cpp

{ efMDP, "-po", "mdout", ffWRITE },

to:

{ efMDP, "-po", "mdout", ffOPTWR },

You can suppress output from mdrun fairly easily, by setting output intervals of 0 for anything you don’t want (nst[xvf]out, nstxout-compressed, nstenergy). The final coordinate file can be suppressed with the (hidden) option mdrun -noconfout.

Thanks, Justin!

I wonder why is this output mandatory, seems more like a debug setting. I don’t remember it being use for anything other than checking the sanity of the original mdp file.

I’ll make a thorough check, but for the steep integrator, mdrun seems to output to .trr anyway. If the behavior is inconsistent I’ll take it to redmine.

That one is new! Thanks!

It’s for the integrity of your inputs; if you’re in the habit of leaving many settings at their default values, you may forget what they are or you may accidentally use some settings you didn’t intend, so mdout.mdp is basically telling you “these are all the settings you used, even the ones you didn’t think mattered.”