Skip to content
Mark Santcroos edited this page Nov 18, 2016 · 29 revisions

Open RunTime Environment from OpenMPI

This page documents the installation and configuration of OpenMPI in order to use the ORTE layer as a execution component for RADICAL-Pilot.

General

  • Generally we would like to provide a general installation per system that is used by all users, which will be configured in the main resource config for that resource, and thus the installation needs to be on a place in the filesystem that is readable by all target users.
  • Currently we are working from a git checkout, at some point in time we should be able to move to release tarballs
  • Because of the use of module files, its relatively easy to have multiple installations next to each other and switch the default easily as well
  • There will be differences on a system per system basis, we try to capture that as much as possible.

Toolchain installation

To build OpenMPI, we need the proper versions of automake, autoconf, m4 and libtool. This step generally only need to be done once and the versions are pretty static.

Make sure you use the GNU compiler quite, i.e. on Cray's some variant of:

module switch PrgEnv-pgi PrgEnv-gnu # e.g. Titan
# or
module swap PrgEnv-cray PrgEnv-gnu # i.e. Blue Waters

Setup paths and environments:

# The environments below are only important during build time and can generally point anywhere on the filesystem.
# Your homedir is a logical choice.
export OMPI_DIR=$HOME/openmpi
export OMPI_BUILD=$OMPI_DIR/build
export OMPI_DOWNLOAD=$OMPI_DIR/download
export OMPI_SOURCE=$OMPI_DIR/src
export OMPI_TOOLS_PREFIX=$OMPI_DIR/tools
export PATH=$OMPI_TOOLS_PREFIX/bin:$PATH
# The file system locations of the variables below need a bit more care, as this path needs to be accessible during job run time.
export OMPI_ALL_MODULES=$OMPI_DIR/modules
export OMPI_MODULE=$OMPI_ALL_MODULES/openmpi
export OMPI_INSTALLED=$OMPI_DIR/installed

Create download directory:

mkdir -p $OMPI_DOWNLOAD
cd $OMPI_DOWNLOAD

Download following files into $OMPI_DOWNLOAD:

  • autoconf-2.69.tar.gz (wget http://ftp.nluug.nl/gnu/autoconf/autoconf-2.69.tar.gz)
  • automake-1.13.3.tar.gz (wget http://ftp.nluug.nl/gnu/automake/automake-1.13.3.tar.gz)
  • libtool-2.4.2.tar.gz (wget http://nl.mirror.babylon.network/gnu/libtool/libtool-2.4.2.tar.gz)
  • m4-1.4.16.tar.gz (wget https://ftp.gnu.org/gnu/m4/m4-1.4.16.tar.gz)

Create source directory:

mkdir -p $OMPI_SOURCE

Install m4:

cd $OMPI_SOURCE
tar -xvzf $OMPI_DOWNLOAD/m4-1.4.16.tar.gz
cd m4-1.4.16
./configure --prefix=$OMPI_TOOLS_PREFIX
make
make install

Install autoconf:

cd $OMPI_SOURCE
tar -xvzf $OMPI_DOWNLOAD/autoconf-2.69.tar.gz
cd autoconf-2.69
./configure --prefix=$OMPI_TOOLS_PREFIX
make
make install

Install automake:

cd $OMPI_SOURCE
tar -xvzf $OMPI_DOWNLOAD/automake-1.13.3.tar.gz
cd automake-1.13.3
./configure --prefix=$OMPI_TOOLS_PREFIX
make
make install

Install libtool:

cd $OMPI_SOURCE
tar -xvzf $OMPI_DOWNLOAD/libtool-2.4.2.tar.gz
cd libtool-2.4.2
./configure --prefix=$OMPI_TOOLS_PREFIX
make
make install

OpenMPI installation

Last know good git commit: 4c9f7af.

Prepare OMPI source code:

cd $OMPI_SOURCE
git clone https://github.com/open-mpi/ompi.git
cd ompi
git checkout 4c9f7af
./autogen.pl

Build and install:

mkdir $OMPI_BUILD
cd $OMPI_BUILD
OMPI_LABEL=nov18
CFLAGS=-O3 CXXFLAGS=-O3 $OMPI_SOURCE/ompi/configure --enable-orterun-prefix-by-default --with-devel-headers --disable-debug --enable-static --prefix=$OMPI_INSTALLED/$OMPI_LABEL
make
make install

Module files

A module file allows us to capture all the paths with a system module wrapper.

Setup module structure:

mkdir -p $OMPI_MODULE

For example, to create a module file for the version we have just installed, we can create a file ...

cat > $OMPI_MODULE/nov18

... and add the following content. Make sure that the $mpiroot path matches the with the $OMPI_INSTALLED path used in the environment variables used above and that the nov18 label matches too.

#%Module########################################################################

##
## Open MPI from git
##
proc ModulesHelp { } {
        global version

        puts stderr "Sets up a dynamic build of Open MPI HEAD from git."
        puts stderr "Version $version"
}

module-whatis	"Dynamic build of Open MPI from git."

set 		version		nov18

set mpiroot /u/sciteam/marksant/openmpi/installed/$version
prepend-path	PATH            $mpiroot/bin
prepend-path	LD_LIBRARY_PATH $mpiroot/lib
prepend-path	MANPATH 	$mpiroot/share/man

Test

Add the created module file to the module search path:

module use --append $OMPI_ALL_MODULES

Show the just created module file:

module avail openmpi

Should give an output like:

------------------- /u/sciteam/marksant/openmpi-test/modules -------------------
openmpi/nov18

Load the just created module:

module load openmpi/$OMPI_LABEL

Most basic test to see if installation is reachable in the path:

orte-info | head

RADICAL-Pilot resource configuration

Now the right module needs to be added to the resource configuration, e.g. https://github.com/radical-cybertools/radical.pilot/blob/devel/src/radical/pilot/configs/resource_ncsa.json:

        "pre_bootstrap_1"             : [
            "module switch PrgEnv-cray PrgEnv-gnu",
            "module load bwpy",
            "module use --append /projects/sciteam/gkd/modules",
            "module load openmpi/rhc_static"
        ],

TODO

  • Compare and contrast static vs dynamic linked builds
  • Construct list/table with proper install locations for the various systems
Clone this wiki locally