Skip to content

Commit bb8bc98

Browse files
committed
Build MPICH 3.x with ch3:nemesis
1 parent 72e979a commit bb8bc98

File tree

3 files changed

+34
-18
lines changed

3 files changed

+34
-18
lines changed

bootstrap.sh

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,15 +96,11 @@ else
9696
check Release "$release" || (echo "error: RELEASE!=$release" && exit 1)
9797
fi
9898

99-
if test "$(uname)" = "Linux"; then
100-
case "$mpiname" in
101-
mpich) MODSOURCE="$SOURCE"/modules ;;
102-
openmpi) MODSOURCE="$SOURCE"/3rd-party ;;
103-
esac
99+
boostrap-ofi() {
104100
ofigithub="https://github.com/ofiwg/libfabric"
105101
ofiurlbase="$ofigithub/releases/download/v$ofiversion"
106102
ofitarball="libfabric-$ofiversion.tar.bz2"
107-
ofidestdir="$MODSOURCE"/"${ofitarball%%.tar.*}"
103+
ofidestdir="$1"/"${ofitarball%%.tar.*}"
108104
if test ! -d "$ofidestdir"; then
109105
if test ! -f "$ofitarball"; then
110106
echo downloading "$ofiurlbase"/"$ofitarball"...
@@ -119,10 +115,13 @@ if test "$(uname)" = "Linux"; then
119115
else
120116
echo reusing directory "$ofidestdir"...
121117
fi
118+
}
119+
120+
boostrap-ucx() {
122121
ucxgithub="https://github.com/openucx/ucx"
123122
ucxurlbase="$ucxgithub/releases/download/v$ucxversion"
124123
ucxtarball="ucx-$ucxversion.tar.gz"
125-
ucxdestdir="$MODSOURCE"/"${ucxtarball%%.tar.*}"
124+
ucxdestdir="$1"/"${ucxtarball%%.tar.*}"
126125
if test ! -d "$ucxdestdir"; then
127126
if test ! -f "$ucxtarball"; then
128127
echo downloading "$ucxurlbase"/"$ucxtarball"...
@@ -141,6 +140,17 @@ if test "$(uname)" = "Linux"; then
141140
else
142141
echo reusing directory "$ucxdestdir"...
143142
fi
143+
}
144+
145+
if test "$(uname)" = "Linux"; then
146+
if test "$mpiname" = "mpich" && test "${version%%.*}" -ge 4; then
147+
boostrap-ofi "$SOURCE"/modules
148+
boostrap-ucx "$SOURCE"/modules
149+
fi
150+
if test "$mpiname" = "openmpi"; then
151+
boostrap-ofi "$SOURCE"/3rd-party
152+
boostrap-ucx "$SOURCE"/3rd-party
153+
fi
144154
fi
145155

146156
if test "$mpiname" = "mpich"; then

cibw-build-mpi.sh

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ esac
2121
if test "$(uname)" = Linux; then
2222
# shellcheck disable=SC1091
2323
PLATFORM_ID="$(source /etc/os-release && echo "${PLATFORM_ID:-}")"
24-
if test "${CIBUILDWHEEL}" = 1; then
24+
if test "${CIBUILDWHEEL-}" = 1; then
2525
yum remove -y libatomic
2626
if test "$PLATFORM_ID" = "platform:el8"; then
2727
yum install -y rdma-core-devel
@@ -119,15 +119,22 @@ if test -d "$MODSOURCE"/libfabric-*; then
119119
fi
120120

121121
if test "$mpiname" = "mpich"; then
122-
case $(uname) in
123-
Linux) netmod=ucx,ofi ;;
124-
Darwin) netmod=ofi ;;
125-
esac
122+
if test "${version%%.*}" -lt 4; then
123+
case $(uname) in
124+
Linux) device="ch3:nemesis" ;;
125+
Darwin) device="ch3:nemesis" ;;
126+
esac
127+
else
128+
case $(uname) in
129+
Linux) device="ch4:ucx,ofi" ;;
130+
Darwin) device="ch4:ofi" ;;
131+
esac
132+
fi
126133
options=(
127134
CC=cc
128135
CXX=c++
129136
--prefix="$PREFIX"
130-
--with-device="ch4:$netmod"
137+
--with-device="$device"
131138
--with-pm=hydra:gforker
132139
--with-ucx=embedded
133140
--with-libfabric=embedded
@@ -144,10 +151,10 @@ if test "$mpiname" = "mpich"; then
144151
--disable-libxml2
145152
--disable-dependency-tracking
146153
)
147-
if [[ "$netmod" != *ucx* ]]; then
154+
if [[ "$device" != *ucx* ]]; then
148155
options=("${options[@]/--with-ucx=embedded}")
149156
fi
150-
if [[ "$netmod" != *ofi* ]]; then
157+
if [[ "$device" != *ofi* ]]; then
151158
options=("${options[@]/--with-libfabric=embedded}")
152159
fi
153160
if test -d "$SOURCE"/modules/ucx-*; then

cibw-check-mpi.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ if test "$mpiname" = "mpich"; then
6161
RUN mpichversion
6262
fi
6363

64-
if test "$mpiname" = "mpich"; then
64+
if test "$mpiname" = "mpich" && test "${version%%.*}" -ge 4; then
6565
RUN command -v mpivars
6666
RUN mpivars -nodesc | grep 'Category .* has'
6767
fi
@@ -92,13 +92,12 @@ RUN mpiexec -help
9292
RUN mpiexec -n 3 ./helloworld-c
9393
RUN mpiexec -n 3 ./helloworld-cxx
9494

95-
if test "$mpiname-$(uname)" = "mpich-Linux"; then
95+
if test "$mpiname-$(uname)" = "mpich-Linux" && test "${version%%.*}" -ge 4; then
9696
export MPICH_CH4_UCX_CAPABILITY_DEBUG=1
9797
export MPICH_CH4_OFI_CAPABILITY_DEBUG=1
9898
for netmod in ucx ofi; do
9999
printf "testing %s ... " "$netmod"
100100
export MPICH_CH4_NETMOD="$netmod"
101-
test "${version%%.*}" -ge 4 || netmod=""
102101
mpiexec -n 1 ./helloworld-c | grep -i "$netmod" > /dev/null
103102
for nonlocal in 0 1; do
104103
export MPICH_NOLOCAL=$nonlocal

0 commit comments

Comments
 (0)