# Replace starving with eligible\_time

**URL:** <https://community.openpbs.org/t/replace-starving-with-eligible-time/2433>\
**Category:** Developers\
**Created:** [January 14, 2021, 10:38pm UTC](https://community.openpbs.org/t/replace-starving-with-eligible-time/2433 "2021-01-14T22:38:38Z")\
**Posts on this page:** 7\
**Page:** 1

<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 14, 2021, 10:38pm UTC](https://community.openpbs.org/t/replace-starving-with-eligible-time/2433/1 "2021-01-14T22:38:38Z")

</div>

Ever since eligible\_time was introduced, using help\_starving\_jobs was not as good as using the job\_sort\_formula. One second a job is not starving and has low priority. The next second it has super high priority. Using eligible\_time in the job\_sort\_formula will allow jobs to slowly gain priority as they wait longer.

Design: [PBS Pro Confluence](https://openpbs.atlassian.net/wiki/spaces/PD/pages/2408087553/Obsolete+help+starving+jobs+max+starve)

If anyone has any comments, please post them here. Also, any real world examples of formulas with eligible\_time would be welcome.

Bhroam

---

<div class="post-metadata">

**Author:** ![agrawalravi90](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@agrawalravi90](https://community.openpbs.org/u/agrawalravi90)\
**Post date:** [January 14, 2021, 11:11pm UTC](https://community.openpbs.org/t/replace-starving-with-eligible-time/2433/2 "2021-01-14T23:11:05Z")

</div>

Thanks for doing this Bhroam. My only comment is that we usually keep the old functionality working while we tell users that we are deprecating it. You mentioned in the design that these will no longer work. So, just wanted to confirm that it is ok to do this.

---

<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 14, 2021, 11:19pm UTC](https://community.openpbs.org/t/replace-starving-with-eligible-time/2433/3 "2021-01-14T23:19:11Z")

</div>

help\_starving\_jobs has been deprecated for some time now (several years). It’s time to remove it. I didn’t really care that it existed before now, but it is now getting in the way of my scheduler persistence work. It will slow things down if I need to keep the starving status up to date on every job.

Bhroam

---

<div class="post-metadata">

**Author:** ![agrawalravi90](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@agrawalravi90](https://community.openpbs.org/u/agrawalravi90)\
**Post date:** [January 15, 2021, 12:37am UTC](https://community.openpbs.org/t/replace-starving-with-eligible-time/2433/4 "2021-01-15T00:37:57Z")

</div>

oh my bad, i didn’t read your design properly, if it’s been deprecated for years then we should get rid of it asap, thanks for clarifying

---

<div class="post-metadata">

**Author:** ![dtalcott](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/dtalcott/32/410_2.png) [@dtalcott](https://community.openpbs.org/u/dtalcott)\
**Post date:** [January 15, 2021, 11:58pm UTC](https://community.openpbs.org/t/replace-starving-with-eligible-time/2433/5 "2021-01-15T23:58:35Z")

</div>

The NAS mods to the scheduler define max\_starve on a per queue basis and use it to age jobs at different rates, based on the queue. This is something that could be done with a job\_sort\_formula, but it would be ugly. (Plus, job\_sort\_formula does not meet NAS’s needs for various, other reasons.)

When max\_starve is removed, NAS will need to bring it back, perhaps with a different name (e.g., “aging\_period”).

---

<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 16, 2021, 12:50am UTC](https://community.openpbs.org/t/replace-starving-with-eligible-time/2433/6 "2021-01-16T00:50:49Z")

</div>

I have a middleground which might work, but it’s just going to be a bit ugly.

Since job\_sort\_formula doesn’t work for NAS, I’m assuming you use job\_sort\_key. We could enhance job\_sort\_key in two ways

1. add an eligible\_time keyword
2. call formula\_evaluate() on each job\_sort\_key. This would mean you’d get a N job formulas which work like job\_sort\_key.

Now comes the ugly part. For each queue you wanted a different max\_starve for, you’d need to create a multisched. Each multisched has its own sched\_config, so you could have a different way of sorting based on that queue.

---

<div class="post-metadata">

**Author:** ![dtalcott](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/dtalcott/32/410_2.png) [@dtalcott](https://community.openpbs.org/u/dtalcott)\
**Post date:** [January 18, 2021, 4:09pm UTC](https://community.openpbs.org/t/replace-starving-with-eligible-time/2433/7 "2021-01-18T16:09:42Z")

</div>

You’re right, pretty ugly.

How about this: Go ahead and remove help\_starving\_jobs, is\_starving, and their logic, but leave max\_starve as a scheduler parameter, supported, but unused by standard code? That would allow NAS to keep their local code with just minor changes. Eventually, NAS should create a new scheduler config option and switch to it (e.g., “aging\_period”).
