Skip to content

Commit

Permalink
Fix case where external work was only module running on a stream
Browse files Browse the repository at this point in the history
There was a bug where if there was an external work and we only ever had one module running at a time on a stream, the external work was not added to the stacked graph at the bottom.
  • Loading branch information
Dr15Jones committed Jul 5, 2018
1 parent c102820 commit 08132d0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions FWCore/Concurrency/scripts/edmStreamStallGrapher.py
Expand Up @@ -564,6 +564,7 @@ def createPDFImage(pdfFile, shownStacks, processingSteps, numStreams, stalledMod
streamRunningTimes = [[] for x in xrange(numStreams)]
streamExternalWorkRunningTimes = [[] for x in xrange(numStreams)]
maxNumberOfConcurrentModulesOnAStream = 1
externalWorkModulesInJob = False
previousTime = [0 for x in xrange(numStreams)]

# The next five variables are only used to check for out of order transitions
Expand Down Expand Up @@ -651,6 +652,7 @@ def createPDFImage(pdfFile, shownStacks, processingSteps, numStreams, stalledMod
if checkOrder:
countExternalWork[s][n] += 1
if displayExternalWork:
externalWorkModulesInJob = True
if (not checkOrder) or countExternalWork[s][n] > 0:
externalWorkModules.add(n)
streamExternalWorkRunningTimes[s].append(Point(time,+1))
Expand Down Expand Up @@ -720,7 +722,7 @@ def createPDFImage(pdfFile, shownStacks, processingSteps, numStreams, stalledMod
allStackTimes[info.color].append((info.begin, info.delta))

# Now superimpose the number of concurrently running modules on to the graph.
if maxNumberOfConcurrentModulesOnAStream > 1:
if maxNumberOfConcurrentModulesOnAStream > 1 or externalWorkModulesInJob:

for i,perStreamRunningTimes in enumerate(streamRunningTimes):

Expand Down Expand Up @@ -777,7 +779,7 @@ def createPDFImage(pdfFile, shownStacks, processingSteps, numStreams, stalledMod
axStack.broken_barh(finalxs, (0, height), facecolors=color, edgecolors=color, linewidth=0)

axStack.set_xlabel("Time (sec)");
axStack.set_ylabel("# threads");
axStack.set_ylabel("# modules");
axStack.set_xlim(ax.get_xlim())
axStack.tick_params(top='off')

Expand Down

0 comments on commit 08132d0

Please sign in to comment.