diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml index c0d67a7..b3ff01d 100644 --- a/.github/workflows/pre-commit.yaml +++ b/.github/workflows/pre-commit.yaml @@ -13,7 +13,7 @@ on: workflow_dispatch: env: - RUST_VERSION: 1.81.0 + RUST_VERSION: 1.83.0 jobs: pre-commit: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2166475..1617cb0 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -26,7 +26,7 @@ env: name: row CARGO_TERM_COLOR: always CLICOLOR: 1 - RUST_VERSION: 1.81.0 + RUST_VERSION: 1.83.0 jobs: source: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 45fcae4..6ae3350 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -20,7 +20,7 @@ env: CARGO_TERM_COLOR: always ROW_COLOR: always CLICOLOR: 1 - RUST_LATEST_VERSION: 1.81.0 + RUST_LATEST_VERSION: 1.83.0 jobs: unit_test: @@ -34,14 +34,14 @@ jobs: rust: # Oldest supported version of rust - 1.77.2 - - 1.81.0 + - 1.83.0 mode: - debug include: # Add a release build on linux with the latest version of rust - os: ubuntu-22.04 - rust: 1.81.0 + rust: 1.83.0 mode: release steps: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 242a745..ffda01c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,9 +5,6 @@ ci: # rust does not work on pre-commit.ci skip: [fmt, check, clippy] -default_language_version: - rust: 1.81.0 - repos: - repo: https://github.com/backplane/pre-commit-rust-hooks rev: v1.1.0 diff --git a/src/cluster.rs b/src/cluster.rs index d8a1517..4c27be0 100644 --- a/src/cluster.rs +++ b/src/cluster.rs @@ -267,7 +267,7 @@ impl Cluster { self.partition .iter() .find(|p| p.matches(resources, n_directories, &mut reason)) - .ok_or_else(|| Error::PartitionNotFound(reason))? + .ok_or(Error::PartitionNotFound(reason))? }; Ok(partition) diff --git a/src/scheduler/slurm.rs b/src/scheduler/slurm.rs index c80127c..446c64a 100644 --- a/src/scheduler/slurm.rs +++ b/src/scheduler/slurm.rs @@ -94,8 +94,10 @@ impl Scheduler for Slurm { let _ = writeln!(preamble, "#SBATCH --gpus-per-task={gpus_per_process}"); if let Some(ref gpus_per_node) = partition.gpus_per_node { - let n_nodes = (action.resources.total_gpus(directories.len()) + gpus_per_node - 1) - / gpus_per_node; + let n_nodes = action + .resources + .total_gpus(directories.len()) + .div_ceil(*gpus_per_node); let _ = writeln!(preamble, "#SBATCH --nodes={n_nodes}"); } @@ -104,8 +106,10 @@ impl Scheduler for Slurm { } } else { if let Some(ref cpus_per_node) = partition.cpus_per_node { - let n_nodes = (action.resources.total_cpus(directories.len()) + cpus_per_node - 1) - / cpus_per_node; + let n_nodes = action + .resources + .total_cpus(directories.len()) + .div_ceil(*cpus_per_node); let _ = writeln!(preamble, "#SBATCH --nodes={n_nodes}"); }