PyLoadL - Python Interface to the IBM LoadLeveler API
from pyloadl import * version = version() # # Workload Management API # rc = ll_control( control_op, host_list, user_list, job_list, class_list, priority ) rc = llctl( LL_CONTROL_START|LL_CONTROL_STOP|LL_CONTROL_RECYCLE|\ LL_CONTROL_RECONFIG|LL_CONTROL_DRAIN|LL_CONTROL_DRAIN_SCHEDD|\ LL_CONTROL_DRAIN_STARTD|LL_CONTROL_FLUSH|LL_CONTROL_PURGE_SCHEDD|\ LL_CONTROL_SUSPEND|LL_CONTROL_RESUME|LL_CONTROL_RESUME_STARTD|\ LL_CONTROL_RESUME_SCHEDD, host_list, class_list ) rc = llfavorjob( LL_CONTROL_FAVOR_JOB|LL_CONTROL_UNFAVOR_JOB,job_list ) rc = llfavoruser( LL_CONTROL_FAVOR_USER|LL_CONTROL_UNFAVOR_USER, user_list ) rc = llhold( LL_CONTROL_HOLD_USER|LL_CONTROL_HOLD_SYSTEM| LL_CONTROL_HOLD_RELEASE, host_list, user_list, job_list) rc = llprio( LL_CONTROL_PRIO_ABS|LL_CONTROL_PRIO_ADJ, job_list, priority) rc = ll_start_job_ext( cluster, proc, from_host, node_list ) rc = ll_terminate_job( cluster, proc, from_host, message ) (rc, errObj) = ll_preempt( job_step_id, PREEMPT_STEP|RESUME_STEP ) (rc, errObj) = ll_modify( EXECUTION_FACTOR|CONSUMABLE_CPUS|CONSUMABLE_MEMORY| WCLIMIT_ADD_MIN|JOB_CLASS|ACCOUNT_NO, value, job_step ) # # Error Handling API # ll_error(errObj, 1 | 2 ) # # Data Access API # query = ll_query( JOBS|MACHINES|CLUSTER|WLMSTAT|MATRIX) return = ll_set_request( query, QUERY_ALL|QUERY_JOBID|QUERY_STEPID| QUERY_GROUP|QUERY_CLASS|QUERY_HOST|QUERY_STARTDATE| QUERY_ENDDATE|QUERY_PROCID, filter, ALL_DATA|Q_LINE|STATUS_LINE ) object, num_objs, error_code = ll_get_objs( query, LL_STARTED|LL_SCHEDD|LL_CM|LL_MASTER|\ LL_STARTER|LL_HISTORY_FILE, hostname ) return = ll_reset_request( object ) next_object = ll_next_obj( object ) return = ll_free_objs( object ) return = ll_deallocate( object ) result = ll_get_data( object, LLAPI_Specification )
This module provides access to the APIs of the IBM LoadLeveler Workload Management System. The APIs currently implemented are:
The LoadLeveler API returns a huge amount of information, the ll_get_data call has over 300 different specifications that can be supplied. To use this module you really need a copy of the the IBM documentation on using LoadLeveler and maybe a copy of the llapi.h header file.
Currently the module is hard coded to the llapi.h supplied with LoadLeveler 3.2 and a valid llapi.h is required in the build process as well as the LoadLeveler library. If your installation is not in the expected location then modify the setup.py file.
Standard build/installation is via supported by the python distutils module
python setup.py build python setup.py install mv /usr/lib/python/site-packages/pyloadl.so /usr/lib/python/site-packages/pyloadl/
Many thanks are extended to Mary Cushion, Mike Hawkins, Peter Mayes and Waiman Chan plus anyone else who is unfortunate enough to know me.
Mark Roberts <mark@eiger.demon.co.uk>
IBM LoadLeveler for AIX 5L: Using and Administering