Skip to content

Commit d2ca50d

Browse files
authored
Update HPC-X building block (#511)
Reflect change to DOCA OFED Bump default to version 2.22.1
1 parent 1c4f87e commit d2ca50d

File tree

3 files changed

+62
-33
lines changed

3 files changed

+62
-33
lines changed

docs/building_blocks.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,15 +1577,16 @@ library directories. This value is ignored if `hpcxinit` is
15771577
`True`. The default value is False.
15781578

15791579
- __mlnx_ofed__: The version of Mellanox OFED that should be matched.
1580-
This value is ignored if Inbox OFED is selected. The default
1581-
value is `5` for HPC-X version 2.10 and later, and `5.2-2.2.0.0`
1582-
for earlier HPC-X versions.
1580+
This value is ignored if Inbox OFED is selected, or for HPC-X 2.21
1581+
and later. The default value is `5` for HPC-X version 2.10 and
1582+
later, and `5.2-2.2.0.0` for earlier HPC-X versions.
15831583

15841584
- __multi_thread__: Boolean flag to specify whether the multi-threaded
15851585
version of Mellanox HPC-X should be used. The default is `False`.
15861586

15871587
- __ofedlabel__: The Mellanox OFED label assigned by Mellanox to the
1588-
tarball. For version 2.16 and later, the default value is
1588+
tarball. For version 2.21 and later, the default value is
1589+
`gcc-doca_ofed`. For version 2.16 through 2.18, the default value is
15891590
`gcc-mlnx_ofed`. For earlier versions, the default value is
15901591
`gcc-MLNX_OFED_LINUX-5`. This value is ignored if `inbox` is `True`.
15911592

@@ -1609,7 +1610,7 @@ distributions the default values are `bzip2`, `numactl-libs`,
16091610
`/usr/local/hpcx`.
16101611

16111612
- __version__: The version of Mellanox HPC-X to install. The default
1612-
value is `2.19`.
1613+
value is `2.22.1`.
16131614

16141615
__Examples__
16151616

hpccm/building_blocks/hpcx.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,16 @@ class hpcx(bb_base, hpccm.templates.envvars, hpccm.templates.ldconfig,
8686
`True`. The default value is False.
8787
8888
mlnx_ofed: The version of Mellanox OFED that should be matched.
89-
This value is ignored if Inbox OFED is selected. The default
90-
value is `5` for HPC-X version 2.10 and later, and `5.2-2.2.0.0`
91-
for earlier HPC-X versions.
89+
This value is ignored if Inbox OFED is selected, or for HPC-X 2.21
90+
and later. The default value is `5` for HPC-X version 2.10 and
91+
later, and `5.2-2.2.0.0` for earlier HPC-X versions.
9292
9393
multi_thread: Boolean flag to specify whether the multi-threaded
9494
version of Mellanox HPC-X should be used. The default is `False`.
9595
9696
ofedlabel: The Mellanox OFED label assigned by Mellanox to the
97-
tarball. For version 2.16 and later, the default value is
97+
tarball. For version 2.21 and later, the default value is
98+
`gcc-doca_ofed`. For version 2.16 through 2.18, the default value is
9899
`gcc-mlnx_ofed`. For earlier versions, the default value is
99100
`gcc-MLNX_OFED_LINUX-5`. This value is ignored if `inbox` is `True`.
100101
@@ -118,7 +119,7 @@ class hpcx(bb_base, hpccm.templates.envvars, hpccm.templates.ldconfig,
118119
`/usr/local/hpcx`.
119120
120121
version: The version of Mellanox HPC-X to install. The default
121-
value is `2.19`.
122+
value is `2.22.1`.
122123
123124
# Examples
124125
@@ -147,7 +148,7 @@ def __init__(self, **kwargs):
147148
self.__ospackages = kwargs.get('ospackages', []) # Filled in by _distro()
148149
self.__packages = kwargs.get('packages', [])
149150
self.__prefix = kwargs.get('prefix', '/usr/local/hpcx')
150-
self.__version = kwargs.get('version', '2.19')
151+
self.__version = kwargs.get('version', '2.22.1')
151152

152153
self.__commands = [] # Filled in by __setup()
153154
self.__wd = kwargs.get('wd', hpccm.config.g_wd) # working directory
@@ -173,7 +174,9 @@ def __init__(self, **kwargs):
173174
self.__mlnx_ofed = '5.2-2.2.0.0'
174175

175176
if not self.__ofedlabel:
176-
if Version(self.__version) >= Version('2.16'):
177+
if Version(self.__version) >= Version('2.21'):
178+
self.__ofedlabel = 'gcc-doca_ofed'
179+
elif Version(self.__version) >= Version('2.16'):
177180
self.__ofedlabel = 'gcc-mlnx_ofed'
178181
else:
179182
self.__ofedlabel = 'gcc-MLNX_OFED_LINUX-{}'.format(self.__mlnx_ofed)
@@ -205,7 +208,9 @@ def __distro(self):
205208

206209
if hpccm.config.g_linux_distro == linux_distro.UBUNTU:
207210
if not self.__oslabel:
208-
if hpccm.config.g_linux_version >= Version('22.0'):
211+
if hpccm.config.g_linux_version >= Version('24.0'):
212+
self.__oslabel = 'ubuntu24.04'
213+
elif hpccm.config.g_linux_version >= Version('22.0'):
209214
self.__oslabel = 'ubuntu22.04'
210215
elif hpccm.config.g_linux_version >= Version('20.0'):
211216
self.__oslabel = 'ubuntu20.04'

test/test_hpcx.py

Lines changed: 43 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
import logging # pylint: disable=unused-import
2323
import unittest
2424

25-
from helpers import aarch64, centos, centos8, docker, ppc64le, ubuntu, ubuntu18, ubuntu20, ubuntu22, x86_64
25+
from helpers import aarch64, centos, centos8, docker, ppc64le, ubuntu, ubuntu18, ubuntu20, ubuntu22, ubuntu24, x86_64
2626

2727
from hpccm.building_blocks.hpcx import hpcx
2828

29-
class Test_mlnx_ofed(unittest.TestCase):
29+
class Test_hpcx(unittest.TestCase):
3030
def setUp(self):
3131
"""Disable logging output messages"""
3232
logging.disable(logging.ERROR)
@@ -38,7 +38,30 @@ def test_defaults_ubuntu20(self):
3838
"""Default hpcx building block"""
3939
h = hpcx()
4040
self.assertEqual(str(h),
41-
r'''# Mellanox HPC-X version 2.19
41+
r'''# Mellanox HPC-X version 2.22.1
42+
RUN apt-get update -y && \
43+
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
44+
bzip2 \
45+
libnuma1 \
46+
openssh-client \
47+
tar \
48+
wget && \
49+
rm -rf /var/lib/apt/lists/*
50+
RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://content.mellanox.com/hpc/hpc-x/v2.22.1/hpcx-v2.22.1-gcc-doca_ofed-ubuntu20.04-cuda12-x86_64.tbz && \
51+
mkdir -p /var/tmp && tar -x -f /var/tmp/hpcx-v2.22.1-gcc-doca_ofed-ubuntu20.04-cuda12-x86_64.tbz -C /var/tmp -j && \
52+
cp -a /var/tmp/hpcx-v2.22.1-gcc-doca_ofed-ubuntu20.04-cuda12-x86_64 /usr/local/hpcx && \
53+
echo "source /usr/local/hpcx/hpcx-init-ompi.sh" >> /etc/bash.bashrc && \
54+
echo "hpcx_load" >> /etc/bash.bashrc && \
55+
rm -rf /var/tmp/hpcx-v2.22.1-gcc-doca_ofed-ubuntu20.04-cuda12-x86_64.tbz /var/tmp/hpcx-v2.22.1-gcc-doca_ofed-ubuntu20.04-cuda12-x86_64''')
56+
57+
@x86_64
58+
@ubuntu24
59+
@docker
60+
def test_defaults_ubuntu24(self):
61+
"""Default hpcx building block"""
62+
h = hpcx()
63+
self.assertEqual(str(h),
64+
r'''# Mellanox HPC-X version 2.22.1
4265
RUN apt-get update -y && \
4366
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
4467
bzip2 \
@@ -47,19 +70,19 @@ def test_defaults_ubuntu20(self):
4770
tar \
4871
wget && \
4972
rm -rf /var/lib/apt/lists/*
50-
RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://content.mellanox.com/hpc/hpc-x/v2.19/hpcx-v2.19-gcc-mlnx_ofed-ubuntu20.04-cuda12-x86_64.tbz && \
51-
mkdir -p /var/tmp && tar -x -f /var/tmp/hpcx-v2.19-gcc-mlnx_ofed-ubuntu20.04-cuda12-x86_64.tbz -C /var/tmp -j && \
52-
cp -a /var/tmp/hpcx-v2.19-gcc-mlnx_ofed-ubuntu20.04-cuda12-x86_64 /usr/local/hpcx && \
73+
RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://content.mellanox.com/hpc/hpc-x/v2.22.1/hpcx-v2.22.1-gcc-doca_ofed-ubuntu24.04-cuda12-x86_64.tbz && \
74+
mkdir -p /var/tmp && tar -x -f /var/tmp/hpcx-v2.22.1-gcc-doca_ofed-ubuntu24.04-cuda12-x86_64.tbz -C /var/tmp -j && \
75+
cp -a /var/tmp/hpcx-v2.22.1-gcc-doca_ofed-ubuntu24.04-cuda12-x86_64 /usr/local/hpcx && \
5376
echo "source /usr/local/hpcx/hpcx-init-ompi.sh" >> /etc/bash.bashrc && \
5477
echo "hpcx_load" >> /etc/bash.bashrc && \
55-
rm -rf /var/tmp/hpcx-v2.19-gcc-mlnx_ofed-ubuntu20.04-cuda12-x86_64.tbz /var/tmp/hpcx-v2.19-gcc-mlnx_ofed-ubuntu20.04-cuda12-x86_64''')
78+
rm -rf /var/tmp/hpcx-v2.22.1-gcc-doca_ofed-ubuntu24.04-cuda12-x86_64.tbz /var/tmp/hpcx-v2.22.1-gcc-doca_ofed-ubuntu24.04-cuda12-x86_64''')
5679

5780
@x86_64
5881
@centos
5982
@docker
6083
def test_defaults_centos7(self):
61-
"""Default mlnx_ofed building block"""
62-
h = hpcx()
84+
"""Default hpcx building block"""
85+
h = hpcx(version='2.19')
6386
self.assertEqual(str(h),
6487
r'''# Mellanox HPC-X version 2.19
6588
RUN yum install -y \
@@ -80,23 +103,23 @@ def test_defaults_centos7(self):
80103
@centos8
81104
@docker
82105
def test_defaults_centos8(self):
83-
"""Default mlnx_ofed building block"""
106+
"""Default hpcx building block"""
84107
h = hpcx()
85108
self.assertEqual(str(h),
86-
r'''# Mellanox HPC-X version 2.19
109+
r'''# Mellanox HPC-X version 2.22.1
87110
RUN yum install -y \
88111
bzip2 \
89112
numactl-libs \
90113
openssh-clients \
91114
tar \
92115
wget && \
93116
rm -rf /var/cache/yum/*
94-
RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://content.mellanox.com/hpc/hpc-x/v2.19/hpcx-v2.19-gcc-mlnx_ofed-redhat8-cuda12-x86_64.tbz && \
95-
mkdir -p /var/tmp && tar -x -f /var/tmp/hpcx-v2.19-gcc-mlnx_ofed-redhat8-cuda12-x86_64.tbz -C /var/tmp -j && \
96-
cp -a /var/tmp/hpcx-v2.19-gcc-mlnx_ofed-redhat8-cuda12-x86_64 /usr/local/hpcx && \
117+
RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://content.mellanox.com/hpc/hpc-x/v2.22.1/hpcx-v2.22.1-gcc-doca_ofed-redhat8-cuda12-x86_64.tbz && \
118+
mkdir -p /var/tmp && tar -x -f /var/tmp/hpcx-v2.22.1-gcc-doca_ofed-redhat8-cuda12-x86_64.tbz -C /var/tmp -j && \
119+
cp -a /var/tmp/hpcx-v2.22.1-gcc-doca_ofed-redhat8-cuda12-x86_64 /usr/local/hpcx && \
97120
echo "source /usr/local/hpcx/hpcx-init-ompi.sh" >> /etc/bashrc && \
98121
echo "hpcx_load" >> /etc/bashrc && \
99-
rm -rf /var/tmp/hpcx-v2.19-gcc-mlnx_ofed-redhat8-cuda12-x86_64.tbz /var/tmp/hpcx-v2.19-gcc-mlnx_ofed-redhat8-cuda12-x86_64''')
122+
rm -rf /var/tmp/hpcx-v2.22.1-gcc-doca_ofed-redhat8-cuda12-x86_64.tbz /var/tmp/hpcx-v2.22.1-gcc-doca_ofed-redhat8-cuda12-x86_64''')
100123

101124
@x86_64
102125
@ubuntu
@@ -291,7 +314,7 @@ def test_runtime(self):
291314
h = hpcx()
292315
r = h.runtime()
293316
self.assertEqual(r,
294-
r'''# Mellanox HPC-X version 2.19
317+
r'''# Mellanox HPC-X version 2.22.1
295318
RUN apt-get update -y && \
296319
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
297320
bzip2 \
@@ -300,9 +323,9 @@ def test_runtime(self):
300323
tar \
301324
wget && \
302325
rm -rf /var/lib/apt/lists/*
303-
RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://content.mellanox.com/hpc/hpc-x/v2.19/hpcx-v2.19-gcc-mlnx_ofed-ubuntu22.04-cuda12-x86_64.tbz && \
304-
mkdir -p /var/tmp && tar -x -f /var/tmp/hpcx-v2.19-gcc-mlnx_ofed-ubuntu22.04-cuda12-x86_64.tbz -C /var/tmp -j && \
305-
cp -a /var/tmp/hpcx-v2.19-gcc-mlnx_ofed-ubuntu22.04-cuda12-x86_64 /usr/local/hpcx && \
326+
RUN mkdir -p /var/tmp && wget -q -nc --no-check-certificate -P /var/tmp https://content.mellanox.com/hpc/hpc-x/v2.22.1/hpcx-v2.22.1-gcc-doca_ofed-ubuntu22.04-cuda12-x86_64.tbz && \
327+
mkdir -p /var/tmp && tar -x -f /var/tmp/hpcx-v2.22.1-gcc-doca_ofed-ubuntu22.04-cuda12-x86_64.tbz -C /var/tmp -j && \
328+
cp -a /var/tmp/hpcx-v2.22.1-gcc-doca_ofed-ubuntu22.04-cuda12-x86_64 /usr/local/hpcx && \
306329
echo "source /usr/local/hpcx/hpcx-init-ompi.sh" >> /etc/bash.bashrc && \
307330
echo "hpcx_load" >> /etc/bash.bashrc && \
308-
rm -rf /var/tmp/hpcx-v2.19-gcc-mlnx_ofed-ubuntu22.04-cuda12-x86_64.tbz /var/tmp/hpcx-v2.19-gcc-mlnx_ofed-ubuntu22.04-cuda12-x86_64''')
331+
rm -rf /var/tmp/hpcx-v2.22.1-gcc-doca_ofed-ubuntu22.04-cuda12-x86_64.tbz /var/tmp/hpcx-v2.22.1-gcc-doca_ofed-ubuntu22.04-cuda12-x86_64''')

0 commit comments

Comments
 (0)