Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions clients/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,

/// 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 {
Expand Down Expand Up @@ -177,6 +181,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
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 {
Expand All @@ -196,6 +201,7 @@ async fn main() -> Result<(), Box<dyn Error>> {
with_background,
max_tasks,
max_difficulty,
ignore_memory_requirement,
)
.await
}
Expand Down Expand Up @@ -252,6 +258,7 @@ async fn start(
with_background: bool,
max_tasks: Option<u32>,
max_difficulty: Option<String>,
ignore_memory_requirement: bool,
) -> Result<(), Box<dyn Error>> {
// 1. Version checking (will internally perform country detection without race)
validate_version_requirements().await?;
Expand Down Expand Up @@ -287,6 +294,7 @@ async fn start(
max_threads,
max_tasks,
max_difficulty_parsed,
ignore_memory_requirement,
)
.await?;

Expand Down
5 changes: 3 additions & 2 deletions clients/cli/src/session/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ pub async fn setup_session(
max_threads: Option<u32>,
max_tasks: Option<u32>,
max_difficulty: Option<crate::nexus_orchestrator::TaskDifficulty>,
ignore_memory_requirement: bool,
) -> Result<SessionData, Box<dyn Error>> {
let node_id = config.node_id.parse::<u64>()?;
let client_id = config.user_id;
Expand All @@ -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!(
Expand All @@ -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));
}

Expand Down