Skip to content

Commit

Permalink
Use all cores for bulk tests instead of 4
Browse files Browse the repository at this point in the history
  • Loading branch information
LagoLunatic committed Jun 27, 2024
1 parent d2ed99d commit e5d7e57
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"--exportfolder",
"--mapselect",
"--noui",
"--bulk", "100",
"--bulk",
],
},
{
Expand All @@ -97,7 +97,7 @@
"--exportfolder",
"--mapselect",
"--noui",
"--bulk", "100",
"--bulk",
"--noitemrando",
],
},
Expand Down
7 changes: 5 additions & 2 deletions wwrando.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def make_argparser() -> argparse.ArgumentParser:
help="Use the seed and options from the specified permalink instead of the last saved settings.",
)
parser.add_argument(
'-b', '--bulk', type=int, nargs='?', const=100, metavar="SEEDS",
'-b', '--bulk', type=int, nargs='?', const=200, metavar="SEEDS",
help="Randomize a large number of seeds (default 100) and save their logs only.",
)
parser.add_argument(
Expand Down Expand Up @@ -137,7 +137,7 @@ def run_all_bulk_tests(rando_kwargs, num_seeds):
# Catch any init errors early
WWRandomizer(**rando_kwargs)

with Pool(4) as p:
with Pool() as p:
first_seed = 0
func_args = [(i, rando_kwargs) for i in range(first_seed, first_seed+num_seeds)]
progress_bar = tqdm(p.imap(run_single_bulk_test, func_args), total=num_seeds)
Expand Down Expand Up @@ -173,6 +173,9 @@ def run_all_bulk_tests(rando_kwargs, num_seeds):
failures_done += 1
progress_bar.set_description(f"{failures_done}/{total_done} seeds failed")

failed_percent = failures_done / total_done * 100
print(f"Total failures: {failures_done}/{total_done} ({failed_percent:.2f}%)")

if counts:
print(counts)

Expand Down

0 comments on commit e5d7e57

Please sign in to comment.