I'm new to bioinformatics and gromacs I tried to run the code and got this error

Program:     gmx mdrun, version 2020
Source file: src/gromacs/options/options.cpp (line 179)
Function:    void gmx::internal::OptionSectionImpl::finish()

Error in user input:
Invalid input values
In option s
Required option was not provided, and the default file 'topol' does not
exist or is not accessible.
The following extensions were tried to complete the file name:

I already have the file topol. I searched and found that I need to run mdrun-h to ensure that the command work but when I check

mdrun -h 

I got

mdrun: command not found
  • $\begingroup$ try 'which mdrun', it might not simply be installed $\endgroup$
    – M__
    Oct 31, 2020 at 3:57
  • $\begingroup$ thanks for replying, I tried it and got nothing $\endgroup$ Oct 31, 2020 at 4:27
  • $\begingroup$ Is the tool installed, is it in PATH? $\endgroup$
    – user3051
    Oct 31, 2020 at 10:01
  • $\begingroup$ @ATpoint has a good point! The problem is your environment is wrongly configured $\endgroup$
    – M__
    Oct 31, 2020 at 10:02

2 Answers 2


If the command line says "command not found", it means that the binary is not executable or not found in any of the paths mentioned in the $PATH environmental variable. You can check for example this tutorial for details on how it works and how to resolve problems related to this variable.

Which probably means, that you need to go a step back, to the installation instructions of gromacs and try to install the mdrun binary. However, if the mdrun was not installed successfully, it's very likely that more stuff of the package will be missing, so it might be worth reinstalling it all.

P.S. It's not obvious to me if getting mdrun it will resolve the first posted problem (I have never worked with gromacs). If you would share the link to the research you have done, that would help others to help you.

  • $\begingroup$ This was a great answer Kamil! We have a few unanswered GROMACS questions here, are you able to help us out at all with those? I'm trying to help take care of the unanswered queue. $\endgroup$ Jul 17, 2021 at 18:56

I think there was a misunderstanding here. Two errors are in user5520049's post.

  1. A .tpr is not present in the working directory so gromacs complains, if your .tpr is topol then you have to give this file to gmx mdrun: gmx mdrun -s topol.
  2. mdrun is not a command, you should have called instead: gmx mdrun -h. That's why you had command not found and not because gmx is not in your $PATH. You couldn't have run gmx mdrun in the first place otherwise.

Side tip: run gmx mdrun -h -hidden to see hidden options.

  • $\begingroup$ thanks for helping . the path is also was a problem but your answer is important for me . i tried to execute those commands gmx grompp -f run_$count.mdp -p topol.top -c em.gro -o run_$count.tpr -nb gpu; gmx mdrun -deffnm run_$count -nb gpu and got the same error although topol.tpr is exists in the directory $\endgroup$ Nov 2, 2020 at 21:04
  • $\begingroup$ I can assure you that gmx is in your $PATH, you could not launch any gmx commands otherwise (gmx grompp or mdrun etc.). The problem is that you use -deffnm (which you didn't mention in your orginal post btw) with gmx mdrun which is the option to setup default input and output names. So with -deffnm un_count gromacs is looking for a tpr named: un_count.tpr and not topol.tpr. Either: 1. use -deffnm un_count and name your tpr un_count.tpr 2. do not use -deffnm and not use -s and have default topol.tpr in the working directory. 3. do not use -deffnm & use -s yourcustomtpr.tpr $\endgroup$
    – jeremy
    Nov 3, 2020 at 16:01
  • $\begingroup$ Here is a link to good gromacs tutorials: mdtutorials.com/gmx , maybe you could take a look to be familiarized with this MD engine ;) $\endgroup$
    – jeremy
    Nov 3, 2020 at 16:17
  • $\begingroup$ This was a great answer Jeremy! We have a few unanswered GROMACS questions here, are you able to help us out at all with those? I'm trying to help take care of the unanswered queue. $\endgroup$ Jul 17, 2021 at 18:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.