Skip to content

Commit

Permalink
limit concurrent_task to executor_cores
Browse files Browse the repository at this point in the history
  • Loading branch information
milenkovicm committed Nov 26, 2024
1 parent 74ca8dd commit 6e0407b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 0 additions & 1 deletion ballista/executor/executor_config_spec.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ doc = "Directory for temporary IPC files"
abbr = "c"
name = "concurrent_tasks"
type = "usize"
default = "0" # defaults to all available cores if left as zero
doc = "Max concurrent tasks."

[[param]]
Expand Down
7 changes: 6 additions & 1 deletion ballista/executor/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ impl TryFrom<Config> for ExecutorProcessConfig {
opt.bind_port
);

let concurrent_tasks = opt
.concurrent_tasks
.or(opt.executor_cores)
.unwrap_or_else(|| std::thread::available_parallelism().unwrap().get());

Ok(ExecutorProcessConfig {
special_mod_log_level: opt.log_level_setting,
external_host: opt.external_host,
Expand All @@ -44,7 +49,7 @@ impl TryFrom<Config> for ExecutorProcessConfig {
scheduler_host: opt.scheduler_host,
scheduler_port: opt.scheduler_port,
scheduler_connect_timeout_seconds: opt.scheduler_connect_timeout_seconds,
concurrent_tasks: opt.concurrent_tasks,
concurrent_tasks,
task_scheduling_policy: opt.task_scheduling_policy,
work_dir: opt.work_dir,
log_dir: opt.log_dir,
Expand Down

0 comments on commit 6e0407b

Please sign in to comment.