7 import subprocess,os,sys
11 ps_stdouterr=subprocess.Popen(
"ps -efww|grep cmsScimarkLaunch|grep -v grep|grep -v 'sh -c'",shell=
True,stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout
13 ps_lines=ps_stdouterr.readlines()
22 print "Found process:\n%s"%line[:-1]
24 print "Killing process with PID %s"%PID
25 kill_stdouterr=subprocess.Popen(
"kill %s"%PID,shell=
True,stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.read()
29 if os.path.exists(
"cmsScimark_%s.log"%core):
31 mkdir_stdouterr=subprocess.Popen(
"mkdir cmsScimarkResults_cpu%s"%core,shell=
True,stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.read()
34 harvest_stdouterr=subprocess.Popen(
"cmsScimarkParser.py -i cmsScimark_%s.log -o cmsScimarkResults_cpu%s"%(core,core),shell=
True,stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.read()
35 print harvest_stdouterr
37 print "No cmsScimark_%s.log file was found for cpu%s, log might be in another directory!"%(core,core)
39 print "No cmsScimarkLaunch processes found in the ps -ef output" 42 if __name__ ==
"__main__":