Skip to content

Commit 16e394b

Browse files
committed
base: manually compile OpenMPI
Problem: the OpenMPI packaged with centos 7 does not include the PMI plugin, which is required to boot under Flux. The OpenMPI version packaged with centos 8 (4.0.5) has a bug that causes a segfault on finalization, which is fixed in the next patch version. PR that fixes the bug: (open-mpi/ompi#8380) Solution: for centos 7, hand compile the same version of OpenMPI (1.10), but with the `--with-pmi` flag. For centos 8, hand compile the version of OpenMPI with the patch (4.0.6). Since this is an involved process, add a helper script that will also make adding other MPIs much easier.
1 parent b36d2a0 commit 16e394b

File tree

4 files changed

+84
-4
lines changed

4 files changed

+84
-4
lines changed

docker/base/centos7/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ RUN yum -y update \
7070
# Radical Pilot Deps
7171
python3-pip \
7272
mongodb-org \
73-
# MPI Dep
74-
${MPI} \
7573
&& yum clean all \
7674
&& python3 -m venv ${VIRTUAL_ENV} \
7775
&& pip install --upgrade pip setuptools pytest \
@@ -86,3 +84,5 @@ RUN wget https://archive.apache.org/dist/ant/binaries/apache-ant-1.9.15-bin.tar.
8684
&& ln -s /opt/apache-ant-1.9.15 /opt/ant \
8785
&& sudo ln -s /opt/ant/bin/ant /usr/bin/ant
8886

87+
COPY ./install-mpi.sh /install-mpi.sh
88+
RUN bash install-mpi.sh ${MPI}

docker/base/centos7/install-mpi.sh

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
3+
if [[ -z $1 ]]; then
4+
echo "Must provide MPI that you want to install"
5+
exit 1
6+
fi
7+
8+
# Install only the dependencies for a given package
9+
# Source: https://serverfault.com/questions/429123/howto-get-yum-to-install-only-dependencies-for-a-given-pakage
10+
yum_install_only_deps () {
11+
if [[ -z "$1" ]]; then
12+
echo "Package required for installing deps"
13+
exit 1
14+
fi
15+
yum deplist $1 | grep provider | awk '{print $2}' | sort | uniq | grep -v $PACKAGE | sed ':a;N;$!ba;s/\n/ /g' | xargs yum -y install
16+
}
17+
18+
if [[ "$1" == "openmpi-devel" ]]; then
19+
yum install -y slurm-pmi-devel
20+
21+
MAJOR_MINOR=1.10
22+
PATCH=7
23+
OPENMPI=openmpi-${MAJOR_MINOR}.${PATCH}
24+
25+
wget https://download.open-mpi.org/release/open-mpi/v${MAJOR_MINOR}/${OPENMPI}.tar.gz
26+
tar -xf ./${OPENMPI}.tar.gz
27+
rm ./${OPENMPI}.tar.gz
28+
29+
cd ${OPENMPI}
30+
./configure
31+
make -j 4
32+
make install
33+
cd ..
34+
rm -rf ${OPENMPI}
35+
36+
yum remove -y slurm-pmi-devel
37+
yum autoremove -y
38+
yum clean all
39+
else
40+
echo "Unknown/unsupported MPI. Existing without installing."
41+
exit 1
42+
fi

docker/base/centos8/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.n
7171
# RADICAL-Pilot Dependencies
7272
python3-pip \
7373
mongodb-org \
74-
# MPI Dep
75-
${MPI} \
7674
&& dnf clean all \
7775
&& python3 -m venv ${VIRTUAL_ENV} \
7876
&& pip install --upgrade pip setuptools pytest \
@@ -87,3 +85,5 @@ RUN wget https://archive.apache.org/dist/ant/binaries/apache-ant-1.9.15-bin.tar.
8785
&& ln -s /opt/apache-ant-1.9.15 /opt/ant \
8886
&& sudo ln -s /opt/ant/bin/ant /usr/bin/ant
8987

88+
COPY ./install-mpi.sh /install-mpi.sh
89+
RUN bash install-mpi.sh ${MPI}

docker/base/centos8/install-mpi.sh

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
3+
if [[ -z $1 ]]; then
4+
echo "Must provide MPI that you want to install"
5+
exit 1
6+
fi
7+
8+
# Install only the dependencies for a given package
9+
# Source: https://serverfault.com/questions/429123/howto-get-yum-to-install-only-dependencies-for-a-given-pakage
10+
yum_install_only_deps () {
11+
if [[ -z "$1" ]]; then
12+
echo "Package required for installing deps"
13+
exit 1
14+
fi
15+
yum deplist $1 | grep provider | awk '{print $2}' | sort | uniq | grep -v $PACKAGE | sed ':a;N;$!ba;s/\n/ /g' | xargs yum -y install
16+
}
17+
18+
if [[ "$1" == "openmpi-devel" ]]; then
19+
yum_install_only_deps $1
20+
21+
MAJOR_MINOR=4.0
22+
PATCH=6
23+
OPENMPI=openmpi-${MAJOR_MINOR}.${PATCH}
24+
25+
wget https://download.open-mpi.org/release/open-mpi/v${MAJOR_MINOR}/${OPENMPI}.tar.gz
26+
tar -xf ./${OPENMPI}.tar.gz
27+
rm ./${OPENMPI}.tar.gz
28+
29+
cd ${OPENMPI}
30+
./configure
31+
make -j 4
32+
make install
33+
cd ..
34+
rm -rf ${OPENMPI}
35+
else
36+
echo "Unknown/unsupported MPI. Existing without installing."
37+
exit 1
38+
fi

0 commit comments

Comments
 (0)