# How to specify total cpu requirement for one job

**URL:** <https://community.openpbs.org/t/how-to-specify-total-cpu-requirement-for-one-job/1458>\
**Category:** Users/Site Administrators\
**Created:** [February 12, 2019, 1:09am UTC](https://community.openpbs.org/t/how-to-specify-total-cpu-requirement-for-one-job/1458 "2019-02-12T01:09:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![liuxiaopiao](https://avatars.discourse-cdn.com/v4/letter/l/65b543/32.png) [@liuxiaopiao](https://community.openpbs.org/u/liuxiaopiao)\
**Post date:** [February 12, 2019, 1:09am UTC](https://community.openpbs.org/t/how-to-specify-total-cpu-requirement-for-one-job/1458/1 "2019-02-12T01:09:50Z")

</div>

I have one pbs cluster which has two execution nodes and each of them has 4 pcpus.  
I want to submit one simple job like "echo “sleep 60” and specify the job using 5 cpus. Then PBS can help me allocate the job to two nodes automatically.

**My question is that:**

1. Is there any way to do this? I just find something like “ncpu” which specify cpu for every node.

2. And I have tried using “echo “sleep 60” | qsub -l nodes=2 -l procs=10” but got the error that  
“qsub: Unknown resource Resource\_List.procs”. How do I fix this error?

Thank a lot!

---

<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:** [February 12, 2019, 9:02am UTC](https://community.openpbs.org/t/how-to-specify-total-cpu-requirement-for-one-job/1458/2 "2019-02-12T09:02:12Z")

</div>

> [@liuxiaopiao](#):
>
> I want to submit one simple job like "echo “sleep 60” and specify the job using 5 cpus. Then PBS can help me allocate the job to two nodes automatically

You can do the below manually to run 5cpu job , 4 cores will be used from one node and 1 core for another node  
`qsub -l select=1:ncpus=4+1:ncpus=1 -- /bin/sleep 100`

> [@liuxiaopiao](#):
>
> - Is there any way to do this? I just find something like “ncpu” which specify cpu for every node.

1. `qsub -l select=1:ncpus=4+1:ncpus=1 -- /bin/sleep 100`

2. You can create a queuejob hook, that has profile of the cores against nodes of your PBS Cluster  
`qsub -l ncpus=5 -- /bin/sleep 1000` when submitted the queuejob hook will re-create the chunk statement as `-l select=1:ncpus=4+1:ncpus=1`

> [@liuxiaopiao](#):
>
> And I have tried using “echo “sleep 60” | qsub -l nodes=2 -l procs=10” but got the error that  
> “qsub: Unknown resource Resource\_List.procs”. How do I fix this error?

procs is a job wide custom resource as per your qsub statement. In order to fix it you should create a custom resource as below for the server to recognise `qmgr -c "create resource procs type=long"` and if you want the scheduler to recognise it , add it to the `resources: "......, procs" in the sched_config file` and `kill -HUP <PID of pbs_sched daemon>`

---

<div class="post-metadata">

**Author:** ![liuxiaopiao](https://avatars.discourse-cdn.com/v4/letter/l/65b543/32.png) [@liuxiaopiao](https://community.openpbs.org/u/liuxiaopiao)\
**Post date:** [February 12, 2019, 9:28pm UTC](https://community.openpbs.org/t/how-to-specify-total-cpu-requirement-for-one-job/1458/3 "2019-02-12T21:28:08Z")

</div>

> [@adarsh](#):
>
> …, procs

Thanks so much for the detailed info.
