Skip to content

Commit

Permalink
Bug fix divide by zero (#10)
Browse files Browse the repository at this point in the history
- Return load_balance as 0 in case computation_time is 0
  • Loading branch information
jorblancoa authored and nrnhines committed Jun 5, 2019
1 parent b2c8384 commit d3b40f9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ringtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ def prun(tstop):

avg_comp_time = pc.allreduce(computation_time, 1) / settings.nhost

load_balance = avg_comp_time / max_cw_time
if max_cw_time == 0:
load_balance = 0
else:
load_balance = avg_comp_time / max_cw_time

# spike communication time
spk_time = (pc.allreduce(wait, 2), pc.allreduce(wait, 3))
Expand Down

0 comments on commit d3b40f9

Please sign in to comment.