How to specify total cpu requirement for one job

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!

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

  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

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>

Thanks so much for the detailed info.