Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce ITP with number of active tests per user #1747

Merged
merged 1 commit into from
Jul 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions server/fishtest/rundb.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ def get_results(self, run, save_run=True):

return results

def calc_itp(self, run):
def calc_itp(self, run, count):
itp = run["args"]["throughput"]
itp = max(min(itp, 500), 1)

Expand Down Expand Up @@ -640,13 +640,8 @@ def calc_itp(self, run):
bonus = min(n / x, 2)
itp *= bonus

# Extra bonus for most promising LTCs at strong-gainer bounds
# if (
# tc_ratio >= 3.0
# and llr > 1.5
# and run["args"].get("sprt", {}).get("elo0", 0) > 0
# ):
# itp *= 1.2 # Max net bonus 2x
# Malus for too many active runs
itp *= 36.0 / (36.0 + count * count)

run["args"]["itp"] = itp

Expand Down Expand Up @@ -715,11 +710,20 @@ def sync_request_task(self, worker_info):

if runs_finished or time.time() > self.task_time + 60:
print("Request_task: refresh queue", flush=True)

# list user names for active runs
user_active = []
for r in self.get_unfinished_runs_id():
run = self.get_run(r["_id"])
if any(task["active"] for task in reversed(run["tasks"])):
user_active.append(run["args"].get("username"))

# now compute their itp
self.task_runs = []
for r in self.get_unfinished_runs_id():
run = self.get_run(r["_id"])
self.update_workers_cores(run)
self.calc_itp(run)
self.calc_itp(run, user_active.count(run["args"].get("username")))
self.task_runs.append(run)
self.task_time = time.time()

Expand Down
Loading