Skip to content

Commit e89be59

Browse files
committed
#566: corrected incorrect handling of Bool/int
1 parent 1d4f033 commit e89be59

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

config/synthetic-blocks.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ visualization:
4343
output_visualization_file_stem: output_file
4444

4545
write_JSON:
46-
compressed: False
46+
compressed: false
4747
suffix: json
48-
communications: True
49-
offline_LB_compatible: True
48+
communications: true
49+
offline_LB_compatible: true

src/lbaf/Applications/LBAF_app.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ def run(self, cfg=None, cfg_dir=None):
589589
"offline_LB_compatible", False)
590590
rebalanced_phase = runtime.execute(
591591
self.__parameters.algorithm.get("phase_id", 0),
592-
offline_LB_compatible)
592+
1 if offline_LB_compatible else 0)
593593

594594
# Instantiate phase to VT file writer when requested
595595
if self.__json_writer:
@@ -618,8 +618,9 @@ def run(self, cfg=None, cfg_dir=None):
618618
f"Writing all ({len(phases)}) phases for offline load-balancing")
619619
self.__json_writer.write(phases)
620620
else:
621-
self.__logger.info(f"Writing single phase {phase_id} to JSON files")
622-
self.__json_writer.write(
621+
# Add new phase when load balancing when offline mode not selected
622+
self.__logger.info(f"Creating rebalanced phase {phase_id}")
623+
self.__jsoTn_writer.write(
623624
{phase_id: rebalanced_phase})
624625

625626
# Generate meshes and multimedia when requested

src/lbaf/Execution/lbsInformAndTransferAlgorithm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def __process_message(self, r_rcv: Rank, m: Message):
128128
# Process the message
129129
self.__known_peers[r_rcv].update(m.get_support())
130130

131-
def __forward_message(self, i: int, r_snd: Rank, f:int):
131+
def __forward_message(self, i: int, r_snd: Rank, f: int):
132132
"""Forward information message to rank peers sampled from known ones."""
133133
# Make rank aware of itself
134134
if r_snd not in self.__known_peers:

src/lbaf/Execution/lbsRuntime.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ def get_statistics(self):
130130
"""Return runtime statistics."""
131131
return self.__statistics
132132

133-
def execute(self, p_id: int, phase_increment=0):
133+
def execute(self, p_id: int, phase_increment: int=0):
134134
"""Execute runtime for single phase with given ID or multiple phases in selected range."""
135-
# Execute balancing algorithm
135+
# Execute load balancing algorithm
136136
self.__logger.info(
137137
f"Executing {type(self.__algorithm).__name__} for "
138138
+ ("all phases" if p_id < 0 else f"phase {p_id}"))
@@ -145,11 +145,13 @@ def execute(self, p_id: int, phase_increment=0):
145145

146146
# Retrieve possibly null rebalanced phase and return it
147147
if (pp := self.__algorithm.get_rebalanced_phase()):
148+
# Increment rebalanced phase ID as requested
148149
pp.set_id((pp_id := pp.get_id() + phase_increment))
149150

150151
# Share communications from original phase with new phase
151152
initial_communications = self.__algorithm.get_initial_communications()
152153
pp.set_communications(initial_communications[p_id])
153-
154154
self.__logger.info(f"Created rebalanced phase {pp_id}")
155+
156+
# Return rebalanced phase
155157
return pp

0 commit comments

Comments
 (0)