Skip to content

Commit

Permalink
Make parsl-perf iterations have at least 1 task
Browse files Browse the repository at this point in the history
Prior to this PR: In some startup situations, the estimated number of
tasks for the next iteration can round down to 0, and then parsl-perf
can sometimes enter an infinite loop without increasing the loop size:

==== Iteration 29463 ====
Will run 0 tasks to target 20.0 seconds runtime
Submitting tasks / invoking apps
All 0 tasks submitted ... waiting for completion
Submission took 2.1457672119140625e-06 seconds = 0.0 tasks/second
Runtime: 1.049041748046875e-05s vs target 20.0
Tasks per second: 0.0
  • Loading branch information
benclifford committed Sep 26, 2023
1 parent c789262 commit eeb9a92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parsl/benchmark/perf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def performance(*, resources: dict, target_t: float):
print(f"Runtime: actual {delta_t:.3f}s vs target {target_t}s")
print(f"Tasks per second: {rate:.3f}")

n = int(target_t * rate)
n = max(1, int(target_t * rate))

iteration += 1

Expand Down

0 comments on commit eeb9a92

Please sign in to comment.