External Interface Design for Power Awareness.
Technical Term | Description or Definition |
PMI | Power Management Infrastructure |
Tractability Matrix
Use Case(s) | Requirement(s) | Interface(s) |
---|---|---|
2.a | 3.a, 3.b, 3.e, 3.f | 2, 10, 11 |
2.b | 3.d, 3.g | 1, 4, 6, 7, 8, 9, 12, 24-38, 40-49 |
2.c | 3.c | 3, 5, 13, 18, 20, 21, 39 |
A. Interface changes
- Interface #1
- Visibility: Public
- Change Control: Stable
- Synopsis: Generically applicable server power_provisioning flag
- Reference to more detail on the interface.
- The power_provisioning boolean server attribute will have a default of unset, be visible to all and changeable by a manager. When it is set True, PMI operations may take place if allowed by vnode power_provisioning flag (see A.1.9). If it is unset or set False, no PMI operations will take place on any vnode.
Use qmgr to set the power_provisioning flag true or false. For example:
- Interface #2
- Visibility: Public
- Change Control: Stable
- Synopsis: Generically applicable energy usage for a job
- Add a new attribute for a job: resources_used.energy
- Reference to more detail on the interface.
- The type will be float.
- The units will be kWh. For example: resources_used.energy=64.2
- The resources_used.energy value will only be updated when PMI operations are allowed on the vnodes used by the job. The resources_used.energy value will not be seen in qstat -f output or server/accounting logs when PMI operations are not allowed on the node.
- Interface #3
- Visibility: Public
- Change Control: Stable
- Synopsis: Generically applicable resource “eoe”
- A new resource similar to “aoe” is added to both jobs and vnodes to specify the energy operational environment.
- Reference to more detail on the interface.
- Is added to default resource list of scheduler in sched_config file.
- It is a non-consumable resource.
- It is of type resource, added to attribute resources_available. e.g. resources_available.eoe=”low,med,high”. It is a string array.
- Contains list of all power profile names that are available on a vnode. By default, resources_available.eoe is unset.
- The list is visible to all but settable only by manager.
- Job Resource_List.eoe per chunk in –l select as –l select=1:ncpus:eoe=low. This will request one chunk from a node with resource_available.eoe=low.
- Only one eoe value can be active on a vnode at a time.
- A job Resource_List.eoe may be requested in a select statement but no more than one distinct value for the requested eoe is currently supported. i.e. -lselect=1:ncpus=1:eoe=med+1:ncpus=2:eoe=med
- If a Job request is made with more than one value for eoe (I.e. –l select=1:eoe=low+1:eoe=high), it will be rejected by qsub with the error “qsub: only one value of eoe is allowed”.
- A value for resources_available.eoe will not be automatically set on the system(s) where the PBS server and scheduler are running.
- If both an aoe and eoe are set for a job, the aoe setting will be processed first by the scheduler.
- The scheduler will not preempt a job with eoe set using suspend or checkpoint.
- Interface #4
- Visibility: Public
- Change Control: Stable
- Synopsis: Generically applicable vnode attribute: current_eoe
- Reference to more detail on the interface.
- Identifies the eoe active on a vnode. It is of type String. By default, it is unset. It is settable only by manager and visible to all.
- A job J1 running with a eoe setting X will cause the value of current_eoe to be set to X on the vnodes assigned to J1 that allow PMI operations.
- Manually changing current_eoe is unsupported.
- The scheduler can run a job requesting an eoe on vnodes with a current_eoe value that matches the job eoe.
- The scheduler can only run a job on a vnode where the current_eoe does not match the job eoe if no jobs are running on the vnode and PMI operations are allowed on the vnode.
- When a job ends the deactivate operation will take place if all the vnodes used by the job have no other jobs running and allow PMI operations. At this point, current_eoe will be unset on all the vnodes used by the job.
- Interface #5
- Visibility: Public
- Change Control: Stable
- Synopsis: Cray specific resource: pstate
- Reference to more detail on the interface.
- Cray ALPS reservation setting for p-state. See Basil 1.4 documentation.
- It is of type String. By default, it is unset. It is settable and visible to all PBS users.
- Interface #6
- Visibility: Public
- Change Control: Stable
- Synopsis: Cray specific resource: pgov
- Reference to more detail on the interface.
- Cray ALPS reservation setting for p-governor. See Basil 1.4 documentation.
- It is of type String. By default, it is unset. It is settable and visible to all PBS users.
- Interface #7
- Visibility: Public
- Change Control: Stable
- Synopsis: Cray specific resource: pcap_node
- Reference to more detail on the interface.
- Cray capmc set_power_cap --node setting. See capmc documentation.
- It is of type Int. By default, it is unset. It is settable and visible to all PBS users.
- A negative value will result in a PBSE_BADATVAL error.
- Interface #8
- Visibility: Public
- Change Control: Stable
- Synopsis: Cray specific resource: pcap_accelerator
- Reference to more detail on the interface.
- Cray capmc set_power_cap --accel setting. See capmc documentation.
- It is of type Int. By default, it is unset. It is settable and visible to all PBS users.
- A negative value will result in a PBSE_BADATVAL error.
- Interface #9
- Visibility: Public
- Change Control: Stable
- Synopsis: Generically applicable vnode power_provisioning flag
- Reference to more detail on the interface.
- The power_provisioning boolean vnode attribute will be unset by default, be visible to all and changeable by a manager.
Use qmgr to set the power_provisioning flag true or false. For example:
When it is set to True, PMI operations may take place on the vnode. If it is unset or set to False, no PMI operations are allowed to take place on the vnode.
- Interface #10
- Visibility: Public
- Change Control: Stable
- Synopsis: Mom log using logjobmsg when a job ends and the value of current_eoe is unset.
- Reference to more detail on the interface.
Example:
- Interface #11
- Visibility: Public
- Change Control: Unstable
- Synopsis: When the energy for a job on an SGI HPE system is obtained, it will be logged by MoM using logjobmsg.
- Reference to more detail on the interface.
Example:
- Interface #12
- Visibility: Public
- Change Control: Unstable
- Synopsis: The Cray capmc command invocations will be logged by MoM using LOG_DEBUG with the keyword “launch”.
- Reference to more detail on the interface.
Example:
- Interface #13
- Visibility: Public
- Change Control: Unstable
- Synopsis: Following a successful Cray capmc invocation, a message will be logged by MoM using LOG_WARNING if the time used by capmc is greater than 30 seconds.
- Reference to more detail on the interface.
Example:
- Interface #14
- Visibility: Public
- Change Control: Unstable
- Synopsis: If Cray capmc writes anything to stderr, the first line will be logged by MoM using LOG_WARNING after the “launch” message.
- Reference to more detail on the interface.
- Cray has not documented the possible stderr output from capmc.
Example:
- Interface #15
- Visibility: Public
- Change Control: Unstable
- Synopsis: When Cray capmc is run with the argument “get_node_energy_counter”, the node count is checked and if it is wrong, a message will be logged by MoM using logjobmsg.
- Reference to more detail on the interface.
- The same command will be run one additional time if an error is seen. No message will be logged for the first error. If an error occurs after the second attempt, a message is logged.
For example:
- The output from capmc should include a node count. If it does not, the messages will show “not set” instead of a number.
Example:
- Interface #16
- Visibility: Public
- Change Control: Unstable
- Synopsis: If Cray RUR is configured (see B.1.f), log messages will be logged by MoM using logjobmsg when a job ends.
- Reference to more detail on the interface.
A message will show the energy used by each aprun run by a job and a job tally in Joules. For example:
- Interface #17
- Visibility: Public
- Change Control: Unstable
- Synopsis: If Cray RUR is not configured, a log message will be logged by MoM using logjobmsg when a job ends.
- Reference to more detail on the interface.
Example:
- Interface #18
- Visibility: Public
- Change Control: Unstable
- Synopsis: At the end of a job on a Cray, the energy reported by capmc for the compute nodes used by the job will be logged by MoM using logjobmsg.
- Reference to more detail on the interface.
Example:
- Interface #19
- Visibility: Public
- Change Control: Unstable
- Synopsis: The energy reported by capmc for the compute nodes used by a job on a Cray will be logged by MoM using logjobmsg periodically every 5 minutes as the job runs.
- Reference to more detail on the interface.
Example:
- Interface #20
- Visibility: Public
- Change Control: Unstable
- Synopsis: When the PMI on a Cray is initialized, MoM will log messages at LOG_DEBUG.
- Reference to more detail on the interface.
Example:
- Interface #21
- Visibility: Public
- Change Control: Unstable
- Synopsis: When get_usage() is called for a job on a Cray, a message will be logged by MoM using logjobmsg.
- Reference to more detail on the interface.
Example:
- Interface #22
- Visibility: Public
- Change Control: Unstable
- Synopsis: When query() is called on a Cray, a message will be logged by MoM using LOG_DEBUG.
- Reference to more detail on the interface.
Example:
- Interface #23
- Visibility: Public
- Change Control: Unstable
- Synopsis: When activate_profile() is called on a Cray, a message will be logged by MoM using LOG_DEBUG.
- Reference to more detail on the interface.
Example:
- Interface #24
- Visibility: Public
- Change Control: Unstable
- Synopsis: When activate_profile() is called on a Cray but no compute nodes are allocated to the job, a message will be logged by MoM using logjobmsg.
- Reference to more detail on the interface.
Example:
- Interface #25
- Visibility: Public
- Change Control: Unstable
- Synopsis: When activate_profile() is called on a Cray and the job has pcap_node set, a message will be logged by MoM using logjobmsg showing the pcap_node value.
- Reference to more detail on the interface.
Example:
- Interface #26
- Visibility: Public
- Change Control: Unstable
- Synopsis: When activate_profile() is called on a Cray and the job has pcap_accelerator set, a message will be logged by MoM using logjobmsg showing the pcap_ accelerator value.
- Reference to more detail on the interface.
Example:
- Interface #27
- Visibility: Public
- Change Control: Unstable
- Synopsis: When activate_profile() is called on a Cray and the job has neither pcap_node or pcap_accelerator set, a message will be logged by MoM using logjobmsg.
- Reference to more detail on the interface.
Example:
- Interface #28
- Visibility: Public
- Change Control: Unstable
- Synopsis: When deactivate_profile() is called on a Cray, a message will be logged by MoM using LOG_DEBUG.
- Reference to more detail on the interface.
Example:
- Interface #29
- Visibility: Public
- Change Control: Unstable
- Synopsis: When deactivate_profile() is called on a Cray but no compute nodes are allocated to the job, a message will be logged by MoM using logjobmsg.
- Reference to more detail on the interface.
Example:
- Interface #30
- Visibility: Public
- Change Control: Unstable
- Synopsis: When deactivate_profile() is called on a Cray and the job has pcap_node set, a message will be logged by MoM using logjobmsg showing the pcap_node value.
- Reference to more detail on the interface.
Example:
- Interface #31
- Visibility: Public
- Change Control: Unstable
- Synopsis: When deactivate_profile() is called on a Cray and the job has pcap_accelerator set, a message will be logged by MoM using logjobmsg showing the pcap_ accelerator value.
- Reference to more detail on the interface.
Example:
- Interface #32
- Visibility: Public
- Change Control: Unstable
- Synopsis: When deactivate_profile() is called on a Cray and the job has neither pcap_node or pcap_accelerator set, a message will be logged by MoM using logjobmsg.
- Reference to more detail on the interface.
Example:
- Interface #33
- Visibility: Public
- Change Control: Unstable
- Synopsis: If Cray RUR is configured but the file created by the output plugin has a permission problem, a message will be logged by MoM using logjobmsg.
- Reference to more detail on the interface.
- The file owner must be 0 and it must not be writable by other.
Example:
- Interface #34
- Visibility: Public
- Change Control: Unstable
- Synopsis: If Cray RUR is configured but the file created by the output plugin can be read, a message will be logged by MoM using logjobmsg.
- Reference to more detail on the interface.
Example
- Interface #35
- Visibility: Public
- Change Control: Unstable
- Synopsis: If the file created by the RUR output plugin can be read but the energy value cannot be parsed, a message will be logged by MoM using logjobmsg.
- Reference to more detail on the interface.
- A python exception error string will be output as part of the message.
Example
- Interface #36
- Visibility: Public
- Change Control: Unstable
- Synopsis: If the file created by the RUR output plugin can be read but the Cray energy RUR plugin has not been enabled, a message will be logged by MoM using logjobmsg.
- Reference to more detail on the interface.
Example
- Interface #37
- Visibility: Public
- Change Control: Unstable
- Synopsis: When the energy for a job is successfully obtained from RUR, MOM will log one of three possible messages using logjobmsg.
- Reference to more detail on the interface.
If no energy value was obtained from capmc:
If the energy value from capmc was smaller than what was obtained from RUR:
If the energy value from capmc was greater than or equal to what was obtained from RUR:
- Interface #38
- Visibility: Public
- Change Control: Unstable
- Synopsis: When the PMI on an SGI HPE is initialized, MoM will log messages at LOG_DEBUG.
- Reference to more detail on the interface.
Example:
- Interface #39
- Visibility: Public
- Change Control: Unstable
- Synopsis: When get_usage() is called for a job on an SGI HPE, a message will be logged by MoM using logjobmsg.
- Reference to more detail on the interface.
Example:
- Interface #40
- Visibility: Public
- Change Control: Unstable
- Synopsis: When query() is called on an SGI HPE, a message will be logged by MoM using LOG_DEBUG.
- Reference to more detail on the interface.
Example:
- Interface #41
- Visibility: Public
- Change Control: Unstable
- Synopsis: When activate_profile() is called on an SGI HPE, a message will be logged by MoM using LOG_DEBUG.
- Reference to more detail on the interface.
Example:
- Interface #42
- Visibility: Public
- Change Control: Unstable
- Synopsis: When deactivate_profile() is called on an SGI HPE, a message will be logged by MoM using LOG_DEBUG.
- Reference to more detail on the interface.
Example:
- Interface #43
- Visibility: Public
- Change Control: Unstable
- Synopsis: If any PMI operation is attempted for a job with a vnode assigned that does not have power_provisioning=True, a message will be logged by MoM using logjobmsg.
- Reference to more detail on the interface.
Example
- Interface #44
- Visibility: Public
- Change Control: Unstable
- Synopsis: If the PMI hook is run with an unexpected event, MoM will log a message at LOG_WARNING.
- Reference to more detail on the interface.
Example
- Interface #45
- Visibility: Public
- Change Control: Unstable
- Synopsis: When the PMI hook handles the EXECHOST_STARTUP event and the MOM is running on the same host as the pbs_server or pbs_sched, MoM will log a message at LOG_DEBUG.
- Reference to more detail on the interface.
Example
- Interface #46
- Visibility: Public
- Change Control: Unstable
- Synopsis: If any PMI operation at job end throws a python exception, a message will be logged by MoM using logjobmsg showing the exception string.
- Reference to more detail on the interface.
Example
- Interface #47
- Visibility: Public
- Change Control: Unstable
- Synopsis: If activate_profile() throws either of the python exceptions defined in D.1.d.vii a message will be logged by MoM at LOG_WARNING.
- Reference to more detail on the interface.
- If the exception is BackendError, query() is called to reset the eoe value for the natural vnode for the MoM.
Example
- If the exception is InternalError, the natural vnode for the MoM will be set offline.
Example
- Interface #48
- Visibility: Public
- Change Control: Stable
- Synopsis: PBS hook order support range from [-1000, 2000].
- Reference to more detail on the interface.
Example
B. Administrator’s instructions
- Installation does not require any new or different steps. Once the PBS installation is complete, additional steps will be needed to enable power functionality.
Set power_provisioning on the server to true, and power_provisioning to true on the desired vnodes. For example:
If all vnodes will have power_provisioning set, @default can be used instead of individual vnode names. For example:
- If eoe values are not provided by the PMI, additional steps are needed.
- Use qmgr to set resources_available.eoe for vnodes.
- Import a submit hook that will map the eoe values to job resources. See B.4.e.
- To disable power provisioning, set power_provisioning to false.
- If power_provisioning is set to false while jobs are running, the running jobs would not have their profile deactivated when they finished and the resources_used.energy value would not be set or updated at the end of the job. If periodic hook event is already run at least once before setting provisioning to False, resources_used.energy will have a value but it would not be an accurate one.
- To disable power provisioning on selected vnodes, set power_provisioning on the vnodes to False.
- If power_provisioning is set to false on the mother superior while jobs are running, the running jobs would not have their profile deactivated when they finished and the resources_used.energy value would not be set or updated at the end of the job. If periodic hook event is already run at least once before setting power_provisioning to False, resources_used.energy will have a value but it would not be an accurate one.
- An optional step on a Cray system can be preformed to use the RUR system to obtain the energy used by each aprun. Please see the Cray document “Managing System Software for the Cray® Linux Environment” http://docs.cray.com/books/S-2393-5101/S-2393-5101.pdf. Chapter 12 will provide information on RUR.
The RUR config file has to be modified to use the PBS output plugin:
- If eoe values are provided by the PMI, additional steps are needed to allow the server and MOMs to communicate the eoe values.
- After setting power_provisioning on the desired vnodes, restart or HUP the MOMs.
- Check that resources_available.eoe values are set on the vnodes. It may take up to two minutes for the eoe values to be reported to the server. If any vnodes do not report eoe values, restart or HUP the MOMs a second time for the vnodes missing eoe values.
- An upgrade may require some additional steps.
- If a job prologue script is defined as described in the PBS Professional Administrator's Guide section 12.4.4, this must be converted into an execjob_prologue hook before power provisioning can be enabled. A prologue script will no longer run after power_provisioning is enabled.
If any host is running PBS with an alternate location for the pbs.conf file, PBS_CONF_FILE must be added to the pbs_environment file on that host. On Linux systems, the default location for the pbs.conf file is /etc/pbs.conf. The pbs.conf file is used by each MOM to check if the server or scheduler is running on the local host. If so, the node will not be automatically configured for power provisioning. For example, if /var/pbs.conf is the active pbs.conf file, the following line must be added to PBS_HOME/pbs_environment:
- New behavior
- When the power_provisioning server attribute is set to True, the PBS MOM will detect and use the PMI on the system where it is running. The PMIs supported are:
- SGI HPE Event Driven Framework part of HPE Management software
- CRAY capmc on XC30 hardware platforms with SMW software release 7.0.UP03 and later.
- The instructions to add or change power profile information are provided by the PMI provider if they are supported. Here is a list of PMI vendors that support named power profiles.
- SGI HPE
- If the PMI does not support named power profiles, the resources_available.eoe should be set manually for all the nodes to give a list power profiles. The eoe values will be mapped to a set of options that are specific to the PMI (see B.4.e). Here is a list of PMI providers that do not support named power profiles. The options available for each provider follow their name.
- CRAY
- pstate: a value for the ALPS reservation p-state.
- pgov: a value for the ALPS reservation p-governor value.
- pcap_node: a power cap value for each job node in watts.
- pcap_accelerator: a power cap value for node accelerator.
- CRAY
- If the PMI power profile names are obtained from one of the vendors listed in B.4.b, then the resources_available.eoe values will be set automatically when power_provisioning is True.
- This will occur when MOM starts.
- A refresh can be forced to happen for a node by restarting or sending a HUP signal to the MOM.
If the PMI power profile names are obtained from one of the vendors listed in B.4.c, then eoe values must be set manually on the vnodes and a submit hook needs to map the eoe values to the options listed for the PMI vendor. The hook will set the desired job attributes for each possible eoe value. For example:
- If settings for pstate, pgov, pcap_node, or pcap_accerator are made by the user, then the hook must be written to either overwrite or use the user values as desired. For example, if the hook above were used as is and the user set a value for eoe to “high”and a value for pcap_node, then the pcap_node value would be in effect which would not normally happen when eoe was set to “high”.
- When a job is run without a eoe value and power_provisioning is True, no activation is done but the resources_used.energy value for jobs will still be calculated.
- If both aoe and eoe are set for a vnode, the eoe values must be the same for all the different application operating environments.
- When the power_provisioning server attribute is set to True, the PBS MOM will detect and use the PMI on the system where it is running. The PMIs supported are:
- No functionality was deprecated for this RFE.
- Additional notes to break the administrator's instructions into one section for SGI HPE and one for Cray.
- SGI HPE
Set power_provisioning on the server to true. For example:
Set power_provisioning to true on the desired vnodes. For example:
- Restart or HUP the MOMs.
- Check for eoe values as described in B.1.g.ii.
- Cray
Set power_provisioning on the server to true and power_provisioning to true on the desired vnodes. For example:
- Use qmgr to set resources_available.eoe for vnodes.
- Import a submit hook that will map the eoe values to job resources. See B.4.e.
- Setup RUR if desired. See B.1.f.
- SGI HPE
C. User’s instructions
- Submit a job which will request a specific power profile.
Use the provisioning feature and set “eoe” to a power profile name. For example:
- Submit a job without a value for “eoe”. The behavior of the server and scheduler will not be changed for this case. When this job runs, the power profile of the execution hosts may be changed depending on the implementation of the PMI. For example, on a Cray (see B.4.c.1), a job can have job attributes (see A.6, A.7, A.8 and A.9) that affect the execution hosts.
- The “resources_used.energy” will be set with a value provided by the PMI. As with existing behavior, all values for “resources_used” will be written in the accounting log.
For example, energy could be included with resources_used for a job 'E' record:
- Monitor power usage of a job.
- Use qstat to see the resources_used.energy value as the job runs.
D. Internal Design Interfaces
- Interface #1
Visibility: Public
Change Control: Stable
Synopsis: PBS hook power control module
A new class “pbs.Power” will be made available that will provide power functionality. A hook will be able to access it via python import.
Reference to more detail on the interface. The following define the PMI operations available:
activate_profile(self, profile_name, job)
Activate a given power profile on a set of hosts on behalf of a given job. The parameter “profile_name” is a string containing the name of a profile. The parameter “job” is a PBS job object. The hosts will be calculated from the job object. If the job parameter is not specified, the pbs.event().job object will be used.
The return type is bool where True indicates success and False indicates the request was made without an indication from the PMI if it was successful or not.
If an error occurs where it is appropriate for some or all of the job vnodes to be marked offline, this may be done before an exception is raised.
If an error occurs where it is appropriate for the supported profile names for some or all of the job vnodes to be refreshed, this may be done before an exception is raised.
get_usage(self, job)
Retrieve power usage for a job. The parameter “job” is a PBS job object.
The return will be a float which gives the cumulative energy usage for the job at the time of the call in kilowatt-hours (kWh). If no power usage information is available, None is returned.
deactivate_profile(self, job)
Inform the PMI that a job is no longer active. This would be used when a job is suspended or terminated. The parameter “job” is a PBS job object. If it is not specified, the pbs.event().job object will be used.
The return type is bool where True indicates success and False indicates the request was made without an indication from the PMI if it was successful or not.
query(self, query_type)
Return information that matches a request type. The parameter “query_type” is used to specify what should be returned. The only value for query_type is QUERY_PROFILE, and the return will be a list of strings giving profile names supported by the PMI.
connect(self, endpoint, port)
Connect to the PMI. The parameter “endpoint” defaults to None and is a string which will be meaningful to the PMI. The parameter “port” defaults to None and is an integer. A typical usage would be “endpoint” specifying a hostname and “port” giving a network port for a network service connection.
Currently the connection/disconnection will be done per hook instead of creating a long lasting session.
Nothing is returned, the connection information is maintained in an instantiation of the Power class.
If the endpoint or port parameters are not specified, the underlying code specific to the PMI will determine the connection details.
disconnect(self)
Disconnect from the PMI. There are no parameters needed since each instance of the Power class is associated to a backend power management interface.
Exceptions
InternalError - returned in cases where the underlying cause of a failure cannot be determined.
BackendError - the backend PMI call was unsuccessful.
Power module initialization
A string can optionally be passed to specify the name of the PMI to be used (see D.2). By default, the type of PMI to be used will be determined automatically based on the type of hardware used.
Examples
Activate a profile from a job specific event.
Get profile name list.
Deactivate profile on a specific job.
- Interface #2
- Visibility: Public
- Change Control: Unstable
- Synopsis: Expose the hook PMI structure to allow additions to the supported PMI list.
- Reference to more detail on the interface.
The PBS “power” hook can be modified to specify a PMI name in the pbs.Power() instantiation in the init_power function. For example, the code below would cause the new file described in D.2.d.ii to be used by the hook:
Python code patterned after the file PBS_EXEC/lib/python/altair/pbs/v1/_pmi_none.py must be placed in a file where none is replaced by the PMI name being implemented. For example:
- The defined functions must all be present: __init__, _connect, _disconnect, _get_usage, _query, _activate_profile, _deactivate_profile. These all have the same arguments as those in I.1.1 except the function name has an intial underbar ('_').