Processor bindings

Applications can bind to a processor by using the bindprocessor system call. This system call assumes a processor-numbering scheme starting with zero (0) and ending with N-1, where N is the number of online CPUs.

N is determined programmatically by reading the _system_configuration.ncpus system variable. As processors are added and removed, this variable is incremented and decremented using dynamic logical partitioning.

Note that the numbering scheme does not include holes. Processors are always added to the Nth position and removed from the Nth-1 position. The numbering scheme used by the bindprocessor system call cannot be used to bind to a specific logical processor, because any processor can be removed and this is not reflected in the numbering scheme, because the Nth-1 CPU is always deallocated. For this reason, the identifiers used by the bindprocessor system call are called bind CPU IDs.

Changes to the _system_configuration.ncpus system variables have the following implications:
  • Applications must be prepared to receive an error from the bindprocessor system call if the last processor is removed after the applications have read the variable. This error condition was first introduced by the Dynamic Processor Deallocation (runtime deallocation of defective processors).
  • Applications that are designed to scale with the number of processors must reread the _system_configuration.ncpus system variable when the number of processors changes.

Applications can also bind to a set of processors using a feature of Workload Manager (WLM) called Software Partitioning. It assumes a numbering scheme that is based on logical CPU IDs, which also start with zero (0) and end with N-1. However, N in this case is the maximum number of processors that can be supported architecturally by the partition. The numbering scheme reflects both online and offline processors.

Therefore, it is important to note the type of binding that is used so that the correct remedy can be applied when removing a processor. The bindprocessor command can be used to determine the number of online processors. The ps command can be used to identify the processes and threads that are bound to the last online processor. After the targets have been identified, the bindprocessor command can be used again to define new attachments.

WLM-related dependencies can be resolved by identifying the particular software partitions that are causing problems. To resolve these dependencies, do the following:
Note: The system schedules bound jobs around offline or pending offline processors, so no change is required if the particular software partition has another online CPU.
  1. Use the lsrset command to view the set of software partitions that are used by WLM.
  2. Identify these software partitions by using the lsclass command.
  3. Identify the set of classes that use these software partitions by using the chclass command.
  4. Reclassify the system using the wlmctrl command.
At this point, the new class definitions take effect and the system automatically migrates bound jobs away from the logical processor that is being removed.