Use the new parser library directly inside of autoserv, instead of
repeatedly invoking the parser as a separate process. In order to
actually invoke this capability you need to pass in a -P option, with
the job name (tag).

In order to properly support the parsing of server-side synchronous
jobs you need to make use of job.parallel_simple, a new wrapper around
the standard parallel_simple that adds support for parsing the results
of all of the parallel jobs individually. Unfortunately, complex
server-side synch jobs that use parallel instead of parallel_simple
will be unable to take advantage of this.

Signed-off-by: John Admanski <jadmanski@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@1446 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/scheduler/monitor_db b/scheduler/monitor_db
index 8009230..975eb47 100755
--- a/scheduler/monitor_db
+++ b/scheduler/monitor_db
@@ -1035,21 +1035,6 @@
 
 
 	def prolog(self):
-		# write the parser commands into the results directories
-		if self.job.is_synchronous() or self.job.num_machines()==1:
-			results_dir = self.job.results_dir()
-			cmdfile = os.path.join(results_dir, '.parse.cmd')
-			cmd = generate_parse_command(results_dir, '-n')
-			print >> open(cmdfile, 'w'), cmd
-		else:
-			for queue_entry in self.queue_entries:
-				results_dir = queue_entry.results_dir()
-				cmdfile = os.path.join(results_dir,
-						       '.parse.cmd')
-				cmd = generate_parse_command(results_dir,
-							     '-l 2 -n')
-				print >> open(cmdfile, 'w'), cmd
-
 		# write some job timestamps into the job keyval file
 		queued = time.mktime(self.job.created_on.timetuple())
 		started = time.time()
@@ -1617,7 +1602,14 @@
 		hostnames = ','.join([entry.get_host().hostname
 				      for entry in queue_entries])
 
-		params = [_autoserv_path, '-p', '-n',
+		# determine the job tag
+		if self.is_synchronous() or self.num_machines() == 1:
+			job_name = "%s-%s" % (self.id, self.owner)
+		else:
+			job_name = "%s-%s/%s" % (self.id, self.owner,
+						 hostnames)
+
+		params = [_autoserv_path, '-P', job_name, '-p', '-n',
 			  '-r', os.path.abspath(results_dir),
 			  '-b', '-u', self.owner, '-l', self.name,
 			  '-m', hostnames, ctrl.name]