Problem:
I have a system that has both the Intel® Compilers and the Intel® MPI Library. I'm trying to run an Intel MPI job with mpirun but I'm hitting the following errors:
/opt/intel/composer_xe_2013_sp1/mpirt/bin/intel64/mpirun:
line 96: /opt/intel/composer_xe_2013_sp1/mpirt/bin/intel64/mpivars.sh: No such file or directory
Furthermore, when I try mpirun -V, it returns this:
/opt/intel/composer_xe_2013_sp1/mpirt/bin/intel64/mpirun: 96: .: Can't open /opt/intel/composer_xe_2013_sp1/mpirt/bin/intel64/mpivars.sh
What's wrong?
Root Cause:
The Intel Compilers bundle the Intel MPI runtimes package in order to support their Co-Array Fortran implementation. You will see the messages above if you have sourced the appropriate compilervars.sh to set your compiler environment but have not done so for your Intel MPI libraries. Therefore, the first instance of mpirun found on your system is the one shipped with the Intel compilers (which is not the full package).
Solution:
To solve this, it's as easy as sourcing the mpivars.sh script that comes with your Intel MPI installation. You need to tell the Operating System (OS) where the full Intel MPI libraries are located and set your environment properly. For example, this is how I would source the appropriate environment scripts on my system:
[user@host1] . /opt/intel/composer_xe_2013_sp1/bin/compilervars.sh intel64
[user@host1] . /opt/intel/impi/4.1.1.036/bin64/mpivars.sh
Now, when I try to run my job again, it picks up the correct version of mpirun.