diff --git a/.buildlibrary b/.buildlibrary index fc5fe90..2dc9f75 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '4271190' +ValidationKey: '4291920' AcceptedWarnings: - 'Warning: package ''.*'' was built under R version' - 'Warning: namespace ''.*'' is not available and has been replaced' diff --git a/CITATION.cff b/CITATION.cff index d5ed0b3..05ccd31 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -2,8 +2,8 @@ cff-version: 1.2.0 message: If you use this software, please cite it using the metadata from this file. type: software title: 'modelstats: Run Analysis Tools' -version: 0.21.5 -date-released: '2024-05-23' +version: 0.21.6 +date-released: '2024-05-27' abstract: A collection of tools to analyze model runs. authors: - family-names: Giannousakis diff --git a/DESCRIPTION b/DESCRIPTION index 4f5da2d..2946458 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: modelstats Type: Package Title: Run Analysis Tools -Version: 0.21.5 -Date: 2024-05-23 +Version: 0.21.6 +Date: 2024-05-27 Authors@R: c( person("Anastasis", "Giannousakis", email = "giannou@pik-potsdam.de", role = c("aut","cre")), person("Oliver", "Richters", role = "aut") diff --git a/R/modeltests.R b/R/modeltests.R index 86fcbdf..8f63428 100644 --- a/R/modeltests.R +++ b/R/modeltests.R @@ -187,13 +187,20 @@ evaluateRuns <- function(model, mydir, gitPath, compScen, email, mattermostToken # wait for all AMT runs to finish if (!test) { message(format(Sys.time(), "%Y-%m-%d %H:%M:%S"), " - waiting for all AMT runs to finish.") + errCount <- 0 repeat { - jobsInSlurm <- system(paste0("/p/system/slurm/bin/squeue -u ", user, - " -h -o '%i %q %T %C %M %j %V %L %e %Z'"), intern = TRUE) - if (!any(grepl(mydir, jobsInSlurm))) { - Sys.sleep(600) + jobsInSlurm <- system(paste0("/p/system/slurm/bin/squeue -u ", user, " -alklksjdf -h -o '%i %q %T %C %M %j %V %L %e %Z'"), intern = TRUE) + if (isTRUE(attributes(jobsInSlurm)$status > 0)) { + # count how often squeue fails + errCount <- errCount + 1 + if (errCount > 3) stop("squeue had exit status > 0 more than 3 times in a row.") + } else if (!any(grepl(mydir, jobsInSlurm))) { break + } else { + # reset if squeue was successful + errCount <- 0 } + Sys.sleep(600) } message(format(Sys.time(), "%Y-%m-%d %H:%M:%S"), " - all AMT runs finished.") } diff --git a/README.md b/README.md index be20b0a..e5c4218 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Run Analysis Tools -R package **modelstats**, version **0.21.5** +R package **modelstats**, version **0.21.6** [![CRAN status](https://www.r-pkg.org/badges/version/modelstats)](https://cran.r-project.org/package=modelstats) [![R build status](https://github.com/pik-piam/modelstats/workflows/check/badge.svg)](https://github.com/pik-piam/modelstats/actions) [![codecov](https://codecov.io/gh/pik-piam/modelstats/branch/master/graph/badge.svg)](https://app.codecov.io/gh/pik-piam/modelstats) [![r-universe](https://pik-piam.r-universe.dev/badges/modelstats)](https://pik-piam.r-universe.dev/builds) @@ -47,7 +47,7 @@ In case of questions / problems please contact Anastasis Giannousakis . +Giannousakis A, Richters O (2024). _modelstats: Run Analysis Tools_. R package version 0.21.6, . A BibTeX entry for LaTeX users is @@ -56,7 +56,7 @@ A BibTeX entry for LaTeX users is title = {modelstats: Run Analysis Tools}, author = {Anastasis Giannousakis and Oliver Richters}, year = {2024}, - note = {R package version 0.21.5}, + note = {R package version 0.21.6}, url = {https://github.com/pik-piam/modelstats}, } ```