Skip to content

Commit a53e648

Browse files
committed
Temporarily scale up aws instances
1 parent 46b2d0b commit a53e648

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

codeclash/games/robotrumble/robotrumble.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
from collections import Counter
55
from concurrent.futures import ThreadPoolExecutor, as_completed
66

7-
from tqdm.auto import tqdm
8-
97
from codeclash.agents.player import Player
108
from codeclash.constants import RESULT_TIE
119
from codeclash.games.game import CodeGame, RoundStats
@@ -64,16 +62,19 @@ def execute_round(self, agents: list[Player]):
6462
cmd = f"{self.run_cmd_round} {shlex.join(args)}"
6563
self.logger.info(f"Running game: {cmd}")
6664

67-
with ThreadPoolExecutor(5) as executor:
65+
with ThreadPoolExecutor(8) as executor:
6866
# Submit all simulations to the thread pool
6967
futures = [
7068
executor.submit(self._run_single_simulation, agents, idx, cmd)
7169
for idx in range(self.game_config.get("sims_per_round", 100))
7270
]
7371

7472
# Collect results as they complete
75-
for future in tqdm(as_completed(futures), total=len(futures)):
73+
i_completed = 0
74+
for future in as_completed(futures):
7675
future.result()
76+
i_completed += 1
77+
self.logger.info(f"Completed {i_completed} of {len(futures)} simulations")
7778

7879
def _get_winner_txt(self, output_file: str, agents: list[Player]) -> str:
7980
try:

0 commit comments

Comments
 (0)