# Force PBS job to stay in queue until conditions are met

**URL:** <https://community.openpbs.org/t/force-pbs-job-to-stay-in-queue-until-conditions-are-met/760>\
**Category:** Users/Site Administrators\
**Created:** [November 17, 2017, 1:54am UTC](https://community.openpbs.org/t/force-pbs-job-to-stay-in-queue-until-conditions-are-met/760 "2017-11-17T01:54:51Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![bhroam](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.openpbs.org/bhroam/32/20_2.png) [@bhroam](https://community.openpbs.org/u/bhroam)\
**Post date:** [November 22, 2017, 7:01pm UTC](https://community.openpbs.org/t/force-pbs-job-to-stay-in-queue-until-conditions-are-met/760/6 "2017-11-22T19:01:14Z")

</div>

A few things first:  
I would suggest not using the -lnodes format of requesting a job. This is a very old selection format that has not been used in about 10 years. Use the new select/place format. It is much more robust. The conversion of -lnodes=1:ppn=8 is -lselect=1:ncpus=8 -lplace=scatter.

Following that, the flag=h on the resource means that the resource only belongs in the select statement. This is incompatible with a server\_dyn\_res. A server\_dyn\_res should have no flags. It’s for job wide resources. If you want select/node level resources, look into using a mom periodic hook to send these resources to the server for the scheduler to use.

One more thing, The option to request resources is -l (little ell), not cap L.

So with all that taken into account, I think you did the right thing in the wrong order. You need to request -lmy\_test\_var=500. This didn’t work for you in the beginning because you didn’t have my\_test\_var in the sched\_config resources line. You did add my\_test\_var to the resources line later on, but didn’t try this request again.

I hope this helps,  
Bhroam

---

_[View the full topic](https://community.openpbs.org/t/force-pbs-job-to-stay-in-queue-until-conditions-are-met/760)._
