Skip to content

Commit

Permalink
Merge pull request #61 from glotzerlab/test-rust-1.83
Browse files Browse the repository at this point in the history
Test with rust 1.83
  • Loading branch information
joaander authored Dec 2, 2024
2 parents 6f4e9e8 + 5fe3ba0 commit 3e2e39b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
workflow_dispatch:

env:
RUST_VERSION: 1.81.0
RUST_VERSION: 1.83.0

jobs:
pre-commit:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
3 changes: 0 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 8 additions & 4 deletions src/scheduler/slurm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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}");
}

Expand All @@ -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}");
}

Expand Down

0 comments on commit 3e2e39b

Please sign in to comment.