Skip to content

Comments

fix: fix lmod PATH env for openmpi-5.0.8#27

Merged
spetrosi merged 1 commit intolinux-system-roles:mainfrom
spetrosi:fix-lmod-openmpi-508-path
Oct 7, 2025
Merged

fix: fix lmod PATH env for openmpi-5.0.8#27
spetrosi merged 1 commit intolinux-system-roles:mainfrom
spetrosi:fix-lmod-openmpi-508-path

Conversation

@spetrosi
Copy link
Collaborator

@spetrosi spetrosi commented Oct 7, 2025

Attempting to gather UCX debug info fails in the
openmpi-5.0.8-cuda12-gpu environment like so:

$ ml mpi/openmpi-5.0.8-cuda12-gpu
[azureuser@dgc-test-vm ~]$ ucx_info -d
ucx_info: Symbol `ucs_global_opts' has different size in shared object, consider re-linking
Segmentation fault (core dumped)
$

This is caused by running the system ucx_info binary against the HPCX libraries in the LD_LIBRARY_PATH:

[azureuser@dgc-test-vm ~]$ which ucx_info
/usr/bin/ucx_info
[azureuser@dgc-test-vm ~]$ ldd /usr/bin/ucx_info
linux-vdso.so.1 (0x00007ffd73fbc000)
libucp.so.0 =>
/opt/hpcx-v2.24.1-gcc-inbox-redhat9-cuda12-x86_64/ucx/hpcx-rebuild/lib/libucp.so.0 (0x00001537cbccd000)
libuct.so.0 =>
/opt/hpcx-v2.24.1-gcc-inbox-redhat9-cuda12-x86_64/ucx/hpcx-rebuild/lib/libuct.so.0 (0x00001537cbc90000)
libucs.so.0 =>
/opt/hpcx-v2.24.1-gcc-inbox-redhat9-cuda12-x86_64/ucx/hpcx-rebuild/lib/libucs.so.0 (0x00001537cbaea000)
libc.so.6 => /lib64/libc.so.6 (0x00001537cb800000)
libm.so.6 => /lib64/libm.so.6 (0x00001537cb725000)
libucm.so.0 =>
/opt/hpcx-v2.24.1-gcc-inbox-redhat9-cuda12-x86_64/ucx/hpcx-rebuild/lib/libucm.so.0 (0x00001537cbac2000)
libz.so.1 => /lib64/libz.so.1 (0x00001537cbaa8000)
/lib64/ld-linux-x86-64.so.2 (0x00001537cbdc8000)

Running the ucx_info binary from the ...ucx/hpcx-rebuild/bin/ directory orks correctly, as it was compiled against the HPCX libraries found via the LD_LIBARY_PATH.

Update all the path environments so the correct HPCX directories are searched first, hence finding the correct binaries fbraries and package configs for the selected openmpi environment.

Enhancement:

Reason:

Result:

Issue Tracker Tickets (Jira or BZ if any):

Summary by Sourcery

Update the openmpi-5.0.8-cuda12-gpu modulefile to correctly prioritize HPCX binaries and libraries

Bug Fixes:

  • Fix PATH and LD_LIBRARY_PATH ordering to prevent system ucx_info from loading mismatched HPCX libraries

Enhancements:

  • Introduce ompi_dir, ucx_dir, ucc_dir, and hcoll_dir variables and prepend their bin, lib, and pkgconfig paths
  • Include ucx, ucc, and hcoll bin directories in PATH alongside OpenMPI bin

Attempting to gather UCX debug info fails in the
openmpi-5.0.8-cuda12-gpu environment like so:

$ ml mpi/openmpi-5.0.8-cuda12-gpu
[azureuser@dgc-test-vm ~]$ ucx_info -d
ucx_info: Symbol `ucs_global_opts' has different size in shared object,
consider re-linking
Segmentation fault (core dumped)
$

This is caused by running the system ucx_info binary against the
HPCX libraries in the LD_LIBRARY_PATH:

[azureuser@dgc-test-vm ~]$ which ucx_info
/usr/bin/ucx_info
[azureuser@dgc-test-vm ~]$ ldd /usr/bin/ucx_info
	linux-vdso.so.1 (0x00007ffd73fbc000)
	libucp.so.0 =>
