1

I have lmp_fedora executable file located in /src. I use this command:

mpirun -np 4 lmp_fedora < in.stdinfile

to execute the job. However it is only able to run if I copy lmp_fedora into the same directory where I am launching the job. I compiled a alias:

echo 'alias lmp_fedora=/home/MyUSERNAME/liggghts/src/lmp_fedora' >> ~/.bashrc

and my motive is to be able to execute lmp_fedora from any directory. Is the above correct? and if yes, now I am stuck on what should my new job submit command be for that to happen.

l0b0
  • 8,529
  • 8
  • 42
  • 67
Theo Score
  • 29
  • 2

1 Answers1

1

Your alias can be called normal alias: it replace command at the beginning of the command line but not in the middle of it. To create global alias you need switch your shell from bash to zsh. See shells comparison for more information.

If you still want to work with bash, you probably don't need an alias at all. You need to adjust PATH variable where shell searches for executables. If you do something like

export PATH=/home/MyUSERNAME/liggghts/src/:$PATH

you will be able to run lmp_fedora without any aliases. I think that wrapping it with mpirunwill work too but I can't test it.

Kakadu
  • 111
  • 2
  • Here is [manual reference](https://www.open-mpi.org/doc/v1.8/man1/mpirun.1.php#sect12). Your answer could be right. If you like, you could add this reference. – Lety Jul 06 '15 at 11:47
  • Kakadu, many thanks and I really appreciate, changing PATH variable did the trick. – Theo Score Jul 06 '15 at 13:09
  • @TheoScore you can accept the question than. – Kakadu Jul 06 '15 at 14:49