.\" Man page generated from reStructuredText
.\" by the Docutils 0.23 manpage writer.
.
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "PMIX_LOAD_TOPOLOGY" "3" "Nov 21, 2026" "" "OpenPMIx"
.sp
\fBPMIx_Load_topology\fP — Load the local hardware topology description.
.SH SYNOPSIS
.INDENT 0.0
.INDENT 3.5
.sp
.EX
#include <pmix.h>

pmix_status_t PMIx_Load_topology(pmix_topology_t *topo);
.EE
.UNINDENT
.UNINDENT
.SS Python Syntax
.INDENT 0.0
.INDENT 3.5
.sp
.EX
from pmix import *

foo = PMIxClient()
# ... after a successful foo.init() ...
rc = foo.load_topology()
.EE
.UNINDENT
.UNINDENT
.SH INPUT PARAMETERS
.INDENT 0.0
.IP \(bu 2
\fBtopo\fP: Pointer to a \fBpmix_topology_t\fP structure into which the topology
description of the local node is to be loaded. The structure must be
initialized by the caller prior to the call (for example, with
\fBPMIx_Topology_construct()\fP). If a particular topology \fIsource\fP is required
(e.g., \fB\(dqhwloc\(dq\fP), the \fBsource\fP field of the structure must be set to that
value before the call; otherwise the library selects an available source.
.UNINDENT
.SH DESCRIPTION
.sp
Obtain the topology description of the local node and load it into the provided
\fBpmix_topology_t\fP structure. This is a blocking operation that returns once the
topology has been loaded.
.sp
If the \fBsource\fP field of the provided \fBpmix_topology_t\fP is set, the PMIx
library must return a description from the specified implementation or else
indicate that the implementation is not available by returning
\fBPMIX_ERR_NOT_SUPPORTED\fP\&.
.sp
The returned description should be treated as a read\-only object; attempts to
modify it may result in errors. The PMIx library is responsible for performing
any required cleanup of the returned topology when the client library finalizes.
.sp
Ownership of the \fBsource\fP field depends on who set it:
.INDENT 0.0
.IP \(bu 2
If the caller set the \fBsource\fP field before the call to request a
particular implementation, that string belongs to the caller, and the caller
remains responsible for releasing it.
.IP \(bu 2
If the caller did \fInot\fP set the \fBsource\fP field, the library fills it in on
return with a read\-only, statically allocated string identifying the source
of the returned topology. The caller must \fBnot\fP modify or release this
string; the library manages its lifetime.
.UNINDENT
.sp
In neither case does the caller need to destruct the returned topology: the
topology object is shared, library\-managed state, and the library performs the
necessary cleanup at finalize. A caller that does pass the structure to
\fBPMIx_Topology_destruct()\fP (or \fBPMIX_TOPOLOGY_DESTRUCT\fP), before or after
finalize, only clears it: the library recognizes its own topology and leaves
it intact, and releases only a \fBsource\fP string the caller provided. Do not
free the returned topology by any other means (for example, by passing it to
\fBhwloc_topology_destroy\fP directly).
.SH RETURN VALUE
.sp
Returns \fBPMIX_SUCCESS\fP when a valid topology description has been loaded. On
error, a negative value corresponding to a PMIx error constant is returned,
including:
.INDENT 0.0
.IP \(bu 2
\fBPMIX_ERR_INIT\fP — the PMIx library has not been initialized.
.IP \(bu 2
\fBPMIX_ERR_NOT_AVAILABLE\fP — the operation cannot be serviced because the
library’s progress engine has been stopped.
.IP \(bu 2
\fBPMIX_ERR_NOT_FOUND\fP — the requested topology could not be found.
.IP \(bu 2
\fBPMIX_ERR_NOT_SUPPORTED\fP — the requested source is not available in the
current implementation.
.UNINDENT
.sp
Any other negative value indicates an appropriate error condition. PMIx error
constants are defined in \fBpmix_common.h\fP\&.
.SH NOTES
.sp
It is the responsibility of the caller to ensure that the \fBtopo\fP argument is
properly initialized prior to calling this API. If no \fBsource\fP was specified,
the caller should inspect the returned \fBsource\fP field to verify that the
returned topology description is compatible with the caller’s code.
.SH PROGRESS THREAD RESTRICTION
.sp
\fBA blocking PMIx call must not be made from within the PMIx progress
thread.\fP Any code the library itself invokes runs on that thread: an
event handler registered through
PMIx_Register_event_handler(3) \%<#\:man3-pmix-register-event-handler>,
a callback passed to a non\-blocking PMIx API, and — in a server or
tool — the completion of a host\-module up\-call. A blocking call
waits for work that the progress thread has to perform, so making one
from that thread waits for itself and never returns. The PMIx Standard
disallows it, and there is no way for an implementation to service such
a request.
.sp
Where this call has a blocking form — including the blocking
behavior a non\-blocking entry point adopts when it is passed a \fBNULL\fP
\fBcbfunc\fP — that form detects the situation and returns
\fBPMIX_ERR_WOULD_BLOCK\fP immediately, accompanied by a diagnostic naming
the call. Nothing is done and no callback is invoked.
.sp
\fBPMIX_ERR_WOULD_BLOCK\fP here is not a transient condition to retry: it
reports a call that cannot be serviced from where it was made. Reissue
it as the non\-blocking form with a callback, or from a thread of your
own.
.sp
\fBSee also:\fP
.INDENT 0.0
.INDENT 3.5
PMIx_Init(3) \%<#\:man3-pmix-init>,
PMIx_Compute_distances(3) \%<#\:man3-pmix-compute-distances>,
pmix_status_t(5) \%<#\:man5-pmix-status-t>,
pmix_topology_t(5) \%<#\:man5-pmix-topology-t>
.UNINDENT
.UNINDENT
.SH Copyright
2014-2026, OpenPMIx Community
.\" End of generated man page.
