summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xarch/isa_parser.py17
-rwxr-xr-xutil/qdo12
2 files changed, 19 insertions, 10 deletions
diff --git a/arch/isa_parser.py b/arch/isa_parser.py
index eaef4b798..8f4c6bce7 100755
--- a/arch/isa_parser.py
+++ b/arch/isa_parser.py
@@ -794,20 +794,19 @@ def defFormat(id, params, code, lineno):
##############
# Stack: a simple stack object. Used for both formats (formatStack)
-# and default cases (defaultStack).
+# and default cases (defaultStack). Simply wraps a list to give more
+# stack-like syntax and enable initialization with an argument list
+# (as opposed to an argument that's a list).
-class Stack:
- def __init__(self, initItem):
- self.stack = [ initItem ]
+class Stack(list):
+ def __init__(self, *items):
+ list.__init__(self, items)
def push(self, item):
- self.stack.append(item);
-
- def pop(self):
- return self.stack.pop()
+ self.append(item);
def top(self):
- return self.stack[-1]
+ return self[-1]
# The global format stack.
formatStack = Stack(NoFormat())
diff --git a/util/qdo b/util/qdo
index 3a475b420..9593ed5ed 100755
--- a/util/qdo
+++ b/util/qdo
@@ -45,7 +45,11 @@ optparser.add_option('-o', dest='stdout_file',
help='command stdout output file')
optparser.add_option('-l', dest='save_log', action='store_true',
help='save qsub output log file')
-optparser.add_option('-q', dest='qsub_timeout', type='int',
+optparser.add_option('-N', dest='job_name',
+ help='qsub job name')
+optparser.add_option('-q', dest='dest_queue',
+ help='qsub destination queue')
+optparser.add_option('--qwait', dest='qsub_timeout', type='int',
help='qsub queue wait timeout', default=30*60)
optparser.add_option('-t', dest='cmd_timeout', type='int',
help='command execution timeout', default=600*60)
@@ -56,6 +60,9 @@ if cmd == []:
print >>sys.stderr, "%s: missing command" % progname
sys.exit(1)
+if not options.job_name:
+ options.job_name = cmd[0]
+
cwd = os.getcwd()
# Deal with systems where /n is a symlink to /.automount
@@ -137,6 +144,9 @@ if False and len(cmd) > 50:
print "%s: running %s on poolfs" % (progname, cmd[0])
else:
shell_cmd = 'qsub -I -S /bin/sh'
+ shell_cmd += ' -N "%s"' % options.job_name
+ if options.dest_queue:
+ shell_cmd += ' -q ' + options.dest_queue
shell = Shell(shell_cmd)