Skip to content

Commit

Permalink
Handle custom sbatch output
Browse files Browse the repository at this point in the history
  • Loading branch information
Kobzol committed Feb 2, 2024
1 parent 26b0f45 commit f1b6113
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions crates/hyperqueue/src/server/autoalloc/queue/slurm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,14 @@ impl QueueHandler for SlurmHandler {
&worker_args,
);
let id = submit_script(script, "sbatch", &working_dir, |output| {
log::debug!("Sbatch output: {output}");
output
.split(' ')
.nth(3)
.ok_or_else(|| anyhow::anyhow!("Missing job id in sbatch output"))
.map(|id| id.to_string())
.lines()
.map(|l| l.trim())
.find(|l| l.to_lowercase().starts_with("submitted batch job"))
.and_then(|l| l.split(' ').nth(3))
.map(|l| l.to_string())
.ok_or_else(|| anyhow::anyhow!("Missing job id in sbatch output\n{output}"))
})
.await;

Expand Down

0 comments on commit f1b6113

Please sign in to comment.