HP Virtual Server Environment: Tips for Application Developers

(http://h21007.www2.hp.com/dev/ )
3. HP Serviceguard Developer's Toolbox
(http://h21007.www2.hp.com/dspp/tech/tech_TechSoftwareDetailPage_IDX/1,1703,
7445,00.html?jumpid=reg_R1002_USEN)
4. VSE RA Best Practices white paper
(http://h21007.www2.hp.com/dspp/files/unprotected/hpux/VSE-Ref-Arch-Best-
Practices.pdf )
5. Partitioning Continuum
(http://h71028.www7.hp.com/ERC/downloads/5982-
9141EN.pdf?jumpid=reg_R1002_USEN )
6. Dynamic Logical Processors for Hyper-Threading on HP-UX 11i v3
(search http://docs.hp.com, the location of this paper on docs.hp.com had not been
settled at publication time)
7. HP VSE Reference Architectures for HP-UX 11i:
(http://www.hp.com/go/vsera)
Appendix A - Using the mpctl() Call
The following code will print out the number of cores accessible by the local thread on an HP-UX
system. This will work regardless of the type of partition this code is running in (nPar, vPar, virtual
machine, PSET-based orFSS-based Resource Partition).
#include <sys/mpctl.h>
#include <stdio.h>
main() {
int ncores;
ncores=mpctl(MPC_GETNUMCORES);
printf("ncores=%d\n", ncores);
}
This code was compiled into an executable called “getnumcores” and run on various types of
partitions. The results are shown below.
When run in a nPar with 4 cores 2 of which were inactive iCAP:
# ./getnumcores
ncores=2
The same nPar, after activating 2 processors using Temporary Capacity:
# icod_modify -a 2 -t
4 processors are intended to be active and are currently active.
Processors using temporary capacity: 1
Projected temporary capacity expiration: 04/10/07 22:00:00
# ./getnumcores