Skip to content

Commit

Permalink
#566: fixed bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ppebay committed Dec 18, 2024
1 parent 9477914 commit f7d2b7b
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions src/lbaf/IO/lbsVTDataWriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,19 @@ def __get_communications(self, phase: Phase, rank: Rank):
missing_ref = comm_entry["to"].get("id", comm_entry["to"].get("seq_id"))
self.__logger.error(
f"Invalid object id ({missing_ref}) in communication {json.dumps(comm_entry)}")

Check notice on line 224 in src/lbaf/IO/lbsVTDataWriter.py

View workflow job for this annotation

GitHub Actions / code-quality (ubuntu-latest, 3.8)

Trailing whitespace (trailing-whitespace)
if missing_ref is not None:
# Keep communication with invalid entity references for the moment.
# We might remove these communications in the future in the reader work to fix invalid input.
self.__logger.warning(
f"Missing reference: ({missing_ref}) in communication {json.dumps(comm_entry)}")
communications.append(comm_entry)
elif ("migratable" in comm_entry["from"].keys() and
not comm_entry["from"]["migratable"]): # object is sentinel
not comm_entry["from"]["migratable"]):
# Object is sentinel
communications.append(comm_entry)
elif comm_entry["from"].get("id", comm_entry["from"].get("seq_id")) in rank_objects:
elif comm_entry["from"].get(
"id", comm_entry["from"].get("seq_id")) in rank_objects:
communications.append(comm_entry)
else:
self.__moved_comms.append(comm_entry)
Expand Down Expand Up @@ -302,13 +306,13 @@ def _json_serializer(self, rank_phases_double) -> str:
# Add task data for current rank in iteration
iteration_data["tasks"] = self.__create_task_data(it_r)

# Add communication data if present
communications = self.__get_communications(it, rank)
if communications:
iteration_data["communications"] = communications
# Add communication data if present
communications = self.__get_communications(it, it_r)
if communications:
iteration_data["communications"] = communications

# Append load balancing iteration to phase data
phase_data["lb_iterations"].append(iteration_data)
# Append load balancing iteration to phase data
phase_data["lb_iterations"].append(iteration_data)

# Append create phase
output["phases"].append(phase_data)
Expand Down

0 comments on commit f7d2b7b

Please sign in to comment.