When APS is enabled in the queue with APS_PRIORITY, the FAIRSHARE_QUEUES parameter is ignored. The QUEUE_GROUP parameter replaces FAIRSHARE_QUEUES, which is obsolete in LSF 7.0.
Begin QueueQUEUE_NAME = normalPRIORITY = 30NICE = 20APS_PRIORITY = WEIGHT [[JPRIORITY, 1] [QPRIORITY, 10]]QUEUE_GROUP = shortDESCRIPTION = For normal low priority jobs, running only if hosts are lightly loaded.End Queue...Begin QueueQUEUE_NAME = shortPRIORITY = 20NICE = 20End Queue
The APS value for jobs from the normal queue and the short queue are: calculated as:
The first 1 is the weight of the WORK factor; the second 1 is the weight of the job priority subfactor; the 10 is the weight of queue priority subfactor.
If you want the job priority to increase based on the pending time, you must configure JOB_PRIORITY_OVER_TIME parameter in the lsb.params.
Extending the example, you now want to add user-based fairshare with a weight of 100 to the APS value in the normal queue:
Begin QueueQUEUE_NAME = normalPRIORITY = 30NICE = 20FAIRSHARE = USER_SHARES [[user1, 5000] [user2, 5000] [others, 1]]APS_PRIORITY = WEIGHT [[JPRIORITY, 1] [QPRIORITY, 10] [FS, 100]]QUEUE_GROUP = shortDESCRIPTION = For normal low priority jobs, running only if hosts are lightly loaded.End Queue
APS_PRIORITY = 1 * (1 * job_priority + 10 * queue_priority) + 100 * user_priority
The order that the pending jobs are displayed is the order in which the jobs are considered for dispatch.
The APS value is calculated based on the current scheduling cycle, so jobs are not guaranteed to be dispatched in this order.
Pending jobs are ordered by APS value. Jobs with system APS values are listed first, from highest to lowest APS value. Jobs with calculated APS values are listed next ordered from high to low value. Finally, jobs not in an APS queue are listed. Jobs with equal APS values are listed in order of submission time.
If queues are configured with the same priority, bjobs -aps may not show jobs in the correct expected dispatch order. Jobs may be dispatched in the order the queues are configured in lsb.queues. You should avoid configuring queues with the same priority.
The following example uses this configuration;
bjobs -apsJOBID USER STAT QUEUE FROM_HOST JOB_NAME SUBMIT_TIME APS15 User2 PEND priority HostB myjob Dec 21 14:30 -22 User1 PEND Short HostA myjob Dec 21 14:30 (60)2 User1 PEND Short HostA myjob Dec 21 11:00 36012 User2 PEND normal HostB myjob Dec 21 14:30 3554 User1 PEND Short HostA myjob Dec 21 14:00 2705 User1 PEND Idle HostA myjob Dec 21 14:01 -
For job 2, APS = 10 * 20 + 1 * (50 + 220 * 5 /10) = 360For job 12, APS = 10 *30 + 1 * (50 + 10 * 5/10) = 355For job 4, APS = 10 * 20 + 1 * (50 + 40 * 5 /10) = 270
bqueues -l normalQUEUE: normal-- No description provided. This is the default queue.PARAMETERS/STATISTICSPRIO NICE STATUS MAX JL/U JL/P JL/H NJOBS PEND RUN SSUSP USUSP RSV500 20 Open:Active - - - - 0 0 0 0 0 0SCHEDULING PARAMETERSr15s r1m r15m ut pg io ls it tmp swp memloadSched - - - - - - - - - - -loadStop - - - - - - - - - - -SCHEDULING POLICIES: FAIRSHARE APS_PRIORITYAPS_PRIORITY:WEIGHT FACTORS LIMIT FACTORS GRACE PERIODFAIRSHARE 10000.00 - -RESOURCE 101010.00 - 1010hPROCESSORS -10.01 - -MEMORY 1000.00 20010.00 3hSWAP 10111.00 - -WORK 1.00 - -JOB PRIORITY -999999.00 10000.00 4131sQUEUE PRIORITY 10000.00 10.00 -USER_SHARES: [user1, 10]SHARE_INFO_FOR: normal/USER/GROUP SHARES PRIORITY STARTED RESERVED CPU_TIME RUN_TIMEuser1 10 3.333 0 0 0.0 0USERS: allHOSTS: allREQUEUE_EXIT_VALUES: 10