# Constrained job to specific queue only in torque

**URL:** <https://community.openpbs.org/t/constrained-job-to-specific-queue-only-in-torque/2748>\
**Category:** Users/Site Administrators\
**Created:** [August 13, 2021, 9:17am UTC](https://community.openpbs.org/t/constrained-job-to-specific-queue-only-in-torque/2748 "2021-08-13T09:17:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![prnvrvs](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/prnvrvs/32/437_2.png) [@prnvrvs](https://community.openpbs.org/u/prnvrvs)\
**Post date:** [August 13, 2021, 9:17am UTC](https://community.openpbs.org/t/constrained-job-to-specific-queue-only-in-torque/2748/1 "2021-08-13T09:17:18Z")

</div>

I have two queue, one with 4 node with 24 cpu/node and other 6 node with 48 cpu/node. when I submit my job in queue1 using `#PBS -q queue1` and `#pbs -l nodes=1:ppn=48` . My job submits and run in queue2, but I want my job to reject as ppn in queue 1 should not exceed 24. I have already edited server\_priv/nodes file  
what should I add as constraints so job will only run in queue1 and will not pass to queue2. I want job to run on particular queue only when defined `#pbs -l queue`

```auto
node1 np=24 queue1
node2 np=24 queue1
node3 np=24 queue1
node4 np=24 queue1
node5 np=48 queue2
node6 np=48 queue2
node7 np=48 queue2
node8 np=48 queue2
node9 np=48 queue2
node10 np=48 queue2

```

output of qstat -Qf

```auto
Queue: queue1
    queue_type = Execution
    total_jobs = 0
    state_count = Transit:0 Queued:0 Held:0 Waiting:0 Running:0 Exiting:0 Comp
	lete:0 
    resources_max.ncpus = 96
    resources_default.walltime = 240:00:00
    mtime = 1628841336
    resources_assigned.nodect = 0
    enabled = True
    started = True

Queue: queue2
    queue_type = Execution
    total_jobs = 0
    state_count = Transit:0 Queued:0 Held:0 Waiting:0 Running:1 Exiting:0 Comp
	lete:0 
    resources_max.ncpus = 288
    resources_default.walltime = 240:00:00
    mtime = 1628841336
    resources_assigned.nodect = 0
    enabled = True
    started = True

```

output of pbsnodes -a of one node

```auto
node-10
     state = free
     power_state = Running
     np = 48
     properties = queue2
     ntype = cluster
     status = opsys=linux,uname=Linux node-10 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64,sessions=21618 21628 21760 21998,nsessions=4,nusers=2,idletime=122868,totmem=263585848kb,availmem=256147964kb,physmem=196476988kb,ncpus=96,loadave=0.00,gres=,netload=28359027509,state=free,varattr= ,cpuclock=Conservative:1200MHz,macaddr=ac:1f:6b:4e:2f:e2,version=6.1.0,rectime=1628868602,jobs=
     mom_service_port = 15002
     mom_manager_port = 15003

```

---

<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:** [August 14, 2021, 7:36am UTC](https://community.openpbs.org/t/constrained-job-to-specific-queue-only-in-torque/2748/2 "2021-08-14T07:36:29Z")

</div>

Please note @prnvrvs you are posting the query in the discussion forum for openpbs which is different workload management system than the one you are using. Please check this link: [https://openpbs.org/](https://openpbs.org/)  
You can achieve this in openpbs in many ways

- Qlist
- queuejob hook  
Documentation link: [https://www.altair.com/pdfs/pbsworks/PBSAdminGuide2021.1.pdf](https://www.altair.com/pdfs/pbsworks/PBSAdminGuide2021.1.pdf)

---

<div class="post-metadata">

**Author:** ![prnvrvs](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/prnvrvs/32/437_2.png) [@prnvrvs](https://community.openpbs.org/u/prnvrvs)\
**Post date:** [August 14, 2021, 12:14pm UTC](https://community.openpbs.org/t/constrained-job-to-specific-queue-only-in-torque/2748/3 "2021-08-14T12:14:01Z")

</div>

Thanks @adarsh , yes I know its different but many methodologies are same. Anyway Here is my follow up question, If I want to upgrade from torque to open-pbs. Do I need to start from scratch.Do I need to change my current OS(centos-7.6.1810)

---

<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:** [August 14, 2021, 12:24pm UTC](https://community.openpbs.org/t/constrained-job-to-specific-queue-only-in-torque/2748/4 "2021-08-14T12:24:54Z")

</div>

Thank you @prnvrvs

The protocol would be  
0. we cannot upgrade torque to openpbs, it would have to be un-install, clean install from scratch

1. un-install your existing work load manager
2. Download or complile openpbs from source
  - [openpbs/INSTALL at master · openpbs/openpbs · GitHub](https://github.com/openpbs/openpbs/blob/master/INSTALL)
  - [GitHub - openpbs/openpbs: An HPC workload manager and job scheduler for desktops, clusters, and clouds.\</t](https://github.com/openpbs/openpbs)

3. If you had CentOS 8.x , then the compiled installer/binaries are readiily available to download form this link [https://openpbs.org/Download.aspx#download](https://openpbs.org/Download.aspx#download)

---

<div class="post-metadata">

**Author:** ![alexis.cousein](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/alexis.cousein/32/265_2.png) [@alexis.cousein](https://community.openpbs.org/u/alexis.cousein)\
**Post date:** [August 17, 2021, 2:23pm UTC](https://community.openpbs.org/t/constrained-job-to-specific-queue-only-in-torque/2748/5 "2021-08-17T14:23:56Z")

</div>

Normally you would no longer use “ppn” in PBSPro but use things like -lselect=2:ncpus=24 – and in that case you can set limits on the queue (resources\_max.ncpus=xxx) and even resource utilisation limits (resources\_available.ncpus=YYY).

Queuejob hooks can be used to convert submission syntax into something different from the default conversions that will be applied.
