HP-UX Reference (11i v3 07/02) - 2 System Calls (vol 5)

m
mpctl(2) mpctl(2)
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.
MPC_LDOMCORES
Returns the number of enabled processor cores assigned to the current processor
set in the locality domain; this value will always be greater than or equal to 0. The
pid argument is ignored.
Processor and Locality Domain Binding
Each process shall have a processor and locality domain binding. Each LWP (lightweight process) shall
have a processor and locality domain binding. The binding assignments for a lightweight process do not
have to match the binding assignments for the process.
Setting the processor or locality domain binding on the process of a multithreaded process, causes all LWPs
(lightweight processes) in the target process to have their binding assignments changed to what is specified.
216 Hewlett-Packard Company 4 HP-UX 11i Version 3: February 2007