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

**URL:** <https://gromacs.bioexcel.eu/t/suppress-grompp-mdrun-output-files-or-support-dev-null-output/1789>\
**Category:** User discussions\
**Created:** [March 20, 2021, 3:20pm UTC](https://gromacs.bioexcel.eu/t/suppress-grompp-mdrun-output-files-or-support-dev-null-output/1789 "2021-03-20T15:20:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eltonfc](https://avatars.discourse-cdn.com/v4/letter/e/aca169/32.png) [@eltonfc](https://gromacs.bioexcel.eu/u/eltonfc)\
**Post date:** [March 20, 2021, 3:20pm UTC](https://gromacs.bioexcel.eu/t/suppress-grompp-mdrun-output-files-or-support-dev-null-output/1789/1 "2021-03-20T15:20:55Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [March 21, 2021, 1:40am UTC](https://gromacs.bioexcel.eu/t/suppress-grompp-mdrun-output-files-or-support-dev-null-output/1789/2 "2021-03-21T01:40:57Z")

</div>

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`.

---

<div class="post-metadata">

**Author:** ![eltonfc](https://avatars.discourse-cdn.com/v4/letter/e/aca169/32.png) [@eltonfc](https://gromacs.bioexcel.eu/u/eltonfc)\
**Post date:** [March 21, 2021, 2:49am UTC](https://gromacs.bioexcel.eu/t/suppress-grompp-mdrun-output-files-or-support-dev-null-output/1789/3 "2021-03-21T02:49:15Z")

</div>

> [@jalemkul](#):
>
> 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 },

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.

> [@](#):
>
> 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` ).

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.

> [@](#):
>
> The final coordinate file can be suppressed with the (hidden) option `mdrun -noconfout` .

That one is new! Thanks!

---

<div class="post-metadata">

**Author:** ![jalemkul](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/jalemkul/32/18_2.png) [@jalemkul](https://gromacs.bioexcel.eu/u/jalemkul)\
**Post date:** [March 25, 2021, 3:53pm UTC](https://gromacs.bioexcel.eu/t/suppress-grompp-mdrun-output-files-or-support-dev-null-output/1789/4 "2021-03-25T15:53:41Z")

</div>

> [@eltonfc](#):
>
> 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.

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.”
