"core/git@gitlab.pik-potsdam.de:hilaire/remind.git" did not exist on "e28e7a96da5d8dad1a7d1b3f0646797aeb65d1d4"
Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#######################################################################
############### Select slurm partitiion ###############################
#######################################################################
get_line <- function(){
# gets characters (line) from the terminal or from a connection
# and returns it
if(interactive()){
s <- readline()
} else {
con <- file("stdin")
s <- readLines(con, 1, warn=FALSE)
on.exit(close(con))
}
return(s);
}
choose_slurmConfig <- function() {
slurm <- suppressWarnings(ifelse(system2("srun",stdout=FALSE,stderr=FALSE) != 127, TRUE, FALSE))
if (slurm) {
modes <- c(" SLURM standby ",
" SLURM priority"
)
cat("\nCurrent cluster utilization:\n")
system("sclass")
cat("\n")
cat("\nPlease choose run submission type:\n")
cat(paste(1:length(modes), modes, sep=": " ),sep="\n")
cat("Number: ")
identifier <- get_line()
identifier <- as.numeric(strsplit(identifier,",")[[1]])
comp <- switch(identifier,
"1" = "--qos=standby --nodes=1 --tasks-per-node=1" ,
"2" = "--qos=priority --nodes=1 --tasks-per-node=1" )
if(is.null(comp)) stop("This type is invalid. Please choose a valid type")
} else {
comp <- "direct"
}
return(comp)
}