1

In this post, I had a problem with the version of mpirun I was using. A fast solution (even if it did not solve all the issues) was to add the path to the openmpi version of mpirun in my PATH environmental variable so my shell knew to look there first when looking for this command.

In another code I am using, I need to call the intel version of mpif77. One quick solution would be again to add the correct path to my environmental variable. However, this means that I can have only one code working automatically, while for the other code I would need to do some pre-processing to make sure I am linking the correct version of the mpi command.

Is there a way to bypass that? For example, I would like to link only mpif77 to its intel version and mpic++ only to the openmp version rather than doing it through the PATH environmental variable, which in the end is convenient if you work only with either openmp or intel, but not both.

Community
  • 1
  • 1
solalito
  • 1,189
  • 4
  • 19
  • 34
  • Look into modules. They are normally used on supercomputers, but also other Unix computers, for this purpose. Alternatively, you can prepare a short script that switches between the MPI libraries and sets the correct `PATH` variables. – Vladimir F Героям слава Dec 16 '15 at 10:22
  • Intel MPI names its Intel-specific compiler wrappers differently: `mpiicc` (notice the extra `i`), `mpiifort`, etc. – Hristo Iliev Dec 17 '15 at 21:40

1 Answers1

1

Why not use an alias in your shell configuration?

alias intel_mpif77="/path/to/wrappercompiler"
alias ompi_mpic++= ...
Mohammed Li
  • 823
  • 2
  • 7
  • 22