Skip to content

Commit f5acd70

Browse files
committed
additional changes after CI-formatting
1 parent afb131f commit f5acd70

File tree

3 files changed

+15
-22
lines changed

3 files changed

+15
-22
lines changed

source/utils/profiler/scripts/parseMe.py

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
#!/usr/bin/env python3
22

3-
import argparse, textwrap
3+
import argparse
4+
import textwrap
45
import os
56

67
parser = argparse.ArgumentParser(
78
description="ADIOS json file parser step 2 (step 1 is use compare.sh to collect properties from json)"
89
)
910

1011
TAGS = {
11-
"input_dir": "dataDir", ## key name for input direcory is "dataDir"
12+
"input_dir": "dataDir", # key name for input direcory is "dataDir"
1213
"rank": "whichRank", ##
1314
"out": "plotPrefix", ##
1415
"showfig": "showFig", ##
15-
"attr": "jsonAttr", ## key refer to specific json attr
16-
"zero": "zeroIf", ## key refer to a min number to be treated as 0. Spot the first rank with this value, and only plot up to this rank.
16+
"attr": "jsonAttr", # key refer to specific json attr
17+
"zero": "zeroIf", # key refer to a min number to be treated as 0. Spot the first rank with this value, and only plot up to this rank.
1718
"level": "levelAxis",
1819
}
1920

2021
TAGS_DEFAULT = {
21-
"input_dir": "outs/", ## key name for input direcory defaults to "outs/"
22+
"input_dir": "outs/", # key name for input direcory defaults to "outs/"
2223
"rank": 0, ##
2324
"out": "plot", ##
2425
"showfig": "False", ##
25-
"attr": "ES", ## default json attr to look at is ES
26-
"zero": "0.000001", ## ignore if smaller than
27-
"level": "False", ## whether left/right axises (if both exist) should display same range
26+
"attr": "ES", # default json attr to look at is ES
27+
"zero": "0.000001", # ignore if smaller than
28+
"level": "False", # whether left/right axises (if both exist) should display same range
2829
}
2930

3031
parser.add_argument(
@@ -115,12 +116,3 @@ def parse_vars(items):
115116
parser.error(f"showFig must be 'True' or 'False', got '{command_options[TAGS['level']]}'")
116117
command_options[TAGS["showfig"]] = showFig_val == "true"
117118

118-
# command_options[TAGS["level"]] = eval(command_options[TAGS["level"]])
119-
120-
# valid_keys = set(TAGS.values())
121-
# for key in command_options:
122-
# if key not in valid_keys:
123-
# parser.warn(f"Invalid option key: '{key}'. Valid keys are: {', '.join(valid_keys)}")
124-
#### allow extra options ####
125-
126-
# print (command_options)

source/utils/profiler/scripts/plotCall.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def summarizeFile(inputFile):
3535
with open(inputFile, "r") as f:
3636
data = csv.reader(f, delimiter=",", quotechar="|")
3737
data1 = [float(row[0]) for row in data if row] # Handle empty rows
38-
return int(data1[0]) if data1 else 0 ## num of calls are the same for all ranks
38+
return int(data1[0]) if data1 else 0 # num of calls are the same for all ranks
3939
except (FileNotFoundError, IndexError, ValueError) as e:
4040
print(f"Warning: Could not process {inputFile}: {e}")
4141
return 0

source/utils/profiler/scripts/plotRanks.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
import matplotlib.pyplot as plt
44
import numpy as np
55
import csv
6-
import sys, os
6+
import sys
7+
import os
78
import parseMe
89
import common
910

@@ -21,7 +22,7 @@ def processFile(inputFile, ax, color, tag):
2122
if idx > 10:
2223
ax.plot(data1[0:idx], "--o", color=color)
2324
ax.set_xticks([0, data1.size - 1])
24-
# ax.set_xticks([]) ## no x ticks
25+
# ax.set_xticks([]) # no x ticks
2526
else:
2627
if color == "r":
2728
ax.plot(range(idx), data1[0:idx], "--o", color=color)
@@ -57,13 +58,13 @@ def processFile(inputFile, ax, color, tag):
5758
elif len(parseMe.args.ioTypes) == 2:
5859
ax2 = ax1.twinx()
5960

60-
## logscale and ticklabel_format cannot be present together. python error
61+
# note: logscale and ticklabel_format cannot be present together. python error
6162
logScaleAxis = ""
6263
if "logScale" in parseMe.command_options:
6364
logScaleAxis = parseMe.command_options["logScale"]
6465

6566
jsonAttrStr = parseMe.command_options[parseMe.TAGS["attr"]]
66-
whichKind = "secs" ## or 'nCalls'or 'MB'
67+
whichKind = "secs" # or 'nCalls'or 'MB'
6768
if "whichKind" in parseMe.command_options:
6869
whichKind = "MB"
6970
for i in range(0, len(parseMe.args.ioTypes)):

0 commit comments

Comments
 (0)