Commit 8be88392 authored by teor's avatar teor Committed by Tom Ritter
Browse files

fixup! Ignore node classes with zero members, rather than asserting


Signed-off-by: default avatarteor <teor2345@gmail.com>
parent a8abac7b
......@@ -508,7 +508,10 @@ def main(argv):
while prev_pid_avg > pid_tgt_avg[cl]:
f_nodes = filter(lambda n: n.desc_bw >= pid_tgt_avg[cl], c_nodes)
prev_pid_avg = pid_tgt_avg[cl]
pid_tgt_avg[cl] = sum(map(lambda n: n.filt_bw, f_nodes))/float(len(f_nodes))
if len(f_nodes) > 0:
pid_tgt_avg[cl] = sum(map(lambda n: n.filt_bw, f_nodes))/float(len(f_nodes))
else:
pid_tgt_avg[cl] = 0.0
plog("INFO", "Network true_filt_avg["+cl+"]: "+str(true_filt_avg[cl]))
plog("INFO", "Network pid_tgt_avg["+cl+"]: "+str(pid_tgt_avg[cl]))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment