7 from __future__
import print_function
8 import subprocess,os,sys,cmsScimarkStop,time
9 user=os.environ[
'USER']
17 scripts=[
'cmsPerfSuite.py',
18 'cmsRelvalreportInput.py',
23 'cmsIgProf_Analysis.py',
29 print(
"Looking for processes by user %s"%user)
30 checkProcesses=subprocess.Popen(
"ps -efww|grep %s"%user,bufsize=4096,shell=
True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
31 for line
in checkProcesses.stdout:
32 for executable
in scripts:
34 if executable
in line:
35 print(
"Found process %s"%line)
38 kill_stdouterr=subprocess.Popen(
"kill %s"%PID,shell=
True,stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.read()
45 checkProcesses=subprocess.Popen(
"ps -efww|grep %s"%user,bufsize=4096,shell=
True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
46 for line
in checkProcesses.stdout:
47 for executable
in scripts:
48 if executable
in line:
49 print(
"Something funny going on! It seems I could not kill process:\n%s"%line)
53 print(
"Finally killed all jobs!")
60 if __name__ ==
"__main__":
S & print(S &os, JobReport::InputFile const &f)