Upgrade python formatting module
Signed-off-by: coleramos425 <colramos@amd.com>
This commit is contained in:
@@ -37,7 +37,6 @@ MAX_SERVER_SEL_DELAY = 5000 # 5 sec connection timeout
|
||||
|
||||
|
||||
def kernel_name_shortener(df, cache, level):
|
||||
|
||||
if level >= 5:
|
||||
return df
|
||||
|
||||
@@ -50,7 +49,6 @@ def kernel_name_shortener(df, cache, level):
|
||||
if columnName == "KernelName" or columnName == "Name":
|
||||
# loop through all indices
|
||||
for index in df.index:
|
||||
|
||||
original_name = df.loc[index, columnName]
|
||||
if original_name in cache:
|
||||
continue
|
||||
|
||||
@@ -163,7 +163,6 @@ class mainWindow(QMainWindow):
|
||||
self.exportPMCCounters(fileName)
|
||||
|
||||
def exportPMCCounters(self, fileName):
|
||||
|
||||
f = open(fileName, "w")
|
||||
|
||||
total_IP_blocks = len(list(self.perfmon_config.keys()))
|
||||
@@ -188,7 +187,6 @@ class mainWindow(QMainWindow):
|
||||
return
|
||||
|
||||
def pmc_metric_selected(self, metric_name, col):
|
||||
|
||||
# check if the metric already exists
|
||||
metric_selected = False
|
||||
|
||||
@@ -314,7 +312,6 @@ class mainWindow(QMainWindow):
|
||||
self.table.setItem(row, col, QTableWidgetItem(metric_name))
|
||||
|
||||
def pmc_select(self, item):
|
||||
|
||||
metric_name = item.data()
|
||||
if (
|
||||
not metric_name in self.nodes_dict
|
||||
@@ -334,13 +331,11 @@ class mainWindow(QMainWindow):
|
||||
|
||||
# Function to save populate treeview with a dictionary
|
||||
def importData(self, xmlparsed, root=None):
|
||||
|
||||
self.model.setRowCount(0)
|
||||
if root is None:
|
||||
root = self.model.invisibleRootItem()
|
||||
|
||||
for x in xmlparsed.getiterator():
|
||||
|
||||
# Add SoC node to Root
|
||||
if x.tag in self.soc_arch_list:
|
||||
parent = root
|
||||
@@ -349,10 +344,8 @@ class mainWindow(QMainWindow):
|
||||
|
||||
# check all metrics in an SoC family
|
||||
if x.tag == "metric" and x.getparent().tag in self.soc_arch_list:
|
||||
|
||||
# New IP block (e.g., SQ), detected, create a new hierarchy for the block
|
||||
if not x.attrib["block"] in self.block_list:
|
||||
|
||||
self.block_list.append(x.attrib["block"])
|
||||
parent = self.nodes_dict[x.getparent().tag] # the SoC node
|
||||
parent.appendRow(
|
||||
@@ -386,7 +379,6 @@ class mainWindow(QMainWindow):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
app = QApplication(sys.argv)
|
||||
app.setStyle("Fusion")
|
||||
|
||||
|
||||
@@ -85,7 +85,6 @@ perfmon_config = {
|
||||
|
||||
|
||||
def perfmon_coalesce(pmc_files_list, workload_dir, soc):
|
||||
|
||||
workload_perfmon_dir = workload_dir + "/perfmon"
|
||||
|
||||
# match pattern for pmc counters
|
||||
@@ -110,7 +109,6 @@ def perfmon_coalesce(pmc_files_list, workload_dir, soc):
|
||||
|
||||
# Extract all PMC counters and store in separate buckets
|
||||
for fname in pmc_files_list:
|
||||
|
||||
lines = open(fname, "r").read().splitlines()
|
||||
|
||||
for line in lines:
|
||||
@@ -183,7 +181,6 @@ def perfmon_coalesce(pmc_files_list, workload_dir, soc):
|
||||
|
||||
|
||||
def perfmon_emit(pmc_list, workload_dir, soc):
|
||||
|
||||
workload_perfmon_dir = workload_dir + "/perfmon"
|
||||
|
||||
# Calculate the minimum number of iteration to save the pmc counters
|
||||
@@ -246,7 +243,6 @@ def perfmon_emit(pmc_list, workload_dir, soc):
|
||||
|
||||
|
||||
def perfmon_filter(workload_dir, perfmon_dir, args):
|
||||
|
||||
workload_perfmon_dir = workload_dir + "/perfmon"
|
||||
soc = args.target
|
||||
|
||||
@@ -288,7 +284,6 @@ def perfmon_filter(workload_dir, perfmon_dir, args):
|
||||
|
||||
|
||||
def pmc_filter(workload_dir, perfmon_dir, soc):
|
||||
|
||||
workload_perfmon_dir = workload_dir + "/perfmon"
|
||||
|
||||
if not os.path.isdir(workload_perfmon_dir):
|
||||
|
||||
@@ -26,6 +26,7 @@ import argparse
|
||||
import getpass
|
||||
from pymongo import MongoClient
|
||||
|
||||
|
||||
# Verify target directory and setup connection
|
||||
def remove_workload(args):
|
||||
# parser = argparse.ArgumentParser(description='Remove a workload from an Omniperf Instance')
|
||||
|
||||
@@ -84,7 +84,6 @@ class MachineSpecs:
|
||||
|
||||
|
||||
def gpuinfo():
|
||||
|
||||
rocminfo = run(["rocminfo"]).split("\n")
|
||||
|
||||
for idx1, linetext in enumerate(rocminfo):
|
||||
@@ -97,7 +96,6 @@ def gpuinfo():
|
||||
|
||||
L1, L2 = "", ""
|
||||
for idx2, linetext in enumerate(rocminfo[idx1 + 1 :]):
|
||||
|
||||
key = search(r"^\s*L1:\s+ ([a-zA-Z0-9]+)\s*", linetext)
|
||||
if key != None:
|
||||
L1 = key
|
||||
@@ -159,7 +157,6 @@ def search(pattern, string):
|
||||
|
||||
|
||||
def get_machine_specs(devicenum):
|
||||
|
||||
cpuinfo = path("/proc/cpuinfo").read_text()
|
||||
meminfo = path("/proc/meminfo").read_text()
|
||||
version = path("/proc/version").read_text()
|
||||
|
||||
Reference in New Issue
Block a user