diff --git a/clients/cli/src/main.rs b/clients/cli/src/main.rs index 1a99287f..3dfb5c33 100644 --- a/clients/cli/src/main.rs +++ b/clients/cli/src/main.rs @@ -127,6 +127,10 @@ enum Command { /// Override max difficulty to request. Auto-promotion occurs when tasks complete in < 7 min #[arg(long = "max-difficulty", value_name = "DIFFICULTY")] max_difficulty: Option, + + /// Ignore memory requirements per thread (allows running more threads than recommended) + #[arg(long = "ignore-memory-requirement", default_value_t = false)] + ignore_memory_requirement: bool, }, /// Register a new user RegisterUser { @@ -177,6 +181,7 @@ async fn main() -> Result<(), Box> { with_background, max_tasks, max_difficulty, + ignore_memory_requirement, } => { // If a custom orchestrator URL is provided, create a custom environment let final_environment = if let Some(url) = orchestrator_url { @@ -196,6 +201,7 @@ async fn main() -> Result<(), Box> { with_background, max_tasks, max_difficulty, + ignore_memory_requirement, ) .await } @@ -252,6 +258,7 @@ async fn start( with_background: bool, max_tasks: Option, max_difficulty: Option, + ignore_memory_requirement: bool, ) -> Result<(), Box> { // 1. Version checking (will internally perform country detection without race) validate_version_requirements().await?; @@ -287,6 +294,7 @@ async fn start( max_threads, max_tasks, max_difficulty_parsed, + ignore_memory_requirement, ) .await?; diff --git a/clients/cli/src/session/setup.rs b/clients/cli/src/session/setup.rs index e2817d46..d76ac855 100644 --- a/clients/cli/src/session/setup.rs +++ b/clients/cli/src/session/setup.rs @@ -101,6 +101,7 @@ pub async fn setup_session( max_threads: Option, max_tasks: Option, max_difficulty: Option, + ignore_memory_requirement: bool, ) -> Result> { let node_id = config.node_id.parse::()?; let client_id = config.user_id; @@ -118,7 +119,7 @@ pub async fn setup_session( let mut num_workers: usize = max_threads.unwrap_or(1).clamp(1, max_workers as u32) as usize; // Check memory and clamp threads if max-threads was explicitly set OR check-memory flag is set - if max_threads.is_some() || check_mem { + if !ignore_memory_requirement && (max_threads.is_some() || check_mem) { let memory_clamped_workers = clamp_threads_by_memory(num_workers); if memory_clamped_workers < num_workers { crate::print_cmd_warn!( @@ -132,7 +133,7 @@ pub async fn setup_session( } // Additional memory warning if explicitly requested - if check_mem { + if check_mem && !ignore_memory_requirement { warn_memory_configuration(Some(num_workers as u32)); }