From 754e6b9dc4b85ebb29ca112be5fce55a88eb8cfe Mon Sep 17 00:00:00 2001 From: Paul Rigge Date: Wed, 6 Nov 2024 11:22:06 -0800 Subject: [PATCH] Use fewer threads when running openroad. 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. --- place_and_route/open_road.bzl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/place_and_route/open_road.bzl b/place_and_route/open_road.bzl index ae979d52..b70e3ce1 100644 --- a/place_and_route/open_road.bzl +++ b/place_and_route/open_road.bzl @@ -245,6 +245,14 @@ 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, @@ -252,7 +260,7 @@ def openroad_command(ctx, commands, input_db = None, step_name = None, inputs = "-no_init", "-no_splash", "-threads", - "max", + num_threads, "-exit", "-log", log_file.path,