[Swift-commit] r7924 - in branches/release-0.95: . bin

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Fri Jun 20 19:42:00 CDT 2014


Author: davidk
Date: 2014-06-20 19:42:00 -0500 (Fri, 20 Jun 2014)
New Revision: 7924

Added:
   branches/release-0.95/bin/moab-qdel
   branches/release-0.95/bin/moab-qstat
   branches/release-0.95/bin/moab-qsub
Modified:
   branches/release-0.95/build.xml
Log:
Moab wrappers


Added: branches/release-0.95/bin/moab-qdel
===================================================================
--- branches/release-0.95/bin/moab-qdel	                        (rev 0)
+++ branches/release-0.95/bin/moab-qdel	2014-06-21 00:42:00 UTC (rev 7924)
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+canceljob "$@"


Property changes on: branches/release-0.95/bin/moab-qdel
___________________________________________________________________
Added: svn:executable
   + *

Added: branches/release-0.95/bin/moab-qstat
===================================================================
--- branches/release-0.95/bin/moab-qstat	                        (rev 0)
+++ branches/release-0.95/bin/moab-qstat	2014-06-21 00:42:00 UTC (rev 7924)
@@ -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: branches/release-0.95/bin/moab-qstat
___________________________________________________________________
Added: svn:executable
   + *

Added: branches/release-0.95/bin/moab-qsub
===================================================================
--- branches/release-0.95/bin/moab-qsub	                        (rev 0)
+++ branches/release-0.95/bin/moab-qsub	2014-06-21 00:42:00 UTC (rev 7924)
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+msub "$@"


Property changes on: branches/release-0.95/bin/moab-qsub
___________________________________________________________________
Added: svn:executable
   + *

Modified: branches/release-0.95/build.xml
===================================================================
--- branches/release-0.95/build.xml	2014-06-14 21:07:38 UTC (rev 7923)
+++ branches/release-0.95/build.xml	2014-06-21 00:42:00 UTC (rev 7924)
@@ -87,6 +87,9 @@
                                 <include name="apptimes"/>
                                 <include name="foreachworker"/>
 				<include name="gensites"/>
+                                <include name="moab-qdel"/>
+                                <include name="moab-qstat"/>
+                                <include name="moab-qsub"/>
                                 <include name="prop2scs.pl"/>
 				<include name="start-coaster-service"/>
 				<include name="stop-coaster-service"/>




More information about the Swift-commit mailing list