Skip to content

Commit

Permalink
mpi: Including example definition files
Browse files Browse the repository at this point in the history
  • Loading branch information
simo-tuomisto committed Oct 6, 2024
1 parent 792e201 commit 3734717
Show file tree
Hide file tree
Showing 2 changed files with 129 additions and 0 deletions.
73 changes: 73 additions & 0 deletions content/examples/ompi-puhti.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
Bootstrap: docker
From: rockylinux:{{ OS_VERSION }}

%arguments

GCC_VERSION=9
NPROCS=4
OPENMPI_VERSION=4.1.4rc1
UCX_VERSION=1.13.0
OSU_MICRO_BENCHMARKS_VERSION=7.4
OS_NAME=rhel
OS_VERSION=8.6
OFED_VERSION=5.6-2.0.9.0

%post

### Install OpenMPI dependencies

# Base tools and newer gcc version

dnf install -y dnf-plugins-core epel-release
dnf config-manager --set-enabled powertools
dnf install -y make gdb wget numactl-devel which
dnf -y install gcc-toolset-{{ GCC_VERSION }}
source /opt/rh/gcc-toolset-{{ GCC_VERSION }}/enable

# Enable Mellanox OFED rpm repo

wget https://www.mellanox.com/downloads/ofed/RPM-GPG-KEY-Mellanox
rpm --import RPM-GPG-KEY-Mellanox
rm RPM-GPG-KEY-Mellanox
cd /etc/yum.repos.d/
wget https://linux.mellanox.com/public/repo/mlnx_ofed/{{ OFED_VERSION }}/{{ OS_NAME }}{{ OS_VERSION }}/mellanox_mlnx_ofed.repo
cd /

# Install network library components

dnf -y install rdma-core ucx-ib-{{ UCX_VERSION }} ucx-devel-{{ UCX_VERSION }} ucx-knem-{{ UCX_VERSION }} ucx-cma-{{ UCX_VERSION }} ucx-rdmacm-{{ UCX_VERSION }}

### Install OpenMPI

dnf -y install openmpi-{{ OPENMPI_VERSION }}

### Build example application

export OMPI_DIR=/usr/mpi/gcc/openmpi-{{ OPENMPI_VERSION }}
export PATH="$OMPI_DIR/bin:$PATH"
export LD_LIBRARY_PATH="$OMPI_DIR/lib:$LD_LIBRARY_PATH"


ls $OMPI_DIR

# Build osu benchmarks
cd /opt
wget -q http://mvapich.cse.ohio-state.edu/download/mvapich/osu-micro-benchmarks-{{ OSU_MICRO_BENCHMARKS_VERSION }}.tar.gz
tar xf osu-micro-benchmarks-{{ OSU_MICRO_BENCHMARKS_VERSION }}.tar.gz
cd osu-micro-benchmarks-{{ OSU_MICRO_BENCHMARKS_VERSION }}
./configure --prefix=/opt/osu-micro-benchmarks CC=mpicc CFLAGS=-O3
make -j{{ NPROCS }}
make install
cd ..
rm -rf osu-micro-benchmarks-{{ OSU_MICRO_BENCHMARKS_VERSION }} osu-micro-benchmarks-{{ OSU_MICRO_BENCHMARKS_VERSION }}.tar.gz

%environment
export OMPI_DIR=/usr/mpi/gcc/openmpi-{{ OPENMPI_VERSION }}
export PATH="$OMPI_DIR/bin:$PATH"
export LD_LIBRARY_PATH="$OMPI_DIR/lib:$LD_LIBRARY_PATH"
export MANPATH="$OMPI_DIR/share/man:$MANPATH"

%runscript
source /opt/rh/gcc-toolset-{{ GCC_VERSION }}/enable
/opt/osu-micro-benchmarks/libexec/osu-micro-benchmarks/mpi/pt2pt/osu_bw

56 changes: 56 additions & 0 deletions content/examples/ompi-triton.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Bootstrap: docker
From: ubuntu:latest

%arguments

NPROCS=4
OPENMPI_VERSION=4.1.6
OSU_MICRO_BENCHMARKS_VERSION=7.4

%post

### Install OpenMPI dependencies

apt-get update
apt-get install -y wget bash gcc gfortran g++ make file bzip2 ca-certificates libucx-dev

### Build OpenMPI

OPENMPI_VERSION_SHORT=$(echo {{ OPENMPI_VERSION }} | cut -f 1-2 -d '.')
cd /opt
mkdir ompi
wget -q https://download.open-mpi.org/release/open-mpi/v${OPENMPI_VERSION_SHORT}/openmpi-{{ OPENMPI_VERSION }}.tar.bz2
tar -xvf openmpi-{{ OPENMPI_VERSION }}.tar.bz2
# Compile and install
cd openmpi-{{ OPENMPI_VERSION }}
./configure --prefix=/opt/ompi --with-ucx=/usr
make -j{{ NPROCS }}
make install
cd ..
rm -rf openmpi-{{ OPENMPI_VERSION }} openmpi-{{ OPENMPI_VERSION }}.tar.bz2

### Build example application

export OMPI_DIR=/opt/ompi
export PATH="$OMPI_DIR/bin:$PATH"
export LD_LIBRARY_PATH="$OMPI_DIR/lib:$LD_LIBRARY_PATH"

# Build osu benchmarks
cd /opt
wget -q http://mvapich.cse.ohio-state.edu/download/mvapich/osu-micro-benchmarks-{{ OSU_MICRO_BENCHMARKS_VERSION }}.tar.gz
tar xf osu-micro-benchmarks-{{ OSU_MICRO_BENCHMARKS_VERSION }}.tar.gz
cd osu-micro-benchmarks-{{ OSU_MICRO_BENCHMARKS_VERSION }}
./configure --prefix=/opt/osu-micro-benchmarks CC=/opt/ompi/bin/mpicc CFLAGS=-O3
make -j{{ NPROCS }}
make install
cd ..
rm -rf osu-micro-benchmarks-{{ OSU_MICRO_BENCHMARKS_VERSION }} osu-micro-benchmarks-{{ OSU_MICRO_BENCHMARKS_VERSION }}.tar.gz

%environment
export OMPI_DIR=/opt/ompi
export PATH="$OMPI_DIR/bin:$PATH"
export LD_LIBRARY_PATH="$OMPI_DIR/lib:$LD_LIBRARY_PATH"
export MANPATH="$OMPI_DIR/share/man:$MANPATH"

%runscript
/opt/osu-micro-benchmarks/libexec/osu-micro-benchmarks/mpi/pt2pt/osu_bw

0 comments on commit 3734717

Please sign in to comment.