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


  • Content count

  • Joined

  • Last visited

About ashley

  • Rank

Recent Profile Visitors

516 profile views
  1. Help: Using a hook to write to job's output file

    Hi Scott, Sorry about taking so long to reply. Just got time to finish the hook this afternoon. What you provided worked well, and we have implemented it in the test cluster and it seems to be working. Will try it on the production cluster in the morning. For reference, in case other are interested, here is the full script we have used. import pbs import sys try: e = pbs.event() j = e.job if j.in_ms_mom(): pbs_home="/var/spool/PBS" if "o" in str(j.Keep_Files): jobfile=str(j.Output_Path).split(":", 1)[1] else: jobfile=pbs_home + "/spool/" + j.id +".OU" walltime = j.resources_used['walltime'] mem = j.resources_used['mem'] cput = j.resources_used['cput'] pbs.logjobmsg(j.id, "HOOK. writing to jobfile: %s " % jobfile ) outfile = open (jobfile,'a') outfile.write("\n-----\n") outfile.write("PBS Job %s\n" % j.id) outfile.write("CPU time : %s\n" % cput) outfile.write("Wall time : %s\n" % walltime) outfile.write("Mem usage : %s\n" % mem) outfile.close() e.accept() except SystemExit: pass
  2. Hi, Hoping someone here may be able to help me. I would like to write a hook, which can append some information to the job's output file. However I can't find any interface which may allow me to either write to the file, or find the name and location of the file. I am basically trying to depulcation an epilogue script which does this. However I need it to be a hook, as PBS does not allow both a execjob_epilogue hook and an epilogue script to be run. Can anyone provide any suggestions? Thanks, Ashley