The mi_class_maxvps() function

The mi_class_maxvps() function obtains the maximum number of virtual processors (VPs) in a VP class.

Syntax

mi_integer mi_class_maxvps(VPclass_id, error)
   mi_integer VPclass_id;
   mi_integer *error;
VPclass_id
A VP-class identifier for the VP class whose maximum number of VPs the function is to return. This argument can be either of the following values:
A valid VP-class identifier
Obtains the maximum number of VPs in the specified VP class.
MI_CURRENT_CLASS VP-class constant
Obtains the maximum number of VPs in the VP class of the current VP.
error
A pointer to an error value to indicate whether the specified VP-class identifier is valid.
Valid in client LIBMI application? Valid in user-defined routine?
No Yes
Important: This advanced function can adversely affect your UDR if you use the function incorrectly. Use it only when no regular DataBlade® API function can perform the task you need done.

Usage

The mi_class_maxvps() function returns the maximum number of VPs allowed for the VP class that the VPclass_id argument specifies. The maximum number of VPs is the value assigned with the max option in the VPCLASS configuration parameter. For example, suppose you have the following VPCLASS configuration parameter:
VPCLASS=newvp, num=3, max=6
The mi_class_maxvps() function returns the value of 6 when it receives the VP-class identifier for the newvp VP class. You can obtain a VP-class identifier with the mi_vpinfo_classid() or mi_class_id() function. The following VPCLASS definition does not include the max option. Therefore, the number of VPs to start is unlimited.
VPCLASS=newvp2, num=3
To indicate the unlimited maximum number of VPs for the newvp2 class, mi_class_maxvps() returns MI_ERROR.
Tip: To obtain the number of active VPs in the VP class (initialized by the num option of the VPCLASS configuration parameter), use the mi_class_numvp() function.

For information about how to obtain information about VPs and VP classes, see the HCL OneDB™ DataBlade API Programmer's Guide.

Return values

>=0
The maximum number of VPs in the specified VP class. If the specified VP-class identifier is valid, mi_class_maxvps() sets the error argument to MI_OK. If this VP-class identifier is not valid, the function sets error to MI_ERROR.
-1
The specified VP class does not have a maximum number of VPs included in its definition. The number of VPs to start is unlimited.