Jump to content
  • Announcements

    • admin

      PBS Forum Has Closed   06/12/17

      The PBS Works Support Forum is no longer active.  For PBS community-oriented questions and support, please join the discussion at http://community.pbspro.org.  Any new security advisories related to commercially-licensed products will be posted in the PBS User Area (https://secure.altair.com/UserArea/). 

testing qsub parameters for PBS

Recommended Posts

I'm writing a perl script that helps a user develop a PBS script.  I need to test the PBS parameters to make sure

the job will be accepted by PBS before the job is submitted.  What would be ideal would be for qsub to have a

command line option that says validate the script (and the command line options) but don't submit it.  An exit

status of 0 means it's good, and anything else is an error. 


Is there anything like this in PBS, or is there any work around?




Share this post

Link to post
Share on other sites

Hello Cue, 


Perhaps I don't understand the use case or requirement. Please review my comments below, and if you want some more details, provide some specific examples you are trying to test.


The PBS Professional qsub command will validate whether the arguments adhere to the published interface. For instance,


1. spelling errors of the resources being requested

scott@sles11-00:~> qsub -l select=1:ncpu=2 TESTS/my_job.sh 
qsub: Unknown resource: ncpu

2. requesting unknown resource

scott@sles11-00:~> qsub -l select=1:ncpus=2:color=blue TESTS/my_job.sh 
qsub: Unknown resource: color


3. improper syntax of select statement 

scott@sles11-00:~> qsub -l select=1:ncpus=2:color-blue TESTS/my_job.sh 
qsub: Illegal attribute or resource value Resource_List.select

Now, if you are trying to validate that the user does not request 100 ncpus when there are not 100 ncpus available in the cluster, then you have a few different options for achieving you 


1. You can setup server level resource limits that can be applied to users, groups, and/or projects. For a simple example, here the most ncpus available in the complex is 100. If a user requests 101, then the job will be rejected. 


As root

qmgr -c "set server resources_max.ncpus=100"


As the user

scott@sles11-00:~> qsub -l select=1:ncpus=101 TESTS/my_job.sh 
qsub: Job exceeds queue and/or server resource limits

2. Write a queuejob hook to validate site-specific requirements. The benefit of using PBS Professional Plugin framework is that the user cannot circumvent your wrapper (test script) AND you can provide a custom message to the user to help them get it right. 

Share this post

Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in

Sign In Now