Skip to content

Commit

Permalink
Merge branch 'develop' into projections-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
movsesyanae authored Oct 18, 2024
2 parents f5a89ee + 8e63214 commit e89562b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
6 changes: 3 additions & 3 deletions pipit/readers/otf2_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,9 @@ def events_reader(self, rank_size):
if value is not None and key != "time":
# uses field_to_val to convert all data types
# and ensure that there are no pickling errors
attributes_dict[
self.field_to_val(key)
] = self.handle_data(value)
attributes_dict[self.field_to_val(key)] = (
self.handle_data(value)
)
event_attributes.append(attributes_dict)
else:
# nan attributes for leave rows
Expand Down
12 changes: 6 additions & 6 deletions pipit/readers/projections_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,10 @@ def _read_log_file(self, rank_size) -> pd.DataFrame:
pe = int(line_arr[5])
msglen = int(line_arr[6])
send_time = int(line_arr[7]) * 1000
numPEs = int(line_arr[8])
destPEs = []
for i in (0, numPEs):
destPEs.append(int(line_arr[9 + i]))
num_procs = int(line_arr[8])
dest_procs = []
for i in (0, num_procs):
dest_procs.append(int(line_arr[9 + i]))

details = {
"From PE": pe,
Expand All @@ -523,7 +523,7 @@ def _read_log_file(self, rank_size) -> pd.DataFrame:
"Message Length": msglen,
"Event ID": event,
"Send Time": send_time,
"Destination PEs": destPEs,
"Destinatopn PEs": dest_procs,
}

_add_to_trace_dict(
Expand All @@ -532,7 +532,7 @@ def _read_log_file(self, rank_size) -> pd.DataFrame:
"Instant",
time,
pe_num,
"To " + str(numPEs) + "processors",
"To " + str(num_procs) + "processors",
)

# Processing of chare (i.e. execution) ?
Expand Down
8 changes: 4 additions & 4 deletions pipit/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,27 +597,27 @@ def load_imbalance(self, metric="time.exc", num_processes=1):

return imbalance_df

def idle_time(self, idle_functions=["Idle"], MPI_events=False):
def idle_time(self, idle_functions=["Idle"], mpi_events=False):
# dict for creating a new dataframe
idle_times = {"Process": [], "Idle Time": []}

for process in set(self.events["Process"]):
idle_times["Process"].append(process)
idle_times["Idle Time"].append(
self._calculate_idle_time_for_process(
process, idle_functions, MPI_events
process, idle_functions, mpi_events
)
)
return pd.DataFrame(idle_times)

def _calculate_idle_time_for_process(
self, process, idle_functions=["Idle"], MPI_events=False
self, process, idle_functions=["Idle"], mpi_events=False
):
# calculate inclusive metrics
if "time.inc" not in self.events.columns:
self.calc_inc_metrics()

if MPI_events:
if mpi_events:
idle_functions += ["MPI_Wait", "MPI_Waitall", "MPI_Recv"]
# filter the dataframe to include only 'Enter' events within the specified
# process with the specified function names
Expand Down
8 changes: 5 additions & 3 deletions pipit/util/cct.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,11 @@ def create_cct(events):

# add node as root or child of its
# parent depending on current depth
graph.add_root(
curr_node
) if curr_depth == 0 else parent_node.add_child(curr_node)
(
graph.add_root(curr_node)
if curr_depth == 0
else parent_node.add_child(curr_node)
)

# Update nodes stack, column, and current depth
nodes_stack.append(curr_node)
Expand Down

0 comments on commit e89562b

Please sign in to comment.