Skip to content

[v5.0.x] ompi/rte: Increase job name printing buffer size - #14409

Merged
janjust merged 1 commit into
v5.0.xfrom
backport/pr-14398-to-v5.0.x
Sep 11, 2026
Merged

janjust merged 1 commit into
v5.0.xfrom
backport/pr-14398-to-v5.0.x

Conversation

@ompi-backport-bot

Copy link
Copy Markdown

Backport of #14398 to v5.0.x.


ompi_pmix_print_id may try to print a string longer than 50 bytes onto the print name buffer:

snprintf(ptr->buffers[ptr->cntr++],
OPAL_PRINT_NAME_ARGS_MAX_SIZE,
"%s.%u", procid->nspace, procid->rank);

nspace defaults to singleton.{hostname}.{pid} (hostname alone can be as long as 64 bytes.) on singleton process, and can be as long as PMIX_MAX_NSLEN. A truncated id causes mismatch and resulted in MPI_Comm_spawn returning MPI_ERR_UNKNOWN.

This PR bumps the buffer size to be enough to hold any ID.

Also fix a size calculation issue:

The functions snprintf() and vsnprintf() write at most size bytes
(including the terminating null byte ('\0')) to str.

so OPAL_PRINT_NAME_ARGS_MAX_SIZE + 1 is not needed.

Signed-off-by: Yuan Tong <[email protected]>
(cherry picked from commit 6d83fe4)
@ompi-backport-bot ompi-backport-bot Bot added the target:v5.0.x Backport targeting the v5.0.x branch label Sep 9, 2026
@github-actions github-actions Bot added this to the v5.0.10 milestone Sep 9, 2026
@janjust
janjust merged commit 8616a37 into v5.0.x Sep 11, 2026
15 checks passed
@janjust
janjust deleted the backport/pr-14398-to-v5.0.x branch September 11, 2026 15:56
dmitry-tokarev-nv added a commit to ai-dynamo/dynamo that referenced this pull request Sep 24, 2026
Comment-only change. It describes the PMIX_HOSTNAME hook from fc14cb3
and names the condition for removing each part of the workaround.

- The cause, in one line: Open MPI passes the singleton's name,
  "singleton.<hostname>.<pid>.0", to prte through a 50-byte print buffer,
  so a longer name is cut short and prte registers the wrong one.
- The limitation: a PMIX_HOSTNAME that is already set is left alone, even
  a long one. NVBug 6722913's own measurements show that a 63-character
  PMIX_HOSTNAME fails even on a short host.
- Removing the hook: the fix is open-mpi/ompi#14398 (v5.0.x backport:
  open-mpi/ompi#14409), and Mellanox/ompi's v5.0.x_hpcx branch has it
  since Mellanox/ompi#61. Open MPI 5.0.11 does not have it, and TRT-LLM
  1.3.0rc27 and 1.3.0rc28 ship HPC-X v2.50 with Open MPI 5.0.10rc2, which
  fail the same spawn. Delete the hook, its install step and its tests
  once a spawn with a 46-character hostname passes in a base image
  without the hook. Tracked in NVIDIA/TensorRT-LLM#19607.
- Removing the amd64 ompi4 selection needs more: ompi5 must spawn on amd64
  without the hook, both in CI and on a host with extra interfaces.

Evidence that nothing else changed: the Python ASTs of both modules are
identical with docstrings removed, the Dockerfile diff touches only
comment lines, and all TRT-LLM targets still render.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Signed-off-by: Dmitry Tokarev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Target: v5.0.x target:v5.0.x Backport targeting the v5.0.x branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants