Skip to content

Commit

Permalink
Use fewer threads when running openroad.
Browse files Browse the repository at this point in the history
Don't overwhelm remote executors (which may be running multiple actions) with too many threads. Just use one unless the job is required to be run locally, in which case we expect an action will often have the entire system to itself.
  • Loading branch information
grebe committed Nov 7, 2024
1 parent ca650bf commit aeaf720
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion place_and_route/open_road.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,22 @@ def openroad_command(ctx, commands, input_db = None, step_name = None, inputs =
),
)

# Don't overwhelm remote executors (which may be running multiple actions)
# with too many threads. Just use one unless the job is required to be run
# locally, in which case we expect an action will often have the entire
# system to itself.
num_threads = "1"
if "no-remote-exec" in execution_requirements:
num_threads = "max"

ctx.actions.run(
outputs = [output_db, log_file] + outputs,
inputs = inputs + [command_file] + input_db_dependency,
arguments = [
"-no_init",
"-no_splash",
"-threads",
"max",
num_threads,
"-exit",
"-log",
log_file.path,
Expand Down

0 comments on commit aeaf720

Please sign in to comment.