Search This Blog

Thursday, September 20, 2012

Installing OpenMPI on Ubuntu 12.04

Installing OpenMPI
Although the instructions are tested on 12.04 but they should work for other flavours of linux. Building Open MPI is typically a combination of running "configure" and "make".

Step 1: Downloading OpenMPI
Download the latest version of OpenMPI from here.

Step 2: Extracting OpenMPI source
Untar and unzip the download file.

Step 3: Building OpenMPI
Navigate into the unzipped directory and type the following

./configure
make all
sudo make install

Parallel builds are also supported (although some versions of "make", such as GNU make, will only use the first target listed on the command line when executable parallel builds).  For example (assume GNU make): 



make -j 4 all
sudo make install

Parallel make is generally only helpful in the build phase; the installation process is mostly serial and does not benefit much from parallel make.


Compiling MPI Applications

MPI applications should be compiled using the Open MPI "wrapper" compilers:

C programs:      mpicc your-code.c
C++ programs: mpiCC your-code.cc    or
                         mpic++ your-code.cc   (for case-insensitive filesystems)
F77 programs:  mpif77 your-code.f
F90 programs:  mpif90 your-code.f90

These compilers simply add various command line flags (such as -lmpi) and invoke a back-end compiler; they are not compilers in themselves.

No comments:

Post a Comment