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,819

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