# Fairshare with queue priority

**URL:** <https://community.openpbs.org/t/fairshare-with-queue-priority/436>\
**Category:** Users/Site Administrators\
**Created:** [February 9, 2017, 11:01am UTC](https://community.openpbs.org/t/fairshare-with-queue-priority/436 "2017-02-09T11:01:07Z")\
**Posts on this page:** 1\
**Showing post:** 11

<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:** [October 28, 2017, 12:04am UTC](https://community.openpbs.org/t/fairshare-with-queue-priority/436/11 "2017-10-28T00:04:18Z")

</div>

At some point job ordering was turned into a multi-layer sort. If any one key is equal, it will drop down to the next layer. I believe the order is job\_sort\_formula, fairshare, job\_sort\_key. Using these three, the only time you’ll likely get down to job\_sort\_key is if the fairshare entities are the same.

The reason the scheduler complains at you when you use both job\_sort\_formula and job\_sort\_key is that when the RFE was implemented, the formula was supposed to supplant job\_sort\_key. The scheduler complains that you shouldn’t use both together. As a note, it isn’t really supported by PBS. It just happens to work.

I checked the code and that error message is strange. It specifically checks of for a second job\_sort\_key before it is printed. I would have expected it to print with just one.

In any case, the direction we want to move in will be to deprecate job\_sort\_key. The formula can do much more that just a tiered sort on resources.

If you are using the master branch of PBS, you can embed fairshare into the formula. See this [design doc](https://pbspro.atlassian.net/wiki/spaces/PD/pages/50947421/PP-718+Add+fairshare+usage+values+to+the+job+sort+formula)

There is a slight bug in it right now. You need to to turn on fair\_share in the sched\_config for it to work properly.

---

_[View the full topic](https://community.openpbs.org/t/fairshare-with-queue-priority/436)._
