[Swift-commit] r7811 - SwiftApps/moab-wrappers

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Mon May 5 13:35:48 CDT 2014


Author: davidk
Date: 2014-05-05 13:35:47 -0500 (Mon, 05 May 2014)
New Revision: 7811

Added:
   SwiftApps/moab-wrappers/qdel
   SwiftApps/moab-wrappers/qstat
   SwiftApps/moab-wrappers/qsub
Log:
Moab wrappers for qdel, qstat, qsub


Added: SwiftApps/moab-wrappers/qdel
===================================================================
--- SwiftApps/moab-wrappers/qdel	                        (rev 0)
+++ SwiftApps/moab-wrappers/qdel	2014-05-05 18:35:47 UTC (rev 7811)
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+canceljob "$@"


Property changes on: SwiftApps/moab-wrappers/qdel
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftApps/moab-wrappers/qstat
===================================================================
--- SwiftApps/moab-wrappers/qstat	                        (rev 0)
+++ SwiftApps/moab-wrappers/qstat	2014-05-05 18:35:47 UTC (rev 7811)
@@ -0,0 +1,32 @@
+#!/usr/bin/python
+
+import sys
+import subprocess
+import getpass
+
+jobs = sys.argv[2:len(sys.argv)]
+
+username = getpass.getuser()
+p = subprocess.Popen(['showq', '-w', 'user='+username], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+out, err = p.communicate()
+out_list = out.rstrip().split('\n')
+
+for o in out_list:
+    try:
+        words = o.split()
+        jobid = words[0].rstrip()
+        jobstatus = words[2].rstrip()
+
+        if jobid in jobs:
+           if jobstatus in ["Idle", "Deferred", "BatchHold", "SystemHold", "UserHold", "Deferred", "Migrated", "Staging", "Starting"]:
+               jobstatus = "Q"
+           elif jobstatus in ["Running"]:
+               jobstatus = "R"
+           elif jobstatus == ["Completed", "Vacated"]:
+               jobstatus = "C"
+           else:
+              continue
+           print "Job Id: " + jobid
+           print "\tjob_state = " + jobstatus + "\n"
+    except:
+        continue


Property changes on: SwiftApps/moab-wrappers/qstat
___________________________________________________________________
Added: svn:executable
   + *

Added: SwiftApps/moab-wrappers/qsub
===================================================================
--- SwiftApps/moab-wrappers/qsub	                        (rev 0)
+++ SwiftApps/moab-wrappers/qsub	2014-05-05 18:35:47 UTC (rev 7811)
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+msub "$@"


Property changes on: SwiftApps/moab-wrappers/qsub
___________________________________________________________________
Added: svn:executable
   + *




More information about the Swift-commit mailing list