6 s =
"""Purpose: Convert a cmsRun log with Tracer info into a stream stall graph.
8 To Use: Add the Tracer Service to the cmsRun job you want to check for stream stalls.
9 Make sure to use the 'printTimstamps' option
10 cms.Service("Tracer", printTimestamps = cms.untracked.bool(True))
11 After running the job, execute this script and pass the name of the log file to the
12 script as the only command line argument.
14 To Read: The script will then print an 'ASCII art' stall graph which consists of the name of
15 the module which either started or stopped running on a stream, and the state of each
16 stream at that moment in time and if the module just started, you will also see the
17 amount of time on that stream between the previous module finishing and this module starting.
18 The state of a stream is represented by a symbol:
19 blank (" ") the stream is currently running a module
20 line ("|") the stream is waiting to run a module
21 star ("*") the stream has just finished waiting and is starting a module
22 If a module had to wait more than 0.1 seconds, the end of the line will have "STALLED".
23 Once the first 4 events have finished processing, the program prints "FINISH INIT".
24 This is useful if one wants to ignore stalled caused by startup actions, e.g. reading
27 Once the graph is completed, the program outputs the list of modules which had
28 the greatest total stall times. The list is sorted by total stall time and
29 written in descending order. In addition, the list of all stall times for the
35 fileName = sys.argv[1]
37 f = open(fileName,
"r")
40 time = line.split(
" ")[1]
41 time = time.split(
":")
42 time = int(time[0])*60*60+int(time[1])*60+float(time[2])
49 foundEventToStartFrom =
False
51 if not foundEventToStartFrom:
52 if l.find(
"event = 5") != -1:
53 foundEventToStartFrom =
True
54 stream = int( l[l.find(
"stream = ")+9])
55 processingSteps.append((
"FINISH INIT",1,stream,
getTime(l)-startTime))
56 if l.find(
"processing event for module") != -1:
60 time = time - startTime
63 if l.find(
"finished:") != -1:
65 stream = int( l[l.find(
"stream = ")+9])
66 name = l.split(
"'")[1]
67 if len(name) > maxNameSize:
68 maxNameSize = len(name)
69 processingSteps.append((name,trans,stream,time))
70 if stream > numStreams:
77 streamState = [1]*(numStreams+1)
78 streamTime = [0]*(numStreams+1)
82 for n,trans,s,time
in processingSteps:
83 if n ==
"FINISH INIT":
85 oldState = streamState[s]
89 waitTime = time - streamTime[s]
95 states =
"%-*s: " % (maxNameSize,n)
96 for state
in streamState:
105 if waitTime
is not None:
106 states +=
" %.2f"% waitTime
107 if waitTime > 0.1
and seenInit:
108 t = stalledModules.setdefault(n,[])
116 for n,t
in stalledModules.iteritems():
118 priorities.append((n,sum(t),t))
121 return cmp(i[1],j[1])
122 priorities.sort(cmp=sumSort, reverse=
True)
124 for n,s,t
in priorities:
125 print n,
"%.2f"%s, [
"%.2f"%x
for x
in t]
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run