Common Questions for Beginners
Questions
1. How can I run pw.x without typing the full path (/home/.../pw.x)?
At first, you may need to run QE using the full path:
mpirun -np 16 /home/hwang/q-e-qe-7.4.1/bin/pw.x -in ausurf.in > ausurf.out
You can set it up so that only pw.x is needed:
mpirun -np 16 pw.x -in 1scf.in > 1scf.out
Setup
- Run the following commands once:
echo 'export PATH="/home/hwang/q-e-qe-7.4.1/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
- The first command,
echo ... >> ~/.bashrc, adds the Quantum ESPRESSO bin path to your~/.bashrcfile. - The second command,
source ~/.bashrc, reloads.bashrcand applies the setting immediately to the current terminal.
- Then check that
pw.xcan be found:
which pw.x
- It should return something like:
/home/hwang/q-e-qe-7.4.1/bin/pw.x
- You can now use this command:
mpirun -np 16 pw.x -in 1scf.in > 1scf.out
What is this setting called?
This is called adding a directory to the PATH environment variable. PATH tells Linux where to look for executable programs.
Because the setting is saved in ~/.bashrc, it is automatically applied to future Bash sessions.
Note: If you run only
export PATH="/home/hwang/q-e-qe-7.4.1/bin:$PATH"in the terminal without adding it to
~/.bashrc, it applies only to the current shell session.