skip to content
 

MPI library

Availability: 
Instructions for users: 

Load the appropriate mpi/openmpi module for your chosen compiler. Compile your code using the OpenMPI provided compiler wrappers: mpicc, mpif90, mpicc++, mpif77. If you use the Intel version of OpenMPI, watch out for the fact that the -fast option turns on static linking which will not work. OpenMPI can be linked statically but our installation isn't set up for it, and it's not usually a good idea to link statically with OpenMPI anyway. Use -O3 -ipo instead.

To run your code on the workstations use the mpirun command. Most people probably just want mpirun -np 2 ./my_program. If you are lucky enough to have access to two or more PCs to run on have a look at the manpage for mpirun, or try mpirun -np 4 -H pc1,pc2 ./my_program. You will need to have set up passwordless login from one PC to the other using ssh public key authentication.

Licence Details: 
Documentation: 

There are manpages. There is a good online FAQ.

Admin notes: 

 

Very easy to compile but takes ages. You need a few extra flags to ensure it finds its libraries at runtime. You need to do versions for GNU, Intel, and PGI compilers:

#GNU:
module purge
time ./configure --prefix=/usr/local/shared/$(lsb_release -si | tr [A-Z] [a-z])-$(lsb_release -rs)/x86_64/$(basename $(pwd)) --enable-mpirun-prefix-by-default  --with-wrapper-ldflags="-Wl,-rpath -Wl,/usr/local/shared/$(lsb_release -si | tr [A-Z] [a-z])-$(lsb_release -rs)/x86_64/$(basename $(pwd))/lib"
# 6m55s
time make
# 19m49s
time sudo make install
# 1m50s
# Intel:
module purge
module add icc
time ./configure CC=icc CXX=icpc F77=ifort FC=ifort --prefix=/usr/local/shared/$(lsb_release -si | tr [A-Z] [a-z])-$(lsb_release -rs)/x86_64/$(basename $(pwd))-intel --enable-mpirun-prefix-by-default --with-wrapper-ldflags="-Wl,-rpath -Wl,/usr/local/shared/$(lsb_release -si | tr [A-Z] [a-z])-$(lsb_release -rs)/x86_64/$(basename $(pwd))-intel/lib"
time make 
time sudo make install
# 5m34s
# Had to hack libtool else it complained that it couldn't find icc when doing make install. (changed lines on which it complained from eval "$cmd" to eval "source /usr/share/modules/init/sh && module load icc && $cmd"

Note compiler flags for pgi:

module purge
module add pgi
./configure CC=pgcc CXX=pgc++ F77=pgf77 FC=pgf90 CFLAGS="-tp=x64" CXXFLAGS="-tp=x64" FCFLAGS="-tp=x64" --prefix=/usr/local/shared/suse-11.1/x86_64/openmpi-1.3.1-pgi80  --enable-mpirun-prefix-by-default --with-wrapper-ldflags="-Wl,-rpath -Wl,/usr/local/shared/suse-11.1/x86_64/openmpi-1.3.1-pgi80/lib"
make
make install 

Can't find what you're looking for?

Then you might find our A-Z site index useful. Or, you can search the site using the box at the top of the page, or by clicking here.