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/). 

Davide Pastorino

Members
  • Content count

    3
  • Joined

  • Last visited

  1. Hook on execjob_epilogue and epilogue script execution

    A quick update: since pbs_python has integrated access to a few modules and it's v2.5 we went with os instead of subprocess. First we had to modify the sys.path (default pbs installation paths): import sys if "/opt/pbs/default/lib/python/python2.5" not in sys.path: sys.path.append("/opt/pbs/default/lib/python/python2.5") this gave us access to the string modules which we used to get the appropriate parameters to pass to the epilogue script: e=pbs.event() s=pbs.server() j=e.job jobid=j.id username=string.split(j.Job_Owner,"@")[0] Then we use the os.spawnl function to launch a backgrounded epilogue when a requeue is not needed: os.spawnl(os.P_NOWAIT,"/path/to/epilogue","epilogue",jobid,username,groupname,jobname) We'll be testing this for a few days, if anything comes up I'll update the post.
  2. Hook on execjob_epilogue and epilogue script execution

    Thanks a lot! I'm going to try this as soon as possible!
  3. Hi all, we're trying to use an hook to requeue a job in some specific conditions* but we also need to execute the epilogue script if the requeue is not deemed necessary. Is there a built in function do execute the epilogue from a hook? If not, is something like subprocess.Popen(["rm","-r","some.file"]) acceptable within a hook? Or is there any other option? *(e.g. job fail due to unavailable license: we're using dynamic resources for scheduling but since the licenses are not exclusive to the cluster there's always the possibility of a race condition with the workstation users...)
×