Skip to content

Commit

Permalink
Add a check for file existence
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-Eagles committed Oct 4, 2023
1 parent 6af54c6 commit c8e071d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion R/array_submit.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,17 @@ array_submit <- function(job_bash, task_ids = NULL, submit = FALSE, restore = TR

# Read in the log for the highest array task to grab the job ID (which
# SLURM associates with the entire array)
max_log <- readLines(max_logs[1])
if (file.exists(max_logs[1])) {
max_log <- readLines(max_logs[1])
} else {
stop(
paste(
"Could not find the log from the original array job.",
err_string,
sep = "\\n"
)
)
}
orig_job_id <- max_log[grep("^Job id: ", max_log)] |>
str_extract("[0-9]+")

Expand Down

0 comments on commit c8e071d

Please sign in to comment.