# "nice" resource

**URL:** <https://community.openpbs.org/t/nice-resource/291>\
**Category:** Users/Site Administrators\
**Created:** [October 18, 2016, 2:37pm UTC](https://community.openpbs.org/t/nice-resource/291 "2016-10-18T14:37:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![vchlum](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/vchlum/32/93_2.png) [@vchlum](https://community.openpbs.org/u/vchlum)\
**Post date:** [October 18, 2016, 2:37pm UTC](https://community.openpbs.org/t/nice-resource/291/1 "2016-10-18T14:37:22Z")

</div>

Hello All,  
I have a question about a “nice” resource. How this resource should actually work? This is some kind of priority? I added this resource to the “resources” in sched\_config and assigned different “nice” value to each node but it does nothing… I tried “qsub -I -l nice=” and always got the same node. Documentation mention this resource(AG-316, RG-323) but it is too brief.  
Thank you

---

<div class="post-metadata">

**Author:** ![jon](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/jon/32/23_2.png) [@jon](https://community.openpbs.org/u/jon)\
**Post date:** [October 18, 2016, 4:17pm UTC](https://community.openpbs.org/t/nice-resource/291/2 "2016-10-18T16:17:16Z")

</div>

Have you tried adding it to you select line. For example

-l select=1:ncpus=3:nice=2

---

<div class="post-metadata">

**Author:** ![vchlum](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/vchlum/32/93_2.png) [@vchlum](https://community.openpbs.org/u/vchlum)\
**Post date:** [October 18, 2016, 4:34pm UTC](https://community.openpbs.org/t/nice-resource/291/3 "2016-10-18T16:34:16Z")

</div>

RG-323: “Can be requested only outside of a select statement.”  
$ qsub -I -l select=2:ncpus=1:nice=2  
qsub: Resource invalid in “select” specification: nice

---

<div class="post-metadata">

**Author:** ![scc](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/scc/32/234_2.png) [@scc](https://community.openpbs.org/u/scc)\
**Post date:** [October 18, 2016, 4:57pm UTC](https://community.openpbs.org/t/nice-resource/291/4 "2016-10-18T16:57:23Z")

</div>

The special resource “nice” would not be expected to have an effect on the node selection for the job, it is expected to change the nice process value, though. Here is an example showing how it works (\*\*emphasis in top output mine\*\*):

```
[user1@centos7 tmp]$ echo "sleep 100000" | qsub
33.centos7.prog.altair.com

[user1@centos7 tmp]$ echo "sleep 100000" | qsub -lnice=10
34.centos7.prog.altair.com

[root@centos7 tmp]# qstat -a

centos7.prog.altair.com:
                                                            Req'd Req'd Elap
Job ID Username Queue Jobname SessID NDS TSK Memory Time S Time
--------------- -------- -------- ---------- ------ --- --- ------ ----- - -----
33.centos7.prog user1 workq STDIN 4327 1 1 -- -- R 00:01
34.centos7.prog user1 workq STDIN 4368 1 1 -- -- R 00:01

[root@centos7 tmp]# qstat -a

centos7.prog.altair.com:
                                                            Req'd Req'd Elap
Job ID Username Queue Jobname SessID NDS TSK Memory Time S Time
--------------- -------- -------- ---------- ------ --- --- ------ ----- - -----
33.centos7.prog user1 workq STDIN 4327 1 1 -- -- R 00:01
34.centos7.prog user1 workq STDIN 4368 1 1 -- -- R 00:01

```

Job 33, no nice request:

```
[root@centos7 tmp]# ps -efj | grep 4327
user1 4327 3265 4327 4327 0 12:50 ? 00:00:00 -bash
user1 4361 4327 4327 4327 0 12:50 ? 00:00:00 -bash
user1 4362 4361 4327 4327 0 12:50 ? 00:00:00 sleep 100000
root 4440 3079 4439 3079 0 12:52 pts/0 00:00:00 grep --color=auto 4327

[root@centos7 tmp]# top -b -p4362 -n1
top - 12:53:43 up 19:13, 3 users, load average: 0.01, 0.06, 0.06
Tasks: 1 total, 0 running, 1 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.1 us, 0.1 sy, 0.0 ni, 99.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 8011144 total, 7038784 free, 391616 used, 580744 buff/cache
KiB Swap: 2183164 total, 2183164 free, 0 used. 7340456 avail Mem

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
 4362 user1 20 **0** 107892 624 532 S 0.0 0.0 0:00.00 sleep

```

Job 34, nice=10 request:

```
[root@centos7 tmp]# ps -efj | grep 4368
user1 4368 3265 4368 4368 0 12:50 ? 00:00:00 -bash
user1 4402 4368 4368 4368 0 12:50 ? 00:00:00 -bash
user1 4403 4402 4368 4368 0 12:50 ? 00:00:00 sleep 100000
root 4456 3079 4455 3079 0 12:54 pts/0 00:00:00 grep --color=auto 4368

[root@centos7 tmp]# top -b -p4403 -n1
top - 12:54:13 up 19:14, 3 users, load average: 0.01, 0.06, 0.06
Tasks: 1 total, 0 running, 1 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.1 us, 0.1 sy, 0.0 ni, 99.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 8011144 total, 7039156 free, 391228 used, 580760 buff/cache
KiB Swap: 2183164 total, 2183164 free, 0 used. 7340836 avail Mem

  PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
 4403 user1 30 **10** 107892 624 532 S 0.0 0.0 0:00.00 sleep
```

---

<div class="post-metadata">

**Author:** ![vchlum](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/vchlum/32/93_2.png) [@vchlum](https://community.openpbs.org/u/vchlum)\
**Post date:** [October 18, 2016, 5:07pm UTC](https://community.openpbs.org/t/nice-resource/291/5 "2016-10-18T17:07:53Z")

</div>

OK, thank you for the answer.

---

<div class="post-metadata">

**Author:** ![agurban](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/agurban/32/67_2.png) [@agurban](https://community.openpbs.org/u/agurban)\
**Post date:** [October 18, 2016, 11:53pm UTC](https://community.openpbs.org/t/nice-resource/291/6 "2016-10-18T23:53:56Z")

</div>

I’ve filed a doc bug for this.
