# \[Q\] Scheduling algorithm

**URL:** <https://community.openpbs.org/t/q-scheduling-algorithm/1403>\
**Category:** Users/Site Administrators\
**Created:** [January 17, 2019, 4:32am UTC](https://community.openpbs.org/t/q-scheduling-algorithm/1403 "2019-01-17T04:32:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![hiroyuki-sato](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/hiroyuki-sato/32/168_2.png) [@hiroyuki-sato](https://community.openpbs.org/u/hiroyuki-sato)\
**Post date:** [January 17, 2019, 4:32am UTC](https://community.openpbs.org/t/q-scheduling-algorithm/1403/1 "2019-01-17T04:32:44Z")

</div>

Hello, members.

I would like to know PBS Professional (18.1) scheduling algorithm  
IIUC, A basic algorithm is following. Is this correct?

- Basic scheduling is First in First out.
- If a job(Job A) can’t assign a resource, it waits until resource available.  
(If this job request 12 chunks, And It not available)
- If resource available for another job(Job B which is submitted after Job A)(ex. request 2 chunks), PBS process jobs B before A.

Best regards.

---

<div class="post-metadata">

**Author:** ![Takahiro](https://avatars.discourse-cdn.com/v4/letter/t/ea666f/32.png) [@Takahiro](https://community.openpbs.org/u/Takahiro)\
**Post date:** [January 17, 2019, 6:51am UTC](https://community.openpbs.org/t/q-scheduling-algorithm/1403/2 "2019-01-17T06:51:47Z")

</div>

Hi, @hiroyuki-sato,

I think that it is maybe correct.  
Suppose that, there are 2 people X and Y, and  
X submit job(s) type Job A, and Y submit many many jobs type JobB.  
Perhaps, X’s job(s) will be waiting untill all of Y’s jobs fiinish.  
So, in my compnay, user X were very angly 😡!  
Hence, I changed configurations strict\_ordering and backfill.

Sincerely,

---

<div class="post-metadata">

**Author:** ![adarsh](https://avatars.discourse-cdn.com/v4/letter/a/f07891/32.png) [@adarsh](https://community.openpbs.org/u/adarsh)\
**Post date:** [January 17, 2019, 8:14am UTC](https://community.openpbs.org/t/q-scheduling-algorithm/1403/3 "2019-01-17T08:14:30Z")

</div>

+1 Takahiro

@hiroyuki-sato : Please refer this section of the PBS Pro administrator guide  
**4.3 Scheduling Policy Basics**

> **[PBS18.2.3\_BigBook.pdf](https://www.pbsworks.com/pdfs/PBS18.2.3_BigBook.pdf)**
>
> 23.59 MB

Please check these settings and their information in the above manual:  
`source /etc/pbs.conf;cat $PBS_HOME/sched_priv/sched_config | grep -v "#" | grep ^[a-zA-Z]`

Additionally:

- check job\_sort\_formula

---

<div class="post-metadata">

**Author:** ![hiroyuki-sato](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/hiroyuki-sato/32/168_2.png) [@hiroyuki-sato](https://community.openpbs.org/u/hiroyuki-sato)\
**Post date:** [January 17, 2019, 8:55am UTC](https://community.openpbs.org/t/q-scheduling-algorithm/1403/4 "2019-01-17T08:55:28Z")

</div>

Hello, @Takahiro and @adarsh

Thank you for replying. I’ll take a look that document.  
The current setting is the following.

- no job\_sort\_formula settings
- strict\_ordering: FALSE

Best regards.

---

<div class="post-metadata">

**Author:** ![bhroam](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/bhroam/32/20_2.png) [@bhroam](https://community.openpbs.org/u/bhroam)\
**Post date:** [January 18, 2019, 10:44pm UTC](https://community.openpbs.org/t/q-scheduling-algorithm/1403/5 "2019-01-18T22:44:01Z")

</div>

The default behavior out of the box is what you described. We do so much more.

If you don’t like FIFO, then use the job\_sort\_formula, job\_sort\_key, or fairshare.

If you dislike how the scheduler moves on and runs Job B instead of waiting for Job A, look at strict\_ordering. This will enforce the order (sorted or FIFO). If walltimes are provided and backfill\_depth is not equal to 0, then the scheduler will backfill around the higher priority jobs. By default backfill\_depth is 1, so maybe increase that to 10 or 50. Keep in mind that a higher backfill\_depth will slow down the scheduler.

You can also use preemption to get your higher priority jobs running faster if you don’t mind delaying lower priority currently running jobs.

These are just a small number of options our scheduler provides to help craft your scheduling policy. If you want to see them all, read through the scheduling chapter in the big book as @adarsh suggested.

Bhroam