/opt/hpcx-v2.24.1-gcc-inbox-redhat9-cuda12-x86_64/ucx/hpcx-rebuild/lib/libucp.so.0
(0x00001537cbccd000)
	libuct.so.0 =>
/opt/hpcx-v2.24.1-gcc-inbox-redhat9-cuda12-x86_64/ucx/hpcx-rebuild/lib/libuct.so.0
(0x00001537cbc90000)
	libucs.so.0 =>
/opt/hpcx-v2.24.1-gcc-inbox-redhat9-cuda12-x86_64/ucx/hpcx-rebuild/lib/libucs.so.0
(0x00001537cbaea000)
	libc.so.6 => /lib64/libc.so.6 (0x00001537cb800000)
	libm.so.6 => /lib64/libm.so.6 (0x00001537cb725000)
	libucm.so.0 =>
/opt/hpcx-v2.24.1-gcc-inbox-redhat9-cuda12-x86_64/ucx/hpcx-rebuild/lib/libucm.so.0
(0x00001537cbac2000)
	libz.so.1 => /lib64/libz.so.1 (0x00001537cbaa8000)
	/lib64/ld-linux-x86-64.so.2 (0x00001537cbdc8000)

Running the ucx_info binary from the ...ucx/hpcx-rebuild/bin/
directory orks correctly, as it was compiled against the HPCX
libraries found via the LD_LIBARY_PATH.

Update all the path environments so the correct HPCX directories are
searched first, hence finding the correct binaries fbraries and
package configs for the selected openmpi environment.
@spetrosi spetrosi requested a review from richm as a code owner October 7, 2025 06:33
@sourcery-ai
Copy link

sourcery-ai bot commented Oct 7, 2025

Reviewer's Guide

Refactor the OpenMPI module file to introduce separate directory variables for OpenMPI and its HPCX components (UCX, UCC, HCOLL), and update all environment path and MPI_* variable assignments to ensure the correct binaries, libraries, and pkgconfigs are loaded first.

Class diagram for updated environment variable assignments in OpenMPI module

classDiagram
class "OpenMPIEnvironment" {
  +ompi_dir : string
  +ucx_dir : string
  +ucc_dir : string
  +hcoll_dir : string
  +PATH : string
  +LD_LIBRARY_PATH : string
  +PKG_LIBRARY_PATH : string
  +MANPATH : string
  +MPI_HOME : string
  +MPI_BIN : string
  +MPI_SYSCONFIG : string
  +MPI_INCLUDE : string
  +MPI_LIB : string
  +MPI_MAN : string
  +MPI_COMPILER : string
  +MPI_SUFFIX : string
}

class "HPCXComponent" {
  +ucx_dir : string
  +ucc_dir : string
  +hcoll_dir : string
}

"OpenMPIEnvironment" o-- "HPCXComponent" : uses
Loading

File-Level Changes

Change Details Files
Rename base_dir and introduce component-specific directory variables
  • Replace base_dir with ompi_dir for the OpenMPI installation path
  • Add ucx_dir, ucc_dir, and hcoll_dir variables for the HPCX component paths
templates/openmpi-ver-cuda12-gpu.lua
Expand environment PATH and library load paths for each component
  • Prepend bin directories of ompi_dir, ucx_dir, ucc_dir, and hcoll_dir to PATH
  • Prepend lib directories of each component to LD_LIBRARY_PATH
  • Prepend pkgconfig directories of each component to PKG_LIBRARY_PATH
  • Adjust MANPATH to include ompi_dir share/man only
templates/openmpi-ver-cuda12-gpu.lua
Update MPI_* environment variables to use ompi_dir
  • Set MPI_HOME, MPI_BIN, MPI_SYSCONFIG, MPI_INCLUDE, MPI_LIB, and MPI_MAN based on ompi_dir instead of base_dir
  • Retain MPI_COMPILER and MPI_SUFFIX settings
templates/openmpi-ver-cuda12-gpu.lua

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@spetrosi
Copy link
Collaborator Author

spetrosi commented Oct 7, 2025

[citest]

@spetrosi spetrosi merged commit be12d89 into linux-system-roles:main Oct 7, 2025
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant