Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lower the default local parallelism, and align the number of swimlanes to it #10499

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/python/pants/option/global_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def from_bootstrap_options(cls, bootstrap_options):
remote_store_chunk_upload_timeout_seconds=60,
remote_store_rpc_retries=2,
remote_store_connection_limit=5,
process_execution_local_parallelism=multiprocessing.cpu_count() * 2,
process_execution_local_parallelism=multiprocessing.cpu_count(),
process_execution_remote_parallelism=128,
process_execution_cleanup_local_dirs=True,
process_execution_speculation_delay=1,
Expand Down
1 change: 0 additions & 1 deletion src/rust/engine/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/rust/engine/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ pub struct Core {
pub vfs: PosixFS,
pub watcher: Arc<InvalidationWatcher>,
pub build_root: PathBuf,
pub local_parallelism: usize,
}

#[derive(Clone, Debug)]
Expand Down Expand Up @@ -284,6 +285,7 @@ impl Core {
.map_err(|e| format!("Could not initialize VFS: {:?}", e))?,
build_root,
watcher,
local_parallelism: exec_strategy_opts.local_parallelism,
})
}

Expand Down
5 changes: 4 additions & 1 deletion src/rust/engine/src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ impl Session {
) -> Session {
let workunit_store = WorkunitStore::new(should_render_ui);
let display = if should_render_ui {
Some(Mutex::new(ConsoleUI::new(workunit_store.clone())))
Some(Mutex::new(ConsoleUI::new(
workunit_store.clone(),
scheduler.core.local_parallelism,
)))
} else {
None
};
Expand Down
1 change: 0 additions & 1 deletion src/rust/engine/ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ uuid = { version = "0.7", features = ["v4"] }
logging = { path = "../logging" }
task_executor = { path = "../task_executor" }
workunit_store = { path = "../workunit_store" }
num_cpus = "1"
6 changes: 4 additions & 2 deletions src/rust/engine/ui/src/console_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,16 @@ use workunit_store::WorkunitStore;

pub struct ConsoleUI {
workunit_store: WorkunitStore,
local_parallelism: usize,
// While the UI is running, there will be an Instance present.
instance: Option<Instance>,
}

impl ConsoleUI {
pub fn new(workunit_store: WorkunitStore) -> ConsoleUI {
pub fn new(workunit_store: WorkunitStore, local_parallelism: usize) -> ConsoleUI {
ConsoleUI {
workunit_store,
local_parallelism,
instance: None,
}
}
Expand Down Expand Up @@ -180,7 +182,7 @@ impl ConsoleUI {
}

// Setup bars, and then spawning rendering of the bars into a background task.
let (multi_progress, bars) = Self::setup_bars(num_cpus::get());
let (multi_progress, bars) = Self::setup_bars(self.local_parallelism);
let multi_progress_task = {
executor
.spawn_blocking(move || multi_progress.join())
Expand Down