# Multi-factor Job Priority Plugin

Note: This document describes features added to SLURM version 2.0.

## Contents

- Introduction
- Job Priority Factors In General
- Age Factor
- Job Size Factor
- Partition Factor
- Quality of Service (QOS) Factor
- Fair-share Factor

## Introduction

The Multi-factor job priority plugin provides a very versatile facility for ordering the queue of jobs waiting to be scheduled. There are five factors that influence job priority:

Age
  the length of time a job has been waiting in the queue, eligible to be scheduled
Fair-share
  the difference between the portion of the computing resource that has been promised and the amount of resources that has been consumed
Job size
  the number of nodes a job is allocated
Partition
  a factor associated with each node partition
QOS
  a factor associated with each Quality Of Service

Additionally, a weight can be assigned to each of the above factors. This provides the ability to enact a policy that blends a combination of any of the above factors in any portion desired. For example, a site could configure fair-share to be the dominant factor (say 70%), set the job size and the age factors to each contribute 15%, and set the partition and QOS influences to zero.

## Job Priority Factors In General

The jobs priority at any given time will be a weighted sum of all the factors that have been enabled in the slurm configuration file. Job priority can be expressed as:

    Job_priority =
    	(age_weight) * (time_eligible_in_queue_factor) +
    	(fair-share_weight) * (fair-share_factor) +
    	(job_size_weight) * (number_of_nodes_factor) +
    	(partition_weight) * (partition_factor) +
    	(QOS_weight) * (QOS_factor)

All of the factors in this formula are floating point numbers that range from 0.0 to 1.0. The weights are unsigned, 32 bit integers. Consequently, the job's priority is a floating point number that ranges between 0.0 and 4294967295.0. The higher the number, the higher the job will be positioned in the queue, and the sooner the job will be scheduled. A job's priority, and hence its order in the queue, will vary over time. For example, the longer a job sits in the queue, the higher its priority will grow when the age_weight is non-zero.

## Age Factor

The age factor represents the length of time a job has been sitting in the queue and eligible to run. In general, the longer a job waits in the queue, the larger its age factor grows. However, the age factor for a dependent job will not change while it waits for the job it depends on to complete. Also, the age factor of a queued job whose node or time limits exceed the cluster's current limits will not change.

At some configurable length of time (PriorityMaxAge), the age factor will max out to 1.0.

## Job Size Factor

The job size factor correlates to the number of nodes the job has requested. This factor can be configured to favor larger jobs or smaller jobs based on the state of the PriorityFavorSmall boolean in the slurm configuration file. When PriorityFavorSmall is 0, the larger the job, the greater its job size factor will be. A job that requests all the nodes on the machine will get a job size factor of 1.0. When the PriorityFavorSmall Boolean is 1, the single node job will receive the 1.0 job size factor.

## Partition Factor

Each node partition can be assigned a factor from 0.0 to 1.0. The higher the number, the greater the job priority will be for jobs that are slated to run in this partition.

## Quality of Service (QOS) Factor

Each QOS can be assigned a factor from 0.0 to 1.0. The higher the number, the greater the job priority will be for jobs that request this QOS.

## Fair-share Factor

Last modified 9 February 2009