# Qsub specific hosts

**URL:** <https://community.openpbs.org/t/qsub-specific-hosts/991>\
**Category:** Users/Site Administrators\
**Created:** [May 14, 2018, 2:25pm UTC](https://community.openpbs.org/t/qsub-specific-hosts/991 "2018-05-14T14:25:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![gri](https://avatars.discourse-cdn.com/v4/letter/g/3bc359/32.png) [@gri](https://community.openpbs.org/u/gri)\
**Post date:** [May 14, 2018, 2:25pm UTC](https://community.openpbs.org/t/qsub-specific-hosts/991/1 "2018-05-14T14:25:49Z")

</div>

The question is related to: [Exclude the node from qsub](http://community.openpbs.org/t/exclude-the-node-from-qsub/965)  
Is there a way, except from creating resources, to submit a job to one of a list of possible nodes/hosts?  
If I use `qsub -V -l nodes=host5` I can select one specific node and submit jobs to it that run in parallel, but if I use `qsub -V -l nodes=host5+host6+host7`, only one job is running while the others are queued.

---

<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:** [May 14, 2018, 3:09pm UTC](https://community.openpbs.org/t/qsub-specific-hosts/991/2 "2018-05-14T15:09:10Z")

</div>

> [@gri](#):
>
> Is there a way, except from creating resources, to submit a job to one of a list of possible nodes/hosts?

qsub -l host= # to run one specific node  
qsub -l nodes=nodename+nodename+nodename # to run on these specific nodes

If you want one of the specific node from the list of nodes, that is free to run the job, then custom resources (qlists method explained in the other link) are required.

> [@gri](#):
>
> but if I use `qsub -V -l nodes=host5+host6+host7` , only one job is running while the others are queued.

Could you please explain this in detail by providing

- pbsnodes -av output
- qstat -wans1 output
- qstat -f \< one of the queued job \>

---

<div class="post-metadata">

**Author:** ![gri](https://avatars.discourse-cdn.com/v4/letter/g/3bc359/32.png) [@gri](https://community.openpbs.org/u/gri)\
**Post date:** [May 14, 2018, 3:27pm UTC](https://community.openpbs.org/t/qsub-specific-hosts/991/3 "2018-05-14T15:27:58Z")

</div>

qstat -wans1:

```
10602.vcl-pbs2 user gpu_low task1.sh 18954 3 3 -- -- R 00:01:18 vcl-gpu8/0+vcl-gpu7/2+vcl-gpu6/1
   Job run at Mon May 14 at 08:19 on (vcl-gpu8:ncpus=1:ngpus=1)+(vcl-gpu7:ncpus=1:ngpus=1)+(vcl-gpu6:ncpus=1:ngpus=1)
10603.vcl-pbs2 user gpu_low task2.sh -- 3 3 -- -- Q -- -- 
   Not Running: Insufficient amount of resource: ngpus 
10604.vcl-pbs2 user gpu_low task3.sh -- 3 3 -- -- Q -- -- 
   Not Running: Insufficient amount of resource: ngpus

```

qstat -f:

```
comment = Not Running: Insufficient amount of resource: ngpus
```

---

<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:** [May 14, 2018, 3:34pm UTC](https://community.openpbs.org/t/qsub-specific-hosts/991/4 "2018-05-14T15:34:59Z")

</div>

Thank you.

From the shared information, it seems there aren’t sufficient ngpus available to run that job(s). This is the first message / information that the scheduler has encountered mentioning why it cannot run that job now.

---

<div class="post-metadata">

**Author:** ![gri](https://avatars.discourse-cdn.com/v4/letter/g/3bc359/32.png) [@gri](https://community.openpbs.org/u/gri)\
**Post date:** [May 14, 2018, 3:41pm UTC](https://community.openpbs.org/t/qsub-specific-hosts/991/5 "2018-05-14T15:41:47Z")

</div>

The message seems clear, but why is it then working if I submit the jobs with `nodes=host5~, i.e., specifying only one node?

---

<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:** [May 14, 2018, 4:49pm UTC](https://community.openpbs.org/t/qsub-specific-hosts/991/6 "2018-05-14T16:49:46Z")

</div>

Could you please share the current status of the system by sharing the below  
pbsnodes -av  
qstat -answ1  
qstat -fx

Also, can you try to run the below job, if node5 is occupied:  
qsub -l select=1:ncpus=1:host=node6+1:ncpus=1:host=node7 – /bin/sleep 100

> [@gri](#):
>
> The message seems clear, but why is it then working if I submit the jobs with `nodes=host5~, i.e., specifying only one node?

You can increase the scheduler log verbosity to max and trace the activity of the scheduler by invoking a new scheduling cycle .

---

<div class="post-metadata">

**Author:** ![leclerc](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/leclerc/32/183_2.png) [@leclerc](https://community.openpbs.org/u/leclerc)\
**Post date:** [January 18, 2019, 2:18pm UTC](https://community.openpbs.org/t/qsub-specific-hosts/991/7 "2019-01-18T14:18:32Z")

</div>

How do I do if I want to submit alternatively to one of the three nodes: host5, host6 or host7 ? If I specifify this:  
qsub -l nodes=host5,nodes=host6,nodes=host7  
Will it submit to host5 or alternatively to host6 (or host7) when there is no more available resources on host5 (or host6) ?

---

<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:** [January 19, 2019, 5:55pm UTC](https://community.openpbs.org/t/qsub-specific-hosts/991/8 "2019-01-19T17:55:25Z")

</div>

> [@leclerc](#):
>
> How do I do if I want to submit alternatively to one of the three nodes: host5, host6 or host7 ? If I specifify this:  
> qsub -l nodes=host5,nodes=host6,nodes=host7  
> Will it submit to host5 or alternatively to host6 (or host7) when there is no more available resources on host5 (or host6) ?

[Answer]: No, you need to create qsub wrapper script based on the logic of selecting one of the nodes, which will take the inputs from user and submit the job alternatively.  
Please follow this link: [PP-506,PP-507: Add support for requesting resources with logical 'or' and conditional operators - #42 by arungrover](http://community.openpbs.org/t/pp-506-pp-507-add-support-for-requesting-resources-with-logical-or-and-conditional-operators/416/42)
