Skip to content
Snippets Groups Projects
Commit 66ecc479 authored by Guido Trotter's avatar Guido Trotter
Browse files

Submit[*each*]Pending job


This is useful so we can test both SubmitJob and SubmitManyJobs.

Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 7172f605
No related branches found
No related tags found
No related merge requests found
......@@ -2248,11 +2248,18 @@ class JobExecutor(object):
SetGenericOpcodeOpts(ops, self.opts)
self.queue.append((name, ops))
def SubmitPending(self):
def SubmitPending(self, each=False):
"""Submit all pending jobs.
"""
results = self.cl.SubmitManyJobs([row[1] for row in self.queue])
if each:
results = []
for row in self.queue:
# SubmitJob will remove the success status, but raise an exception if
# the submission fails, so we'll notice that anyway.
results.append([True, self.cl.SubmitJob(row[1])])
else:
results = self.cl.SubmitManyJobs([row[1] for row in self.queue])
for (idx, ((status, data), (name, _))) in enumerate(zip(results,
self.queue)):
self.jobs.append((idx, status, data, name))
......
......@@ -90,7 +90,7 @@ def GenericOpCodes(opts, args):
t1 = time.time()
ToStdout("Submitting...")
jex.SubmitPending()
jex.SubmitPending(each=opts.each)
if opts.timing_stats:
t2 = time.time()
......@@ -174,6 +174,8 @@ commands = {
help="Repeat the job this number of times"),
cli_option("--timing-stats", default=False,
action="store_true", help="Show timing stats"),
cli_option("--each", default=False, action="store_true",
help="Submit each job separately"),
],
"<op_list_file...>", "Submits jobs built from json files"
" containing a list of serialized opcodes"),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment