Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to pass time limit to SLURM, further minor adaptations #64

Merged
merged 2 commits into from
Oct 1, 2024

Conversation

ricardarosemann
Copy link
Contributor

@ricardarosemann ricardarosemann commented Sep 17, 2024

This PR collects some very minor changes:

  • allow to pass a time limit to SLURM. This allows to run BRICK easily when maintenance is scheduled and maybe runs start earlier on non-priority QOS
  • correct yet another error in findLastRun: The function now ignores files when searching for the latest run folder (as long as the file has some sort of file name ending - the criterion is that the time stamp is at the very end of the file/directory name)
  • also receive an email notification from SLURM if a run fails
  • slightly more extensive messaging when restarting and on whether SLURM is used or not.

Closes #54 .

Copy link
Collaborator

@robinhasse robinhasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks very helpful. I have one suggestion but I'm not even sure if it makes things clearer. So feel free to ignore it.

R/findLastRun.R Outdated
@@ -12,7 +12,7 @@ findLastRun <- function(outputFolder) {

if (dir.exists(outputFolder)) {
regexStamp <- "\\d{4}-\\d{2}-\\d{2}_\\d{2}\\.\\d{2}\\.\\d{2}"
paths <- list.files(outputFolder, pattern = regexStamp, all.files = TRUE)
paths <- list.files(outputFolder, pattern = paste0(regexStamp, "$"), all.files = TRUE)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could limit this to directories explicitly, right?

Suggested change
paths <- list.files(outputFolder, pattern = paste0(regexStamp, "$"), all.files = TRUE)
paths <- list.dirs(outputFolder, recursive = FALSE)
paths <- grep(paste0(regexStamp, "$"), paths, value = TRUE)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's actually similar to how you implemented a similar functionality in the old restart-Function. But I do find it clearer, so I will adopt it.

@ricardarosemann ricardarosemann merged commit 5fe6050 into pik-piam:main Oct 1, 2024
2 checks passed
@ricardarosemann ricardarosemann deleted the set-time-limit branch October 1, 2024 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pass time limit of Slurm job
2 participants