Skip to content

Commit

Permalink
adding brad runner with variable clients (run_variable_clients.py)
Browse files Browse the repository at this point in the history
  • Loading branch information
wuziniu committed Mar 19, 2024
1 parent 099282d commit 508ac5f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions workloads/IMDB_extended/run_variable_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ def adjust_num_running_clients(
for i in pause_clients:
assert (
i not in self.paused_clients
), f"trying to pause a client that is already paused"
), f"trying to pause a client that is already paused: {i}"
if verbose:
print(f"pausing client {i}")
self.pause_semaphore[i].release()
Expand All @@ -460,7 +460,7 @@ def adjust_num_running_clients(
for i in resume_clients:
assert (
i not in self.running_clients
), f"trying to resume a running client"
), f"trying to resume a running client: {i}"
if verbose:
print(f"resuming client {i}")
self.resume_semaphore[i].release()
Expand Down Expand Up @@ -711,7 +711,9 @@ def main():
# N.B. `value = 0` since we use this for synchronization, not mutual exclusion.
# pylint: disable-next=no-member
control_semaphore = [mgr.Semaphore(value=0) for _ in range(args.num_clients)]
# pylint: disable-next=no-member
pause_semaphore = [mgr.Semaphore(value=0) for _ in range(args.num_clients)]
# pylint: disable-next=no-member
resume_semaphore = [mgr.Semaphore(value=0) for _ in range(args.num_clients)]

if args.run_simulation:
Expand Down

0 comments on commit 508ac5f

Please sign in to comment.