HP-UX Reference (11i v1 05/09) - 2 System Calls (vol 5)

m
mpctl(2) mpctl(2)
semaphores).
Machine Topology Information
Warning: Processor and locality domain IDs are not guaranteed to exist in numerical order. There may be
holes in a sequential list of IDs. Due to the capability of online addition and deletion of processors on some
platforms, IDs obtained via these interfaces may be invalid at a later time. Likewise, the number of proces-
sors and locality domains in the system may also change due to processors being added or deleted. Please
see Processor Set Information section to query machine topology within the application’s proces-
sor set.
For processor topology use:
int mpctl(mpc_request_t request, spu_t spu, pid_t pid);
The request argument determines the precise action to be taken by
mpctl and is one of the following:
MPC_GETNUMSPUS_SYS
This request returns the number of spus (processors) in the system. It will always
be greater than or equal to 1. The spu and pid arguments are ignored.
MPC_GETFIRSTSPU_SYS
This request returns the ID of the first processor in the system. The spu and pid
arguments are ignored.
MPC_GETNEXTSPU_SYS
This request returns the ID of the next processor in the system after spu. The pid
argument is ignored.
Typically,
MPC_GETFIRSTSPU_SYS
is called to determine the first spu.
MPC_GETNEXTSPU_SYS
is then called in a loop (until the call returns -1) to
determine the IDs of the remaining spus.
MPC_GETCURRENTSPU
This request returns the ID of the processor the caller is currently running on
(NOT the processor assignment of the caller). The spu and pid arguments are
ignored.
Warning: The information returned by this system call may be out-of-date arbi-
trarily soon after the call completes due to the scheduler context switching the
caller onto a different processor.
For locality domain topology use:
int mpctl(mpc_request_t request, ldom_t ldom, pid_t pid);
The request argument determines the precise action to be taken by mpctl and is one of the following:
MPC_GETNUMLDOMS_SYS
This request returns the number of locality domains in the system. It will always
be greater than or equal to 1. The ldom and pid arguments are ignored.
MPC_GETFIRSTLDOM_SYS
This request returns the ID of the first locality domain in the system. The ldom
and pid arguments are ignored.
MPC_GETNEXTLDOM_SYS
This request returns the ID of the next locality domain in the system after ldom.
The pid argument is ignored.
Typically, MPC_GETFIRSTLDOM_SYS is called to determine the first locality
domain.
MPC_GETNEXTLDOM_SYS is then called in a loop (until the call returns
-1) to determine the IDs of the remaining locality domains.
MPC_LDOMSPUS_SYS
This request returns the number of processors in the locality domain ldom. The
pid argument is ignored.
MPC_SPUTOLDOM
This request returns the ID of the locality domain containing processor spu. The
pid argument is ignored.
Section 2168 Hewlett-Packard Company 2 HP-UX 11i Version 1: September 2005