ATLAS Offline Software
Loading...
Searching...
No Matches
python.runDiffRootOnChanged Namespace Reference

Functions

 read_diff_pool_log (filename)
 diff_root (pool_list, test, ftype)
 guessSecond (ESD_list)
 get_test_pool_files (logfile, tests)
 test_pool_files (logfile, tests)

Variables

 parser = OptionParser(usage="\n ./runDiffRootOnChanged.py --file <file name with full diff-pool log > \n")
 type
 dest
 default
 help
 action
 False
 options
 args
 logfile = options.filename
 tests = read_diff_pool_log(logfile)

Function Documentation

◆ diff_root()

python.runDiffRootOnChanged.diff_root ( pool_list,
test,
ftype )

Definition at line 42 of file runDiffRootOnChanged.py.

42def diff_root(pool_list,test,ftype):
43 outfile = "%s_%s.log" %(test, ftype)
44 command = "acmd.py diff-root %s %s --error-mode resilient --ignore-leaves RecoTimingObj_p1_HITStoRDO_timings RecoTimingObj_p1_RAWtoESD_mems RecoTimingObj_p1_RAWtoESD_timings RAWtoESD_mems RAWtoESD_timings ESDtoAOD_mems ESDtoAOD_timings HITStoRDO_timings --entries 10 >> %s" %(pool_list[0], pool_list[1], outfile)
45 if options.dryrun:
46 print (command)
47 else:
48 os.system(command)
49
50
51
52"""
53 since some pool files are located on eos others are on afs
54 this little hack is needed to get all files for the comparison
55"""

◆ get_test_pool_files()

python.runDiffRootOnChanged.get_test_pool_files ( logfile,
tests )

Definition at line 70 of file runDiffRootOnChanged.py.

70def get_test_pool_files(logfile, tests):
71 for test in tests:
72 AOD_list = []
73 ESD_list = []
74 print()
75 print()
76 print (test)
77 f = open(logfile, 'r')
78 for line in f:
79 if ".pool.root" in line and "open" in line and test in line:
80 if "AOD" in line:
81 AOD_list.append( line.split('[')[1].split(']')[0])
82 elif "ESD" in line:
83 ESD_list.append( line.split('[')[1].split(']')[0])
84 f.close()
85 AOD_list = list(set(AOD_list))
86 ESD_list = list(set(ESD_list))
87 if len(ESD_list) == 1:
88 ESD_list = guessSecond(ESD_list)
89 if len(AOD_list) == 1:
90 AOD_list = guessSecond(AOD_list)
91
92 if len(ESD_list) < 2:
93 print ("ERROR missing ESD file for diff-root comparison" )
94 else:
95 print ("INFO evaluate ESD diff-root")
96 diff_root(ESD_list, test, "ESD")
97
98 if len(AOD_list) < 2:
99 print ("ERROR missing AOD file for diff-root comparison")
100 else:
101 print ("INFO evaluate AOD diff-root")
102 diff_root(AOD_list, test, "AOD")
103
104
105
void print(char *figname, TCanvas *c1)
STL class.
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition hcg.cxx:177

◆ guessSecond()

python.runDiffRootOnChanged.guessSecond ( ESD_list)

Definition at line 56 of file runDiffRootOnChanged.py.

56def guessSecond(ESD_list):
57 ref = ESD_list[0]
58 repl = "rel%s" %(ref.split("rel")[1].split("/")[0])
59 newversion = "rel_%i" %(int(repl.split("_")[1])+1)
60 filename = ref.replace(repl,newversion)
61 if os.path.isfile(filename):
62 ESD_list.append(filename)
63 return ESD_list
64
65"""
66 extract path to pool files from diff-pool log
67 skip tests with failing tests
68 then execute diff_root for every pair
69"""

◆ read_diff_pool_log()

python.runDiffRootOnChanged.read_diff_pool_log ( filename)

Definition at line 29 of file runDiffRootOnChanged.py.

29def read_diff_pool_log(filename):
30 changed_tests = []
31 f = open(filename, 'r')
32 lines = f.readlines(); f.close()
33 for line in lines[-40:]:
34 if "CHANGED" in line:
35 changed_tests.append(line.split()[0])
36 return changed_tests
37
38
39"""
40 exectute diff-root command
41"""

◆ test_pool_files()

python.runDiffRootOnChanged.test_pool_files ( logfile,
tests )

Definition at line 106 of file runDiffRootOnChanged.py.

106def test_pool_files(logfile, tests):
107 rels = ["rel_2","rel_3"]
108 for test in tests:
109 path = "/afs/cern.ch/atlas/project/RTT/prod/Results/tct/REL/20.1.X.Y-VAL/build/x86_64-slc6-gcc48-opt/offline/Tier0ChainTests/%s/" %(test)
110 AOD_list = []
111 ESD_list = []
112 print()
113 print()
114 print (test)
115 for rel in rels:
116 aod = path.replace("REL",rel)+"myAOD.pool.root"
117 esd = path.replace("REL",rel)+"myESD.pool.root"
118 if os.path.isfile(aod):
119 AOD_list.append(aod)
120 if os.path.isfile(esd):
121 ESD_list.append(esd)
122 AOD_list = list(set(AOD_list))
123 ESD_list = list(set(ESD_list))
124 if len(ESD_list) < 2:
125 print ("ERROR missing ESD file for diff-root comparison" )
126 else:
127 print ("INFO evaluate ESD diff-root")
128 diff_root(ESD_list, test, "ESD")
129
130 if len(AOD_list) < 2:
131 print ("ERROR missing AOD file for diff-root comparison")
132 else:
133 print ("INFO evaluate AOD diff-root")
134 diff_root(AOD_list, test, "AOD")
135

Variable Documentation

◆ action

python.runDiffRootOnChanged.action

Definition at line 138 of file runDiffRootOnChanged.py.

◆ args

python.runDiffRootOnChanged.args

Definition at line 141 of file runDiffRootOnChanged.py.

◆ default

python.runDiffRootOnChanged.default

Definition at line 137 of file runDiffRootOnChanged.py.

◆ dest

python.runDiffRootOnChanged.dest

Definition at line 137 of file runDiffRootOnChanged.py.

◆ False

python.runDiffRootOnChanged.False

Definition at line 138 of file runDiffRootOnChanged.py.

◆ help

python.runDiffRootOnChanged.help

Definition at line 137 of file runDiffRootOnChanged.py.

◆ logfile

python.runDiffRootOnChanged.logfile = options.filename

Definition at line 142 of file runDiffRootOnChanged.py.

◆ options

python.runDiffRootOnChanged.options

Definition at line 141 of file runDiffRootOnChanged.py.

◆ parser

python.runDiffRootOnChanged.parser = OptionParser(usage="\n ./runDiffRootOnChanged.py --file <file name with full diff-pool log > \n")

Definition at line 136 of file runDiffRootOnChanged.py.

◆ tests

python.runDiffRootOnChanged.tests = read_diff_pool_log(logfile)

Definition at line 143 of file runDiffRootOnChanged.py.

◆ type

python.runDiffRootOnChanged.type

Definition at line 137 of file runDiffRootOnChanged.py.