Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Charles Burton
Gaudi
Commits
bc49fafa
Commit
bc49fafa
authored
Jan 25, 2018
by
Marco Clemencic
Browse files
fixed Python formatting (updated autopep8)
parent
be076672
Changes
10
Hide whitespace changes
Inline
Side-by-side
GaudiExamples/scripts/HistoUtilsEx.py
View file @
bc49fafa
...
...
@@ -103,17 +103,25 @@ rhisto1.Print()
rhisto2
.
Print
()
# get some "extra infomration"
print
' Histo1 : mean /err: %10f +- %10f '
%
(
histo1
.
mean
(),
histo1
.
meanErr
())
print
' Histo1 : rms /err: %10f +- %10f '
%
(
histo1
.
rms
(),
histo1
.
rmsErr
())
print
' Histo1 : skewness/err: %10f +- %10f '
%
(
histo1
.
skewness
(),
histo1
.
skewnessErr
())
print
' Histo1 : kurtosis/err: %10f +- %10f '
%
(
histo1
.
kurtosis
(),
histo1
.
kurtosisErr
())
print
' Histo1 : mean /err: %10f +- %10f '
%
(
histo1
.
mean
(),
histo1
.
meanErr
())
print
' Histo1 : rms /err: %10f +- %10f '
%
(
histo1
.
rms
(),
histo1
.
rmsErr
())
print
' Histo1 : skewness/err: %10f +- %10f '
%
(
histo1
.
skewness
(),
histo1
.
skewnessErr
())
print
' Histo1 : kurtosis/err: %10f +- %10f '
%
(
histo1
.
kurtosis
(),
histo1
.
kurtosisErr
())
print
' Histo1 : path in THS : "%s"'
%
histo1
.
path
()
print
' Histo2 : mean /err: %10f +- %10f '
%
(
histo2
.
mean
(),
histo2
.
meanErr
())
print
' Histo2 : rms /err: %10f +- %10f '
%
(
histo2
.
rms
(),
histo2
.
rmsErr
())
print
' Histo2 : skewness/err: %10f +- %10f '
%
(
histo2
.
skewness
(),
histo2
.
skewnessErr
())
print
' Histo2 : kurtosis/err: %10f +- %10f '
%
(
histo2
.
kurtosis
(),
histo2
.
kurtosisErr
())
print
' Histo2 : mean /err: %10f +- %10f '
%
(
histo2
.
mean
(),
histo2
.
meanErr
())
print
' Histo2 : rms /err: %10f +- %10f '
%
(
histo2
.
rms
(),
histo2
.
rmsErr
())
print
' Histo2 : skewness/err: %10f +- %10f '
%
(
histo2
.
skewness
(),
histo2
.
skewnessErr
())
print
' Histo2 : kurtosis/err: %10f +- %10f '
%
(
histo2
.
kurtosis
(),
histo2
.
kurtosisErr
())
print
' Histo2 : path in THS : "%s"'
%
histo2
.
path
()
...
...
GaudiHive/profiling/plotSpeedupsPyRoot.py
View file @
bc49fafa
...
...
@@ -119,7 +119,8 @@ if len(sys.argv) > 1:
for
neif
in
neif_l
:
print
"Events in flight: %s"
%
neif
for
tn
in
nts
:
print
"%s %s %s"
%
(
tn
,
xtractTiming
(
neif
,
tn
,
False
),
xtractTiming
(
neif
,
tn
,
True
))
print
"%s %s %s"
%
(
tn
,
xtractTiming
(
neif
,
tn
,
False
),
xtractTiming
(
neif
,
tn
,
True
))
len_nt
=
len
(
nts
)
+
1
...
...
GaudiHive/profiling/prepareBenchmark.py
View file @
bc49fafa
...
...
@@ -29,4 +29,5 @@ if __name__ == "__main__":
config
=
prepareConfig
(
"../options/BrunelScenario.py"
,
n_threads
=
n_threads
,
n_parallel_events
=
n_events
,
n_parallel_algorithms
=
n_algos
)
# config.replace(".py",".log"))
print
"/usr/bin/time -f %%S -o %s.time `alias gaudirun` %s > %s"
%
(
config
.
replace
(
".py"
,
""
),
config
,
"/dev/null"
)
print
"/usr/bin/time -f %%S -o %s.time `alias gaudirun` %s > %s"
%
(
config
.
replace
(
".py"
,
""
),
config
,
"/dev/null"
)
GaudiHive/python/GaudiHive/precedence.py
View file @
bc49fafa
...
...
@@ -66,7 +66,8 @@ class RealTimeValue(object):
time
=
float
(
self
.
timings
[
capAlgoName
])
else
:
time
=
self
.
defaultTime
print
"WARNING: TimiNg for %s (or %s) not found in the provided library, using default one: %s"
%
(
algoName
,
capAlgoName
,
time
)
print
"WARNING: TimiNg for %s (or %s) not found in the provided library, using default one: %s"
%
(
algoName
,
capAlgoName
,
time
)
time
=
time
*
self
.
factor
...
...
@@ -161,20 +162,25 @@ class CruncherSequence(object):
import
pprint
print
"
\n
===== Statistics on Algorithms ====="
print
"Total number of algorithm nodes: "
,
len
(
self
.
unique_algos
)
+
sum
([
self
.
dupl_algos
[
i
]
-
1
for
i
in
self
.
dupl_algos
])
print
"Total number of algorithm nodes: "
,
len
(
self
.
unique_algos
)
+
sum
([
self
.
dupl_algos
[
i
]
-
1
for
i
in
self
.
dupl_algos
])
print
"Number of unique algorithms: "
,
len
(
self
.
unique_algos
)
print
" -->"
,
len
(
self
.
dupl_algos
),
"of them being re-used with the following distribution: "
,
[
self
.
dupl_algos
[
i
]
for
i
in
self
.
dupl_algos
]
print
" -->"
,
len
(
self
.
dupl_algos
),
"of them being re-used with the following distribution: "
,
[
self
.
dupl_algos
[
i
]
for
i
in
self
.
dupl_algos
]
# pprint.pprint(dupl_algos)
print
"
\n
===== Statistics on Sequencers ====="
print
"Total number of sequencers: "
,
len
(
self
.
unique_sequencers
)
+
sum
([
self
.
dupl_seqs
[
i
]
-
1
for
i
in
self
.
dupl_seqs
])
print
"Total number of sequencers: "
,
len
(
self
.
unique_sequencers
)
+
sum
([
self
.
dupl_seqs
[
i
]
-
1
for
i
in
self
.
dupl_seqs
])
print
"Number of unique sequencers: "
,
len
(
self
.
unique_sequencers
)
print
" -->"
,
len
(
self
.
dupl_seqs
),
"of them being re-used with the following distribution: "
,
[
self
.
dupl_seqs
[
i
]
for
i
in
self
.
dupl_seqs
]
print
" -->"
,
len
(
self
.
dupl_seqs
),
"of them being re-used with the following distribution: "
,
[
self
.
dupl_seqs
[
i
]
for
i
in
self
.
dupl_seqs
]
# pprint.pprint(dupl_seqs)
print
"Number of OR-sequencers: "
,
len
(
self
.
OR_sequencers
)
print
"
\n
===== Statistics on DataObjects ====="
print
"Number of unique DataObjects: "
,
len
(
self
.
unique_data_objects
)
print
"Number of unique DataObjects: "
,
len
(
self
.
unique_data_objects
)
# pprint.pprint(self.unique_data_objects)
print
...
...
GaudiKernel/scripts/gaudiComponentHelp.py
View file @
bc49fafa
...
...
@@ -33,7 +33,8 @@ if __name__ == "__main__":
if
name
not
in
cfgDb
:
print
"Component %s not found."
%
(
name
)
sys
.
exit
()
print
"
\n
Dumping component information for %s:
\n
%s"
%
(
name
,
(
35
+
len
(
name
))
*
"="
)
print
"
\n
Dumping component information for %s:
\n
%s"
%
(
name
,
(
35
+
len
(
name
))
*
"="
)
print
" Library: %s"
%
(
cfgDb
[
name
][
"lib"
])
print
" Package: %s"
%
(
cfgDb
[
name
][
"package"
])
print
"
\n
Properties:
\n
%s"
%
(
11
*
"-"
)
...
...
GaudiMP/python/GaudiMP/Parallel.py
View file @
bc49fafa
...
...
@@ -192,7 +192,8 @@ class WorkManager(object):
print
'Job execution statistics:'
print
'job count | % of all jobs | job time sum | time per job | job server'
for
name
,
stat
in
self
.
stats
.
items
():
print
' %d | %6.2f | %8.3f | %8.3f | %s'
%
(
stat
.
njob
,
100.
*
stat
.
njob
/
njobs
,
stat
.
time
,
stat
.
time
/
stat
.
njob
,
name
)
print
' %d | %6.2f | %8.3f | %8.3f | %s'
%
(
stat
.
njob
,
100.
*
stat
.
njob
/
njobs
,
stat
.
time
,
stat
.
time
/
stat
.
njob
,
name
)
def
_mergeStatistics
(
self
,
stat
):
if
stat
.
name
not
in
self
.
stats
:
...
...
GaudiMP/scripts/compareOutputFiles.py
View file @
bc49fafa
...
...
@@ -310,13 +310,15 @@ def CheckFileRecords(par, ser):
diff2
=
set
(
parFSR
[
"EventCountFSR"
].
iteritems
())
-
\
set
(
serFSR
[
"EventCountFSR"
].
iteritems
())
print
"
\n
Different entries in TimeSpanFSR:
\t
"
+
str
(
len
(
diff1
))
+
"
\n
Different entries in EventCountFSR:
\t
"
+
str
(
len
(
diff2
))
print
"
\n
Different entries in TimeSpanFSR:
\t
"
+
\
str
(
len
(
diff1
))
+
"
\n
Different entries in EventCountFSR:
\t
"
+
str
(
len
(
diff2
))
for
k
in
[
"LumiFSRBeamCrossing"
,
"LumiFSRBeam2"
,
"LumiFSRNoBeam"
]:
diff3
=
set
(
parFSR
[
k
][
"key"
])
-
set
(
serFSR
[
k
][
"key"
])
diff4
=
set
(
parFSR
[
k
][
"incr"
])
-
set
(
serFSR
[
k
][
"incr"
])
diff5
=
set
(
parFSR
[
k
][
"integral"
])
-
set
(
serFSR
[
k
][
"integral"
])
print
"Different entries in "
+
str
(
k
)
+
":
\t
key: "
+
str
(
len
(
diff3
))
+
" increment: "
+
str
(
len
(
diff4
))
+
" integral: "
+
str
(
len
(
diff5
))
print
"Different entries in "
+
str
(
k
)
+
":
\t
key: "
+
str
(
len
(
diff3
))
+
" increment: "
+
str
(
len
(
diff4
))
+
" integral: "
+
str
(
len
(
diff5
))
def
LumiFSR
(
lumi
):
...
...
@@ -414,13 +416,15 @@ def CompareFSR(pout, sout):
diff2
=
set
(
parFSR
[
"EventCountFSR"
].
iteritems
())
-
\
set
(
serFSR
[
"EventCountFSR"
].
iteritems
())
print
"
\n
Different entries in TimeSpanFSR:
\t
"
+
str
(
len
(
diff1
))
+
"
\n
Different entries in EventCountFSR:
\t
"
+
str
(
len
(
diff2
))
print
"
\n
Different entries in TimeSpanFSR:
\t
"
+
\
str
(
len
(
diff1
))
+
"
\n
Different entries in EventCountFSR:
\t
"
+
str
(
len
(
diff2
))
for
k
in
[
"LumiFSRBeamCrossing"
,
"LumiFSRBeam2"
,
"LumiFSRNoBeam"
]:
diff3
=
set
(
parFSR
[
k
][
'key'
])
-
set
(
serFSR
[
k
][
'key'
])
diff4
=
set
(
parFSR
[
k
][
'incr'
])
-
set
(
serFSR
[
k
][
'incr'
])
diff5
=
set
(
parFSR
[
k
][
'integral'
])
-
set
(
serFSR
[
k
][
"integral"
])
print
"Different entries in "
+
str
(
k
)
+
":
\t
key: "
+
str
(
len
(
diff3
))
+
" increment: "
+
str
(
len
(
diff4
))
+
" integral: "
+
str
(
len
(
diff5
))
print
"Different entries in "
+
str
(
k
)
+
":
\t
key: "
+
str
(
len
(
diff3
))
+
" increment: "
+
str
(
len
(
diff4
))
+
" integral: "
+
str
(
len
(
diff5
))
print
"
\n
Parallel:
\n
"
+
str
(
parFSR
)
print
"
\n
Serial:
\n
"
+
str
(
serFSR
)
...
...
GaudiMP/scripts/compareRootHistos.py
View file @
bc49fafa
...
...
@@ -103,8 +103,10 @@ def comparePaths(t1, t2):
print
'
\n
'
+
'='
*
80
print
'Comparison of Paths : Reference vs Test ROOT files'
print
'-'
*
80
print
'Number of paths in Reference file : %i (objects, histos) = ( %i, %i )'
%
(
len
(
dsks
),
os
,
hs
)
print
'Number of paths in Test file : %i (objects, histos) = ( %i, %i )'
%
(
len
(
dpks
),
op
,
hp
)
print
'Number of paths in Reference file : %i (objects, histos) = ( %i, %i )'
%
(
len
(
dsks
),
os
,
hs
)
print
'Number of paths in Test file : %i (objects, histos) = ( %i, %i )'
%
(
len
(
dpks
),
op
,
hp
)
matching
=
sset
.
intersection
(
pset
)
matchingHistos
=
0
for
n
in
matching
:
...
...
@@ -117,7 +119,8 @@ def comparePaths(t1, t2):
for
n
in
uSer
:
if
ds
[
n
].
__class__
.
__name__
in
histos
:
uniqueReferenceHistos
+=
1
print
'Paths unique to Reference file : %i ( %i Histos )'
%
(
len
(
uSer
),
uniqueReferenceHistos
)
print
'Paths unique to Reference file : %i ( %i Histos )'
%
(
len
(
uSer
),
uniqueReferenceHistos
)
if
uSer
:
for
n
in
uSer
:
print
'
\t
%s :
\t
%s'
%
(
ds
[
n
],
n
)
...
...
@@ -126,7 +129,8 @@ def comparePaths(t1, t2):
for
n
in
uPar
:
if
dp
[
n
].
__class__
.
__name__
in
histos
:
uniqueTestHistos
+=
1
print
'Paths unique to Test file : %i ( %i Histos )'
%
(
len
(
uPar
),
uniqueTestHistos
)
print
'Paths unique to Test file : %i ( %i Histos )'
%
(
len
(
uPar
),
uniqueTestHistos
)
if
uPar
:
for
n
in
uPar
:
print
'
\t
%s :
\t
%s'
%
(
dp
[
n
],
n
)
...
...
@@ -295,7 +299,8 @@ def compareHistos(t1, t2, state, checkBin2BinIdentity):
if
diffEntries
:
diffEntries
.
sort
()
for
e
in
diffEntries
:
print
'
\t\t\t
%s:
\t
%i != %i'
%
(
e
,
int
(
ds
[
e
].
GetEntries
()),
int
(
dp
[
e
].
GetEntries
()))
print
'
\t\t\t
%s:
\t
%i != %i'
%
(
e
,
int
(
ds
[
e
].
GetEntries
()),
int
(
dp
[
e
].
GetEntries
()))
print
'-'
*
80
# report on Failed Kolmogorov Tests
...
...
@@ -306,7 +311,8 @@ def compareHistos(t1, t2, state, checkBin2BinIdentity):
diffKols
.
sort
()
for
e
in
diffKols
:
result
=
kTestResults
[
e
]
# DP Calculated twice ARGH!!
print
'%s
\t\t
%s :
\t
K-Test Result :
\t
%5.16f'
%
(
ds
[
e
].
ClassName
(),
e
,
result
)
print
'%s
\t\t
%s :
\t
K-Test Result :
\t
%5.16f'
%
(
ds
[
e
].
ClassName
(),
e
,
result
)
print
'-'
*
60
# report on Failed Integral Checks
...
...
@@ -318,7 +324,8 @@ def compareHistos(t1, t2, state, checkBin2BinIdentity):
for
e
in
diffIntegrals
:
diff
=
dp
[
e
].
Integral
()
-
ds
[
e
].
Integral
()
pc
=
(
diff
*
100
)
/
ds
[
e
].
Integral
()
print
'%s
\t\t
%s:
\t
Diff = %5.6f
\t
Percent Diff to Reference : %5.6f '
%
(
ds
[
e
].
ClassName
(),
e
,
diff
,
pc
)
print
'%s
\t\t
%s:
\t
Diff = %5.6f
\t
Percent Diff to Reference : %5.6f '
%
(
ds
[
e
].
ClassName
(),
e
,
diff
,
pc
)
print
'-'
*
60
+
'
\n
'
print
'='
*
80
+
'
\n
'
...
...
@@ -331,23 +338,30 @@ def compareHistos(t1, t2, state, checkBin2BinIdentity):
if
diffIdentity
:
diffIdentity
.
sort
()
for
e
in
diffIdentity
:
print
'%s
\t\t
%s: %i different bins'
%
(
ds
[
e
].
ClassName
(),
e
,
identityDiffBins
[
e
])
print
'%s
\t\t
%s: %i different bins'
%
(
ds
[
e
].
ClassName
(),
e
,
identityDiffBins
[
e
])
print
'-'
*
80
print
'
\n
'
+
'='
*
80
print
'Comparison : Reference/Test ROOT Histo files'
print
'
\n\t\t
Reference
\t
Test'
print
'
\t
Objects : %i
\t
%i
\t\t
( p-s = %i )'
%
(
referenceObjects
,
parallObjects
,
parallObjects
-
referenceObjects
)
print
'
\t
Histos : %i
\t
%i
\t\t
( p-s = %i )'
%
(
referenceHistos
,
parallHistos
,
parallHistos
-
referenceHistos
)
print
'
\t
Objects : %i
\t
%i
\t\t
( p-s = %i )'
%
(
referenceObjects
,
parallObjects
,
parallObjects
-
referenceObjects
)
print
'
\t
Histos : %i
\t
%i
\t\t
( p-s = %i )'
%
(
referenceHistos
,
parallHistos
,
parallHistos
-
referenceHistos
)
print
'
\t
__________'
print
'
\t
Total : %i
\t
%i
\n
'
%
(
referenceHistos
+
referenceObjects
,
parallHistos
+
parallObjects
)
print
'Objects/Histos unique to Reference File : %i / %i'
%
(
len
(
uniqueSerPaths
)
-
uniqueSerHistos
,
uniqueSerHistos
)
print
'Objects/Histos unique to Test File : %i / %i'
%
(
len
(
uniqueParPaths
)
-
uniqueParHistos
,
uniqueParHistos
)
print
'
\t
Total : %i
\t
%i
\n
'
%
(
referenceHistos
+
referenceObjects
,
parallHistos
+
parallObjects
)
print
'Objects/Histos unique to Reference File : %i / %i'
%
(
len
(
uniqueSerPaths
)
-
uniqueSerHistos
,
uniqueSerHistos
)
print
'Objects/Histos unique to Test File : %i / %i'
%
(
len
(
uniqueParPaths
)
-
uniqueParHistos
,
uniqueParHistos
)
print
'
\n
Matching Histograms valid for Comparison : %i'
%
(
mh
)
print
'
\n
Omissions
\'
patterns : '
for
entry
in
gRegexBlackList
:
print
'
\t
%s'
%
(
entry
)
print
'
\n
Histograms for Comparison (after Omissions) : %i'
%
(
mh
-
len
(
gRegexBlackList
))
print
'
\n
Histograms for Comparison (after Omissions) : %i'
%
(
mh
-
len
(
gRegexBlackList
))
print
'
\n\t
HISTOGRAM TESTS : '
print
'
\t\t
KOLMOGOROV TEST : %i'
%
(
kTested
)
print
'
\t\t
INTEGRAL TEST : %i'
%
(
otherTest
)
...
...
GaudiPolicy/scripts/CTestXML2HTML
View file @
bc49fafa
...
...
@@ -608,7 +608,8 @@ def main():
print
" No file found
\n
"
exit
()
print
"Converting *Test.xml files from %s to HTML format in %s"
%
(
options
.
inputDirectory
,
options
.
outputDirectory
)
print
"Converting *Test.xml files from %s to HTML format in %s"
%
(
options
.
inputDirectory
,
options
.
outputDirectory
)
# verify or create the output directory
output
=
options
.
outputDirectory
if
not
os
.
path
.
isdir
(
output
):
...
...
cmake/cmakeLogToCacheGrind.py
View file @
bc49fafa
...
...
@@ -9,7 +9,8 @@ import sys
def
usage
():
print
"Invalid arguments
\n
Proper syntax is :
\n
%s <log file> <callgrind file>"
%
sys
.
argv
[
0
]
print
"Invalid arguments
\n
Proper syntax is :
\n
%s <log file> <callgrind file>"
%
sys
.
argv
[
0
]
if
len
(
sys
.
argv
)
!=
3
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment