Skip to content

docs: warn agents about misuse of OMPI_HIDDEN - #14318

Merged
hppritcha merged 1 commit into
open-mpi:mainfrom
hppritcha:dangers_of_hidden
Aug 13, 2026
Merged

docs: warn agents about misuse of OMPI_HIDDEN#14318
hppritcha merged 1 commit into
open-mpi:mainfrom
hppritcha:dangers_of_hidden

Conversation

@hppritcha

Copy link
Copy Markdown
Member

Add guidance explaining when it is (and is not) safe to annotate a symbol with OMPI_HIDDEN, so that contributors -- and AI coding agents in particular -- do not reintroduce the class of build breakage that need to be fixed in the initial version of code present in PR #14317.

As of Open MPI v6.0 the MPI interface is split across libmpi (Open MPI ABI) and libmpi_abi (standard MPI ABI), both of which link against the internal libopen_mpi. Many ompi_* symbols are defined in libopen_mpi but used from the bindings compiled into libmpi and libmpi_abi (for example, predefined handle objects like ompi_mpi_comm_parent and helpers like ompi_comm_split_type_hw_guided_support). Marking such a symbol OMPI_HIDDEN prevents it from being exported from libopen_mpi, so the links of both libmpi and libmpi_abi fail with unresolved symbols.

Two files are updated:

  • AGENTS.md: add a "Golden rules" bullet describing the hazard and the rule of thumb -- if a symbol crosses a library boundary, use OMPI_DECLSPEC (or leave it un-annotated), never OMPI_HIDDEN. Only hide symbols that are certainly private to a single DSO.

  • docs/developers/source-code.rst: add a "Hiding symbols with OMPI_HIDDEN" subsection under Symbol Visibility that documents the v6.0 library structure and includes a warning admonition covering the unresolved-symbol failure mode and the same rule of thumb.

These are documentation-only changes. CLAUDE.md is a symlink to AGENTS.md and is covered automatically.

Add guidance explaining when it is (and is not) safe to annotate a
symbol with OMPI_HIDDEN, so that contributors -- and AI coding agents in
particular -- do not reintroduce the class of build breakage that need to be
fixed in the initial version of code present in PR open-mpi#14317.

As of Open MPI v6.0 the MPI interface is split across libmpi (Open MPI
ABI) and libmpi_abi (standard MPI ABI), both of which link against the
internal libopen_mpi.  Many ompi_* symbols are defined in libopen_mpi but
used from the bindings compiled into libmpi and libmpi_abi (for example,
predefined handle objects like ompi_mpi_comm_parent and helpers like
ompi_comm_split_type_hw_guided_support).  Marking such a symbol
OMPI_HIDDEN prevents it from being exported from libopen_mpi, so the
links of both libmpi and libmpi_abi fail with unresolved symbols.

Two files are updated:

- AGENTS.md: add a "Golden rules" bullet describing the hazard and the
  rule of thumb -- if a symbol crosses a library boundary, use
  OMPI_DECLSPEC (or leave it un-annotated), never OMPI_HIDDEN.  Only hide
  symbols that are certainly private to a single DSO.

- docs/developers/source-code.rst: add a "Hiding symbols with
  OMPI_HIDDEN" subsection under Symbol Visibility that documents the
  v6.0 library structure and includes a warning admonition covering the
  unresolved-symbol failure mode and the same rule of thumb.

These are documentation-only changes.  CLAUDE.md is a symlink to
AGENTS.md and is covered automatically.

Signed-off-by: Howard Pritchard <howardp@lanl.gov>
@hppritcha
hppritcha merged commit 4f7ceac into open-mpi:main Aug 13, 2026
29 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants