Skip to content

Commit

Permalink
fix: zero-division error
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasrothenberger committed Sep 22, 2023
1 parent 10fa4bc commit 56a0475
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion discopop_library/discopop_optimizer/PETParser/PETParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def __add_loop_nodes(self):

# get iteration count for loop
if loop_node.loop_data is not None:
iteration_count = loop_node.loop_data.average_iteration_count
iteration_count = max(1, loop_node.loop_data.average_iteration_count)
else:
# loop has not been executed, thus, no information was gathered during the profiling
# set iteration_count to prevent divisions by zero
Expand Down

0 comments on commit 56a0475

Please sign in to comment.