About Me

My photo
A Computer Enthusiast who's learning as much as I can, while attempting to share and re-distribute the knowledge! Enjoy! :D

Thursday, October 27, 2011

OpenMPI Quickstart - Updated

I wrote a quickstart sometime last year for OpenMPI on Linux. Here's an update for OpenMPI for Linux and OS X Lion.

1. Download the latest openmpi source files:
 2. Find out how many processors are available to utilize (optional).

Linux:
//**********

shell$ grep 'processor.*:' /proc/cpuinfo | wc -l

//**********

OS X:
//**********

shell$ system_profiler | egrep "Processors|Cores"
      Number of Processors: 1
      Total Number of Cores: 2

//**********

3. Move the downloaded file to your home directory, and untar the file.

Linux and OS X:
//**********

shell$ cp openmpi-1.4.4.tar.bz2 ~
shell$ cd
shell$ tar -xvjf  openmpi-1.4.4.tar.bz2

//**********

4. cd into the newly created openmpi directory and view the INSTALL file. Here you will find more information on how to install OpenMPI.

Linux and OS X:
//**********

shell$ cd openmpi-1.4.4
shell$ less INSTALL

//**********

5. Run configure and append the prefix option with your preference for the binary installation location.

Linux and OS X:
//**********

shell$ ./configure --prefix=$HOME/openmpi

//**********

6. Run 'make all install'

Linux and OS X:
//**********

shell$ make all install

//**********

7. cd into your home directory and edit your .bash_profile or .bashrc (.cshrc for c shell) to include the bin install location within your PATH. Don't forget to source it.

Linux and OS X:
//**********
shell$ cd
shell$ vi .bashrc

export PATH=$PATH:$HOME/openmpi/bin

shell$ source .bashrc
shell$ which mpic++
/home/username/openmpi/mpic++

//**********

You now have a fully functionally parallel processing environment! Good luck!

No comments:

Post a Comment