[Swift-commit] r7860 - in trunk: . bin
davidk at ci.uchicago.edu
davidk at ci.uchicago.edu
Mon May 12 11:20:28 CDT 2014
Author: davidk
Date: 2014-05-12 11:20:28 -0500 (Mon, 12 May 2014)
New Revision: 7860
Added:
trunk/bin/moab-qdel
trunk/bin/moab-qstat
trunk/bin/moab-qsub
Modified:
trunk/build.xml
Log:
Add moab wrapper scripts
Added: trunk/bin/moab-qdel
===================================================================
--- trunk/bin/moab-qdel (rev 0)
+++ trunk/bin/moab-qdel 2014-05-12 16:20:28 UTC (rev 7860)
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+canceljob "$@"
Property changes on: trunk/bin/moab-qdel
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/bin/moab-qstat
===================================================================
--- trunk/bin/moab-qstat (rev 0)
+++ trunk/bin/moab-qstat 2014-05-12 16:20:28 UTC (rev 7860)
@@ -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: trunk/bin/moab-qstat
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/bin/moab-qsub
===================================================================
--- trunk/bin/moab-qsub (rev 0)
+++ trunk/bin/moab-qsub 2014-05-12 16:20:28 UTC (rev 7860)
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+msub "$@"
Property changes on: trunk/bin/moab-qsub
___________________________________________________________________
Added: svn:executable
+ *
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2014-05-12 16:16:17 UTC (rev 7859)
+++ trunk/build.xml 2014-05-12 16:20:28 UTC (rev 7860)
@@ -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