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/). 
Sign in to follow this  
Jeff Lo

release the reserved resources

Recommended Posts

Hi All,


 


We handle the operational workloads using the advance standing reservation function of PBS Pro v12.1


The durations of each operational run can vary time to time, it is a bit wasting of reources if the job has been finished but we still hold the resources of reservations. I want to ask is there any way to release the reources or delete the standing reservation when the job is completed?


 


Thank!


Jeff


Share this post


Link to post
Share on other sites

Hi Jeff


 


Currently the short answer to your question is no, reservations won't automatically end early if jobs they contain end early (as they often do in fact). The rationale for this behavior lies on the fact that some of our users use reservations to set aside nodes to perform service tasks (patching nodes or other) and ending the reservation earlier than intended would be a problem for them.


 


The good news is that there is work going on to enhance the product and you should see improvements over the next release or two. The internal ticket number for this enhancement is 268750 if you follow-up with us in the future feel free to use that number to find out more about its status.


 


Starting in 12.2 there is an unsupported set of PBS Python library bindings available in the unsupported directory that can be used to make scripting these types of workarounds much easier than other scripting languages, below is an example script that you could periodically run through cron that would do the trick:


 


from ptl.lib.pbs_testlib import *

 

s = Server()

resvs = s.status(RESV, {'reserve_state': (MATCH_RE, 'RESV_RUNNING|5')})

if not resvs:

    sys.exit(0)

 

rids = map(lambda r:r['id'], resvs)

 

jobs = s.status(JOB, 'reserve_ID')

 

for job in jobs:

    if job['reserve_ID'] in rids:

        rids.remove(job['reserve_ID'])

 

for rid in rids:

    s.delete(rid)


 


I hope this helps


 


-


Vincent


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
Sign in to follow this  

×