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

Use Habrok, no longer Peregrine #32

Merged
merged 6 commits into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"orcid": "0000-0003-2561-4677",
"affiliation": "University of Groningen",
"name": "Neves, Pedro"
"name": "Santos Neves, Pedro"
},
{
"orcid": "0000-0001-5218-3046",
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: DAISIEutils
Title: Utility Functions for the DAISIE Package
Date: 2023-05-03
Version: 1.6.0
Version: 1.6.0.9000
Authors@R: c(
person(given = "Pedro",
family = "Santos Neves",
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# DAISIEutils (development version)

* Migrate from now defunct Peregrine HPCC to the new Hábrók HPCC

# DAISIEutils 1.6.0

* The version of R and DAISIE are incremented to 4.2 and 4.4.0, respectively
Expand Down
2 changes: 1 addition & 1 deletion R/create_output_folder.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#'
#' @return
#' Creates appropriate directory. Returns string with path for output object. By
#' default, if on Peregrine, folder will be `$HOME/results/$data_name`. If
#' default, if on Hábrók, folder will be `$HOME/results/$data_name`. If
#' called from another environment, folder will be
#' `getwd()/results/$data_name`. Alternatively, another valid root can be
#' specified, resulting in `results_dir/$data_name`.
Expand Down
6 changes: 3 additions & 3 deletions R/is_on_cluster.R
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#' Check if code is running on Peregrine HPCC
#' Check if code is running on Hábrók HPCC
#'
#' @return Boolean. `TRUE` if called from Peregrine HPCC, FALSE if not.
#' @return Boolean. `TRUE` if called from Hábrók HPCC, FALSE if not.
#' @export
#'
#' @examples
#' on_cluster <- is_on_cluster()
#'
#' @author Pedro Santos Neves
is_on_cluster <- function() {
if (identical(Sys.getenv("HOSTNAME"), "peregrine.hpc.rug.nl")) {
if (identical(Sys.getenv("SLURM_CLUSTER_NAME"), "habrok")) {
return(TRUE)
} else {
return(FALSE)
Expand Down
2 changes: 1 addition & 1 deletion man/create_output_folder.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/is_on_cluster.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions tests/testthat/test-is_on_cluster.R
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
test_that("use", {
# If HOSTNAME
if (identical(Sys.getenv("HOSTNAME"), "peregrine.hpc.rug.nl")) {
if (identical(Sys.getenv("SLURM_CLUSTER_NAME"), "habrok")) {
expect_true(is_on_cluster())

Sys.unsetenv("HOSTNAME")
Sys.unsetenv("SLURM_CLUSTER_NAME")
expect_false(is_on_cluster())
Sys.setenv(HOSTNAME = "peregrine.hpc.rug.nl")
identical(Sys.getenv("SLURM_CLUSTER_NAME"), "habrok")
} else {
stored_hostname <- Sys.getenv("HOSTNAME")
stored_cluster_name <- Sys.getenv("SLURM_CLUSTER_NAME")
expect_false(is_on_cluster())

Sys.setenv(HOSTNAME = "peregrine.hpc.rug.nl")
Sys.setenv(SLURM_CLUSTER_NAME = "habrok")
expect_true(is_on_cluster())
Sys.setenv(HOSTNAME = stored_hostname)
Sys.setenv(SLURM_CLUSTER_NAME = stored_cluster_name)
}
})