Skip to content

Commit

Permalink
Add ability to not have an algorithm output
Browse files Browse the repository at this point in the history
This allows for getting charts even without the special build
of mantid
  • Loading branch information
peterfpeterson committed Aug 3, 2023
1 parent 1e3fe2d commit e3443b3
Showing 1 changed file with 19 additions and 12 deletions.
31 changes: 19 additions & 12 deletions mantid-profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,18 +329,25 @@ def main():
# Read in algorithm timing log and build tree
try:
header, records = at.fromFile(args.infile)
except FileNotFoundError:
raise
records = [x for x in records if x["finish"] - x["start"] > (args.mintime*1.0e9)]
# Number of threads allocated to this run
nthreads = int(header.split()[3])
# Run start time
header = int(header.split()[1])
# Find maximum level in all trees
lmax = 0
for tree in at.toTrees(records):
for node in tree.to_list():
lmax = max(node.level,lmax)
records = [x for x in records if x["finish"] - x["start"] > (args.mintime*1.0e9)]
# Number of threads allocated to this run
nthreads = int(header.split()[3])
# Run start time
header = int(header.split()[1])
# Find maximum level in all trees
lmax = 0
for tree in at.toTrees(records):
for node in tree.to_list():
lmax = max(node.level,lmax)
except FileNotFoundError as e:
print("failed to load file:", e.filename)
print("creating plot without algorithm annotations")

import psutil
nthreads = psutil.cpu_count()
lmax = 1
header = ""
records = []

# Read in CPU and memory activity log
try:
Expand Down

0 comments on commit e3443b3

Please sign in to comment.