PyLoadL - Python Interface to the IBM LoadLeveler API
from pyloadl import * version = version() # # Workload Management API # rc, errObj = ll_cluster_auth() rc, errObj = ll_cluster( cluster_list, CLUSTER_SET|CLUSTER_UNSET) 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. errObj = ll_movejob( jobstep, cluster) 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_preempt_jobs(user_list, host_list, job_list PREEMPT_STEP|RESUME_STEP) rc = ll_run_scheduler() rc, errObj = ll_modify( EXECUTION_FACTOR|CONSUMABLE_CPUS|CONSUMABLE_MEMORY| WCLIMIT_ADD_MIN|JOB_CLASS|ACCOUNT_NO, value, job_step ) # # Reservation API # rc, errObj = ll_bind(res_id, job_list, bind_op) rc, errObj = ll_remove_reservation(res_id_list, res_user_list, res_host_list, res_group_list) rc, errObj = ll_make_reservation(start_date, period, res_type, res_data, users_list, groups_list, group_owner) rc, errObj = ll_change_reservation( res_IDs, param_dict ) # # Error Handling API # ll_error(errObj, 1 | 2 ) # # Data Access API # query = ll_query( JOBS|MACHINES|CLUSTER|WLMSTAT|MATRIX|RESERVATIONS|MCLUSTERS) return = ll_set_request( query, QUERY_ALL|QUERY_JOBID|QUERY_STEPID| QUERY_GROUP|QUERY_CLASS|QUERY_HOST|QUERY_STARTDATE| QUERY_ENDDATE|QUERY_PROCID|QUERY_RESERVATION_ID, filter, ALL_DATA|Q_LINE|STATUS_LINE ) object, num_objs, error_code = ll_get_objs( query, LL_STARTD|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.
Pyloadl-0.0.5 is now coded to support LoadLeveler 3.1/3.2/3.3 and build against the installed LoadLeveler. 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
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@gingergeeks.co.uk>
IBM LoadLeveler for AIX 5L: Using and Administering