diff --git a/man/gnt-debug.sgml b/man/gnt-debug.sgml index 89fd9e4a1f3aecc63e36d2e9a7864f5c352781b3..a42a44175d39f255d3323998d2c6902f4fde6920 100644 --- a/man/gnt-debug.sgml +++ b/man/gnt-debug.sgml @@ -145,7 +145,10 @@ <cmdsynopsis> <command>submit-job</command> - + <arg choice="opt">--verbose</arg> + <arg choice="opt">--timing-stats</arg> + <arg choice="opt">--job-repeat <option>N</option></arg> + <arg choice="opt">--op-repeat <option>N</option></arg> <arg choice="req" rep="repeat">opcodes_file</arg> </cmdsynopsis> @@ -156,6 +159,24 @@ command line. </para> + <para> + The <option>verbose</option> option will job the job IDs of + the submitted jobs and the progress in waiting for the jobs; + the <option>timing-stats</option> option will show some + overall statistics with the number of total opcodes and jobs + submitted, and time time for each stage (submit, exec, total). + </para> + + <para> + The <option>job-repeat</option> and <option>op-repeat</option> + options allow to submit multiple copies of the passed + arguments; the job repeat will cause N copies of each job + (input file) to be submitted (equivalent to passing the + arguments N times) while the op repeat will cause each job to + contain multiple copies of the opcodes (equivalent to each + file containing N copies of the opcodes). + </para> + </refsect2> </refsect1> diff --git a/scripts/gnt-debug b/scripts/gnt-debug index 3a12b2b7aaa9c1ec111a6d0f00c7ec081706243f..df48e6034cdb3f317c92828f1bbe65ba89b4f89e 100755 --- a/scripts/gnt-debug +++ b/scripts/gnt-debug @@ -71,14 +71,37 @@ def GenericOpCodes(opts, args): """ cl = cli.GetClient() - jex = cli.JobExecutor(cl=cl) - - for fname in args: - op_data = simplejson.loads(open(fname).read()) - op_list = [opcodes.OpCode.LoadOpCode(val) for val in op_data] - jex.QueueJob("file %s" % fname, *op_list) - + jex = cli.JobExecutor(cl=cl, verbose=opts.verbose) + + job_cnt = 0 + op_cnt = 0 + if opts.timing_stats: + ToStdout("Loading...") + for job_idx in range(opts.rep_job): + for fname in args: + op_data = simplejson.loads(open(fname).read()) + op_list = [opcodes.OpCode.LoadOpCode(val) for val in op_data] + op_list = op_list * opts.rep_op + jex.QueueJob("file %s/%d" % (fname, job_idx), *op_list) + op_cnt += len(op_list) + job_cnt += 1 + + if opts.timing_stats: + t1 = time.time() + ToStdout("Submitting...") + jex.SubmitPending() + + if opts.timing_stats: + t2 = time.time() + ToStdout("Executing...") jex.GetResults() + if opts.timing_stats: + t3 = time.time() + ToStdout("C:op %4d" % op_cnt) + ToStdout("C:job %4d" % job_cnt) + ToStdout("T:submit %4.4f" % (t2-t1)) + ToStdout("T:exec %4.4f" % (t3-t2)) + ToStdout("T:total %4.4f" % (t3-t1)) return 0 @@ -143,6 +166,20 @@ commands = { "[opts...] <duration>", "Executes a TestDelay OpCode"), 'submit-job': (GenericOpCodes, ARGS_ATLEAST(1), [DEBUG_OPT, + make_option("--op-repeat", type="int", default="1", + dest="rep_op", + help="Repeat the opcode sequence this number" + " of times"), + make_option("--job-repeat", type="int", default="1", + dest="rep_job", + help="Repeat the job this number" + " of times"), + make_option("-v", "--verbose", default=False, + action="store_true", + help="Make the operation more verbose"), + make_option("--timing-stats", default=False, + action="store_true", + help="Show timing stats"), ], "<op_list_file...>", "Submits jobs built from json files" " containing a list of serialized opcodes"),