Skip to content

Commit

Permalink
Updates after actually runing something
Browse files Browse the repository at this point in the history
  • Loading branch information
richfitz committed Feb 2, 2024
1 parent 7c0e8e9 commit 4c672ba
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
8 changes: 7 additions & 1 deletion drivers/linux/R/manager.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ do_linux_cancel <- function(scheduler_id, config) {


do_linux_submit_pbs <- function(path_batch, id, config, path_root) {
withr::with_dir(path_root, system3("qsub", path_batch, stdout = TRUE))
res <- withr::with_dir(path_root, system3("qsub", path_batch, stdout = TRUE))
if (!res$success) {
output <- paste(res$output, collapse = "\n")
cli::cli_abort(
"Job submission failed with code {res$code} and error: {output}")
}
sub(".pbs$", "", res$output)
}


Expand Down
10 changes: 10 additions & 0 deletions drivers/linux/R/util.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,13 @@ read_lines <- function(...) {
normalize_path <- function(path) {
normalizePath(path, winslash = "/", mustWork = TRUE)
}


system3 <- function(command, args) {
res <- suppressWarnings(system2(command, args, stdout = TRUE, stderr = TRUE))
code <- attr(res, "status") %||% 0
attr(res, "status") <- NULL
list(success = code == 0,
code = code,
output = res)
}
5 changes: 3 additions & 2 deletions drivers/linux/inst/templates/pbs/task_run.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash

#PBS -lwalltime={{walltime}}
#PBS -lselect=1:ncpus={{cores}}:mem={{memory}}gb
#PBS -l walltime={{walltime}}
#PBS -l select=1:ncpus={{cores}}:mem={{memory}}gb
#PBS -N {{task_id}}

### This technically makes this driver dependent on easybuild or
### this module system, and other ways would be possible. However, we
Expand Down

0 comments on commit 4c672ba

Please sign in to comment.