mpctl.2 (2010 09)

m
mpctl(2) mpctl(2)
Processor Socket Information
For processor socket 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_GETNUMSOCKETS_SYS
This request returns the number of enabled sockets (physical processors) in the
system. An enabled socket has at least one core enabled. The value will be
greater than or equal to 1. If the call is not implemented the value will be -1.
The spu and pid arguments are ignored.
Logical Processor and Processor Core Information
On systems with Hyper-Threading (HT) feature enabled, each processor core may have more than one
hyper-thread per physical processor core. When hyper-threading is enabled at the firmware level, each
hyper-thread is represented to the operating system and applications as a logical processor (LCPU).
Hence the basic unit of any topology information is a logical processor. However, some applications may
want to get the system topology information at the physical processor core level.
For processor core 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_GETNUMCORES_SYS
Returns the number of enabled processor cores in the system; this value will
always be greater than or equal to 1. The spu and pid arguments are ignored.
MPC_GETFIRSTCORE_SYS
Returns the processor core ID of the first enabled processor core in the system.
The spu and pid arguments are ignored.
MPC_GETNEXTCORE_SYS
Returns the processor core ID of the next enabled processor core in the system
after the specified processor core ID. The pid argument is ignored. Typically
MPC_GETFIRSTCORE_SYS
is called to determine the first processor core.
MPC_GETNEXTCORE_SYS
is then called in a loop (until the call returns -1) to
determine the IDs of the remaining processor cores.
MPC_GETCURRENTCORE
Returns the ID of the processor core the calling thread is currently running on
(not the processor core assignment of the caller). The spu and pid arguments
are ignored.
MPC_SPUTOCORE Returns the ID of the physical processor core containing the spu. The pid argu-
ment is ignored.
MPC_GETNUMCORES
Returns the number of processor cores in the processor set of the calling thread.
The spu and pid arguments are ignored.
MPC_GETFIRSTCORE
Returns the ID of the first processor core in the processor set of the calling
thread. The spu and pid arguments are ignored.
MPC_GETNEXTCORE
Returns the ID of the processor core in the processor set of the calling thread
after the processor core specified in spu . The pid argument is ignored.
For processor core and 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_LDOMCORES_SYS
Returns the number of enabled processor cores in the locality domain; this value
will always be greater than or equal to 0. The pid argument is ignored.
HP-UX 11i Version 3: September 2010 5 Hewlett-Packard Company 5