Skip to content

Commit

Permalink
updated style
Browse files Browse the repository at this point in the history
  • Loading branch information
movsesyanae committed Nov 3, 2023
1 parent 8e222dc commit c2019b0
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions pipit/readers/hpctoolkit_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,9 @@ def __get_load_modules_index(self, load_module_pointer: int) -> int:
Given the pointer to where the file would exists in meta.db,
returns the index of the file in self.source_files_list.
"""
return ( (
return (
load_module_pointer - self.load_modules_pointer
) // self.load_module_size )
) // self.load_module_size

def __read_load_modules_section(
self, section_pointer: int, section_size: int
Expand Down Expand Up @@ -964,21 +964,21 @@ def __read_hit_section(self, section_pointer: int, section_size: int) -> None:
)
identifier_name = self.meta_reader.get_identifier_name(kind)
tuples_map[identifier_name] = physical_id

self.hit_map[hit_pointer] = self.__clean_hit(tuples_map)

def __clean_hit(self, tuples_map: dict) -> dict:
# add None for information not present
if 'Node' not in tuples_map:
tuples_map['Node'] = None
if 'RANK' not in tuples_map:
tuples_map['RANK'] = None
if 'THREAD' not in tuples_map:
tuples_map['THREAD'] = None
if 'CORE' not in tuples_map:
tuples_map['CORE'] = None
if "Node" not in tuples_map:
tuples_map["Node"] = None
if "RANK" not in tuples_map:
tuples_map["RANK"] = None
if "THREAD" not in tuples_map:
tuples_map["THREAD"] = None
if "CORE" not in tuples_map:
tuples_map["CORE"] = None
return tuples_map

def __read_common_header(self) -> None:
"""
Reads common .db file header version 4.0
Expand Down Expand Up @@ -1255,10 +1255,10 @@ def __read_single_trace_header(self, header_pointer: int) -> None:
else:
self.data["Event Type"].append("Leave")
self.data["Timestamp (ns)"].append(timestamp)
self.data["Process"].append(hit['RANK'])
self.data["Thread"].append(hit['THREAD'])
self.data["Host"].append(hit['NODE'])
self.data['Core'].append(hit['CORE'])
self.data["Process"].append(hit["RANK"])
self.data["Thread"].append(hit["THREAD"])
self.data["Host"].append(hit["NODE"])
self.data["Core"].append(hit["CORE"])
self.data["Node"].append(last_node)
self.data["Source File Name"].append(context_information["file"])
self.data["Source File Line Number"].append(
Expand Down Expand Up @@ -1290,10 +1290,10 @@ def __read_single_trace_header(self, header_pointer: int) -> None:
else:
self.data["Event Type"].append("Enter")
self.data["Timestamp (ns)"].append(timestamp)
self.data["Process"].append(hit['RANK'])
self.data["Thread"].append(hit['THREAD'])
self.data["Host"].append(hit['NODE'])
self.data['Core'].append(hit['CORE'])
self.data["Process"].append(hit["RANK"])
self.data["Thread"].append(hit["THREAD"])
self.data["Host"].append(hit["NODE"])
self.data["Core"].append(hit["CORE"])
self.data["Node"].append(entry_node)
self.data["Source File Name"].append(context_information["file"])
self.data["Source File Line Number"].append(
Expand Down Expand Up @@ -1326,10 +1326,10 @@ def __read_single_trace_header(self, header_pointer: int) -> None:
else:
self.data["Event Type"].append("Leave")
self.data["Timestamp (ns)"].append(timestamp)
self.data["Process"].append(hit['RANK'])
self.data["Thread"].append(hit['THREAD'])
self.data["Host"].append(hit['NODE'])
self.data['Core'].append(hit['CORE'])
self.data["Process"].append(hit["RANK"])
self.data["Thread"].append(hit["THREAD"])
self.data["Host"].append(hit["NODE"])
self.data["Core"].append(hit["CORE"])
self.data["Node"].append(last_node)
self.data["Source File Name"].append(context_information["file"])
self.data["Source File Line Number"].append(context_information["line"])
Expand Down Expand Up @@ -1372,5 +1372,5 @@ def read(self) -> pipit.trace.Trace:
}
)

self.trace_df = trace_df.dropna(axis=1, how='all')
self.trace_df = trace_df.dropna(axis=1, how="all")
return pipit.trace.Trace(None, self.trace_df)

0 comments on commit c2019b0

Please sign in to comment.