Last updated on 2024-03-27 19:56:59 CET.
Flavor | Version | Tinstall | Tcheck | Ttotal | Status | Flags |
---|---|---|---|---|---|---|
r-devel-linux-x86_64-debian-clang | 1.37.1 | 7.41 | 60.85 | 68.26 | OK | |
r-devel-linux-x86_64-debian-gcc | 1.37.1 | 5.13 | 44.76 | 49.89 | OK | |
r-devel-linux-x86_64-fedora-clang | 1.37.1 | 81.94 | OK | |||
r-devel-linux-x86_64-fedora-gcc | 1.37.1 | 81.72 | OK | |||
r-devel-windows-x86_64 | 1.37.1 | 11.00 | 1205.00 | 1216.00 | ERROR | |
r-patched-linux-x86_64 | 1.37.1 | 7.61 | 58.46 | 66.07 | OK | |
r-release-linux-x86_64 | 1.37.1 | 7.25 | 58.73 | 65.98 | OK | |
r-release-macos-arm64 | 1.37.1 | 44.00 | OK | |||
r-release-macos-x86_64 | 1.37.1 | 90.00 | OK | |||
r-release-windows-x86_64 | 1.37.1 | 16.00 | 120.00 | 136.00 | OK | |
r-oldrel-macos-arm64 | 1.37.1 | 44.00 | OK | |||
r-oldrel-windows-x86_64 | 1.37.1 | 14.00 | 117.00 | 131.00 | OK |
Version: 1.37.1
Check: tests
Result: ERROR
Running 'as.cluster.R' [2s]
Running 'availableCores.R' [0s]
Running 'availableWorkers.R' [168s]
Running 'cgroups.R' [164s]
Running 'cpuLoad.R' [0s]
Running 'freeCores.R' [154s]
Running 'freePort.R' [0s]
Running 'isConnectionValid.R' [0s]
Running 'isForkedChild.R' [168s]
Running 'killNode.R' [17s]
Running 'makeClusterMPI.R' [155s]
Running 'makeClusterPSOCK.R' [19s]
Running 'options-and-envvars.R' [149s]
Running 'r_bug18119.R' [144s]
Running 'startup.R' [1s]
Running 'utils.R' [3s]
Running the tests in 'tests/availableWorkers.R' failed.
Complete output:
> source("incl/start.R")
>
> message("*** availableWorkers() ...")
*** availableWorkers() ...
>
> ## The default
> w <- availableWorkers()
> print(w)
[1] "localhost" "localhost"
> stopifnot(is.character(w), length(w) >= 1)
>
> ## Minimium of all known settings (default)
> print(availableWorkers(which = "min"))
[1] "localhost"
>
> ## Maximum of all known settings (should never be used)
> print(availableWorkers(which = "max"))
[1] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[7] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[13] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[19] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[25] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[31] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[37] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[43] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[49] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[55] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[61] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[67] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[73] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[79] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[85] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[91] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
>
> ## All known settings
> print(availableWorkers(na.rm = FALSE, which = "all"))
$mc.cores
[1] "localhost" "localhost"
$BiocParallel
character(0)
$`_R_CHECK_LIMIT_CORES_`
[1] "localhost" "localhost"
$Bioconductor
character(0)
$LSF
character(0)
$PJM
character(0)
$PBS
character(0)
$SGE
character(0)
$Slurm
character(0)
$custom
character(0)
$cgroups.cpuset
character(0)
$cgroups.cpuquota
character(0)
$cgroups2.cpu.max
character(0)
$nproc
character(0)
$system
[1] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[7] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[13] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[19] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[25] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[31] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[37] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[43] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[49] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[55] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[61] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[67] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[73] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[79] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[85] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[91] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
$fallback
character(0)
>
> ## System settings
> w <- availableWorkers(methods = "system")
> print(w)
[1] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[7] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[13] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[19] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[25] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[31] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[37] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[43] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[49] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[55] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[61] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[67] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[73] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[79] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[85] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
[91] "localhost" "localhost" "localhost" "localhost" "localhost" "localhost"
> stopifnot(is.character(w), length(w) >= 1)
>
> ## Predefined ones for known cluster schedulers
> print(availableWorkers(methods = "PBS"))
[1] "localhost"
> print(availableWorkers(methods = "SGE"))
[1] "localhost"
> print(availableWorkers(methods = "Slurm"))
[1] "localhost"
> print(availableWorkers(methods = "LSF"))
[1] "localhost"
> print(availableWorkers(methods = "PJM"))
[1] "localhost"
>
>
> message("*** HPC related ...")
*** HPC related ...
>
> sge_expand_node_count_pairs <- parallelly:::sge_expand_node_count_pairs
> read_pbs_nodefile <- parallelly:::read_pbs_nodefile
> read_pjm_nodefile <- parallelly:::read_pjm_nodefile
> read_pe_hostfile <- parallelly:::read_pe_hostfile
>
> workers0 <- c("n1", "n2", "n3", "n1", "n6", "n3", "n3", "n5")
> data0 <- as.data.frame(table(workers0), stringsAsFactors = FALSE)
> colnames(data0) <- c("node", "count")
> data0 <- data0[order(data0$node, data0$count), ]
>
>
> message("*** LSF ...")
*** LSF ...
>
> Sys.setenv(LSB_HOSTS = paste(workers0, collapse = " "))
> workers <- availableWorkers(methods = "LSF")
> print(workers)
[1] "n1" "n2" "n3" "n1" "n6" "n3" "n3" "n5"
> stopifnot(length(workers) == length(workers0))
>
> message("*** LSF ... done")
*** LSF ... done
>
>
>
> message("*** read_pbs_nodefile() ...")
*** read_pbs_nodefile() ...
>
> workers <- workers0
> pathname <- tempfile()
> writeLines(workers, con = pathname)
>
> data <- read_pbs_nodefile(pathname)
> str(data)
'data.frame': 8 obs. of 1 variable:
$ node: chr "n1" "n1" "n2" "n3" ...
> stopifnot(
+ c("node") %in% colnames(data),
+ is.character(data$node),
+ !anyNA(data$node),
+ nrow(data$node) == length(workers),
+ all(sort(data$node) == sort(workers))
+ )
>
> Sys.setenv(PBS_NODEFILE = pathname)
> Sys.setenv(PBS_NP = length(workers),
+ PBS_NUM_NODES = length(workers) / 2,
+ PBS_NUM_PPN = 2)
> workers <- availableWorkers(methods = "PBS")
> print(workers)
[1] "n1" "n1" "n2" "n3" "n3" "n3" "n5" "n6"
> stopifnot(length(workers) == length(workers0), all(workers == sort(workers0)))
>
> Sys.setenv(PBS_NUM_PPN = 3)
> res <- tryCatch({
+ workers <- availableWorkers(methods = "PBS")
+ }, warning = identity)
> stopifnot(inherits(res, "warning"))
>
> Sys.setenv(PBS_NP = length(workers) + 1)
> res <- tryCatch({
+ workers <- availableWorkers(methods = "PBS")
+ }, warning = identity)
> stopifnot(inherits(res, "warning"))
>
> ## Exceptions
> workersE <- c(workers, "n 3")
> pathname <- tempfile()
> writeLines(workersE, con = pathname)
> res <- tryCatch(read_pbs_nodefile(pathname), error = identity)
> print(res)
<simpleError: '!any(grepl("[[:space:]]", lines))' is not TRUE>
> stopifnot(inherits(res, "error"))
>
> Sys.setenv(PBS_NODEFILE = "<non-existing-file>")
> res <- tryCatch({
+ workers <- availableWorkers(methods = "PBS")
+ }, warning = identity)
> stopifnot(inherits(res, "warning"))
>
> message("*** read_pbs_nodefile() ... DONE")
*** read_pbs_nodefile() ... DONE
>
>
>
>
> message("*** read_pjm_nodefile() ...")
*** read_pjm_nodefile() ...
>
> workersT <- unique(workers0)
> pathname <- tempfile()
> writeLines(workersT, con = pathname)
>
> data <- read_pjm_nodefile(pathname)
> str(data)
'data.frame': 5 obs. of 1 variable:
$ node: chr "n1" "n2" "n3" "n5" ...
> stopifnot(
+ c("node") %in% colnames(data),
+ is.character(data$node),
+ !anyNA(data$node),
+ nrow(data$node) == length(workersT),
+ all(sort(data$node) == sort(workersT)),
+ identical(data$node, unique(data$node))
+ )
>
> Sys.setenv(PJM_O_NODEINF = pathname)
>
> message("- PJM_VNODE_CORE=1")
- PJM_VNODE_CORE=1
> Sys.setenv(PJM_VNODE_CORE = "1")
> workers <- availableWorkers(methods = "PJM")
> print(workers)
[1] "n1" "n2" "n3" "n6" "n5"
> stopifnot(
+ length(workers) == length(workersT),
+ all(sort(workers) == sort(workersT))
+ )
>
> message("- PJM_VNODE=", length(workersT))
- PJM_VNODE=5
> message("- PJM_VNODE_CORE=2")
- PJM_VNODE_CORE=2
> Sys.setenv(PJM_VNODE = length(workersT))
> Sys.setenv(PJM_VNODE_CORE = "2")
> workers <- availableWorkers(methods = "PJM")
> print(workers)
[1] "n1" "n1" "n2" "n2" "n3" "n3" "n6" "n6" "n5" "n5"
> stopifnot(
+ length(workers) == 2L * length(workersT),
+ all(workers %in% workersT),
+ all(workersT %in% workers)
+ )
>
>
> message("- PJM_VNODE=1 (incompatible => warning)")
- PJM_VNODE=1 (incompatible => warning)
> message("- PJM_VNODE_CORE=2")
- PJM_VNODE_CORE=2
> Sys.setenv(PJM_VNODE = "1")
> Sys.setenv(PJM_VNODE_CORE = "2")
> workers <- availableWorkers(methods = "PJM")
Warning: Environment variable 'PJM_VNODE' does not agree with the number of hosts in file 'PJM_O_NODEINF': 1 != 5
> print(workers)
[1] "n1" "n1" "n2" "n2" "n3" "n3" "n6" "n6" "n5" "n5"
> stopifnot(
+ length(workers) == 2L * length(workersT),
+ all(workers %in% workersT),
+ all(workersT %in% workers)
+ )
>
>
> message("- PJM_O_NODEINF = <non-existing-file>")
- PJM_O_NODEINF = <non-existing-file>
> Sys.setenv(PJM_O_NODEINF = "<non-existing-file>")
> res <- tryCatch({
+ workers <- availableWorkers(methods = "PJM")
+ }, warning = identity)
> stopifnot(inherits(res, "warning"))
>
> message("*** read_pjm_nodefile() ... DONE")
*** read_pjm_nodefile() ... DONE
>
>
>
> message("*** read_pe_hostfile() ...")
*** read_pe_hostfile() ...
>
> workers <- workers0
> pathname <- tempfile()
> write.table(data0, file = pathname, quote = FALSE, row.names = FALSE, col.names = FALSE)
> lines <- readLines(pathname)
> print(lines)
[1] "n1 2" "n2 1" "n3 3" "n5 1" "n6 1"
> data <- read_pe_hostfile(pathname, expand = FALSE)
> print(data)
node count
1 n1 2
2 n2 1
3 n3 3
4 n5 1
5 n6 1
> stopifnot(
+ is.character(data$node),
+ !anyNA(data$node),
+ is.integer(data$count),
+ !anyNA(data$count),
+ all(is.finite(data$count)),
+ all(data$count > 0),
+ nrow(data) == nrow(data0),
+ all.equal(data[, c("node", "count")], data0[, c("node", "count")])
+ )
>
> workers <- sge_expand_node_count_pairs(data)
> stopifnot(length(workers) == length(workers0), all(workers == sort(workers0)))
>
> Sys.setenv(PE_HOSTFILE = pathname)
> Sys.setenv(NSLOTS = length(workers0)) ## Use to validate results
> workers <- availableWorkers(methods = "SGE")
Warning: Identified 8 workers from the 'PE_HOSTFILE' file ('D:\temp\RtmpMtNZ8f\file257e43ddc6626'), which is more than environment variable 'NSLOTS' = 8
> print(workers)
[1] "n1" "n1" "n2" "n3" "n3" "n3" "n5" "n6"
> stopifnot(length(workers) == length(workers0), all(workers == sort(workers0)))
>
> ## Test validation
> Sys.setenv(NSLOTS = length(workers0) + 1L)
> workers <- tryCatch(availableWorkers(methods = "SGE"), warning = identity)
> print(workers)
<simpleWarning: Identified 8 workers from the 'PE_HOSTFILE' file ('D:\temp\RtmpMtNZ8f\file257e43ddc6626'), which is more than environment variable 'NSLOTS' = 9>
> stopifnot(inherits(workers, "warning"))
>
> Sys.setenv(PE_HOSTFILE = "<non-existing-file>")
> res <- tryCatch({
+ workers <- availableWorkers(methods = "SGE")
+ }, warning = identity)
> stopifnot(inherits(res, "warning"))
>
> message("*** read_pe_hostfile() ... DONE")
*** read_pe_hostfile() ... DONE
>
>
> message("*** Slurm w/ SLURM_JOB_NODELIST ...")
*** Slurm w/ SLURM_JOB_NODELIST ...
>
> slurm_expand_nodelist <- parallelly:::slurm_expand_nodelist
>
> specs <- list(
+ "n1" = c("n1"),
+ " n1" = c("n1"),
+ "n1,, n3" = c("n1", "n3"),
+ "n1, n3" = c("n1", "n3"),
+ "n3 n1" = c("n3", "n1"),
+ "n[1-13]" = sprintf("n%d", c(1:13)),
+ ## scontrol show hostname treats "n[1,3-4, 11-13]" == "n[1,3-4,0011-13]"
+ "n[1,3-4, 11-13]" = c("n1", "n3", "n4", "n0011", "n0012", "n0013"),
+ "a1,b[ 02-04,6-7]" = c("a1", "b00002", "b00003", "b00004", "b6", "b7")
+ )
>
> ## All combined
> all <- list(unlist(specs, use.names = FALSE))
> names(all) <- paste(names(specs), collapse = ",")
> specs <- c(specs, all)
>
> ## Again, all combined but in reverse order
> all <- list(unlist(rev(specs), use.names = FALSE))
> names(all) <- paste(rev(names(specs)), collapse = ",")
> specs <- c(specs, all)
>
> for (kk in seq_along(specs)) {
+ message(sprintf("- Specification #%d of %d", kk, length(specs)))
+ nodelist <- names(specs)[kk]
+ truth <- specs[[kk]]
+ cat(sprintf("nodelist: %s\n", sQuote(nodelist)))
+ expanded <- slurm_expand_nodelist(nodelist, manual = TRUE)
+ cat(sprintf("expanded: c(%s)\n", paste(sQuote(expanded), collapse = ", ")))
+ cat(sprintf("truth: c(%s)\n", paste(sQuote(truth), collapse = ", ")))
+ stopifnot(
+ is.character(expanded),
+ !any(is.na(expanded)),
+ length(expanded) == length(truth),
+ identical(expanded, truth)
+ )
+
+ Sys.unsetenv(c("SLURM_JOB_NODELIST", "SLURM_NODELIST",
+ "SLURM_JOB_CPUS_PER_NODE", "SLURM_TASKS_PER_NODE"))
+
+ ## Test without SLURM_JOB_CPUS_PER_NODE/SLURM_TASKS_PER_NODE
+ Sys.setenv(SLURM_JOB_NODELIST = nodelist)
+ for (name in c("SLURM_JOB_NODELIST", "SLURM_JOB_CPUS_PER_NODE")) {
+ cat(sprintf("%s = %s\n", name, sQuote(Sys.getenv(name))))
+ }
+ workers <- availableWorkers(methods = "Slurm")
+ cat(sprintf("workers: c(%s)\n", paste(sQuote(workers), collapse = ", ")))
+ stopifnot(identical(workers, truth))
+
+
+ ## Test with SLURM_JOB_CPUS_PER_NODE/SLURM_TASKS_PER_NODE
+ nhosts <- length(expanded)
+ ncores_per_host <- sample(1:10, size = nhosts, replace = TRUE)
+
+ ## Handle the case when 'nodelist' result in a non-ordered 'expanded'
+ expanded2 <- as.list(expanded)
+ for (kk in seq_along(expanded2)) {
+ expanded2[[kk]] <- rep(expanded2[[kk]], times = ncores_per_host[kk])
+ }
+ expanded2 <- unlist(expanded2, use.names = FALSE)
+
+ Sys.setenv(SLURM_JOB_NODELIST = nodelist)
+ Sys.setenv(SLURM_JOB_CPUS_PER_NODE = paste(ncores_per_host, collapse = ","))
+
+ for (name in c("SLURM_JOB_NODELIST", "SLURM_JOB_CPUS_PER_NODE")) {
+ cat(sprintf("%s = %s\n", name, sQuote(Sys.getenv(name))))
+ }
+ workers <- availableWorkers(methods = "Slurm")
+ cat(sprintf("workers: c(%s)\n", paste(sQuote(workers), collapse = ", ")))
+ stopifnot(identical(unique(workers), unique(truth)))
+ counts <- table(workers)
+ counts <- counts[unique(workers)]
+ print(counts)
+ counts2 <- table(expanded2)
+ counts2 <- counts2[unique(expanded2)]
+ print(counts2)
+ stopifnot(
+ sum(counts) == sum(ncores_per_host),
+ sum(counts) == sum(counts2),
+ all(counts == counts2)
+ )
+
+ Sys.unsetenv(c("SLURM_JOB_NODELIST", "SLURM_JOB_CPUS_PER_NODE"))
+ }
- Specification #1 of 10
nodelist: 'n1'
expanded: c('n1')
truth: c('n1')
SLURM_JOB_NODELIST = 'n1'
SLURM_JOB_CPUS_PER_NODE = ''
Warning in availableWorkers(methods = "Slurm") :
Expected either environment variable 'SLURM_JOB_CPUS_PER_NODE' or 'SLURM_TASKS_PER_NODE' to be set. Will assume one core per node.
workers: c('n1')
SLURM_JOB_NODELIST = 'n1'
SLURM_JOB_CPUS_PER_NODE = '2'
workers: c('n1', 'n1')
n1
2
n1
2
- Specification #2 of 10
nodelist: ' n1'
expanded: c('n1')
truth: c('n1')
SLURM_JOB_NODELIST = ' n1'
SLURM_JOB_CPUS_PER_NODE = ''
Warning in availableWorkers(methods = "Slurm") :
Expected either environment variable 'SLURM_JOB_CPUS_PER_NODE' or 'SLURM_TASKS_PER_NODE' to be set. Will assume one core per node.
workers: c('n1')
SLURM_JOB_NODELIST = ' n1'
SLURM_JOB_CPUS_PER_NODE = '1'
workers: c('n1')
n1
1
n1
1
- Specification #3 of 10
nodelist: 'n1,, n3'
expanded: c('n1', 'n3')
truth: c('n1', 'n3')
SLURM_JOB_NODELIST = 'n1,, n3'
SLURM_JOB_CPUS_PER_NODE = ''
Warning in availableWorkers(methods = "Slurm") :
Expected either environment variable 'SLURM_JOB_CPUS_PER_NODE' or 'SLURM_TASKS_PER_NODE' to be set. Will assume one core per node.
workers: c('n1', 'n3')
SLURM_JOB_NODELIST = 'n1,, n3'
SLURM_JOB_CPUS_PER_NODE = '4,8'
workers: c('n1', 'n1', 'n1', 'n1', 'n3', 'n3', 'n3', 'n3', 'n3', 'n3', 'n3', 'n3')
workers
n1 n3
4 8
expanded2
n1 n3
4 8
- Specification #4 of 10
nodelist: 'n1, n3'
expanded: c('n1', 'n3')
truth: c('n1', 'n3')
SLURM_JOB_NODELIST = 'n1, n3'
SLURM_JOB_CPUS_PER_NODE = ''
Warning in availableWorkers(methods = "Slurm") :
Expected either environment variable 'SLURM_JOB_CPUS_PER_NODE' or 'SLURM_TASKS_PER_NODE' to be set. Will assume one core per node.
workers: c('n1', 'n3')
SLURM_JOB_NODELIST = 'n1, n3'
SLURM_JOB_CPUS_PER_NODE = '4,3'
workers: c('n1', 'n1', 'n1', 'n1', 'n3', 'n3', 'n3')
workers
n1 n3
4 3
expanded2
n1 n3
4 3
- Specification #5 of 10
nodelist: 'n3 n1'
expanded: c('n3', 'n1')
truth: c('n3', 'n1')
SLURM_JOB_NODELIST = 'n3 n1'
SLURM_JOB_CPUS_PER_NODE = ''
Warning in availableWorkers(methods = "Slurm") :
Expected either environment variable 'SLURM_JOB_CPUS_PER_NODE' or 'SLURM_TASKS_PER_NODE' to be set. Will assume one core per node.
workers: c('n3', 'n1')
SLURM_JOB_NODELIST = 'n3 n1'
SLURM_JOB_CPUS_PER_NODE = '9,8'
workers: c('n3', 'n3', 'n3', 'n3', 'n3', 'n3', 'n3', 'n3', 'n3', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1')
workers
n3 n1
9 8
expanded2
n3 n1
9 8
- Specification #6 of 10
nodelist: 'n[1-13]'
expanded: c('n1', 'n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'n8', 'n9', 'n10', 'n11', 'n12', 'n13')
truth: c('n1', 'n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'n8', 'n9', 'n10', 'n11', 'n12', 'n13')
SLURM_JOB_NODELIST = 'n[1-13]'
SLURM_JOB_CPUS_PER_NODE = ''
Warning in availableWorkers(methods = "Slurm") :
Expected either environment variable 'SLURM_JOB_CPUS_PER_NODE' or 'SLURM_TASKS_PER_NODE' to be set. Will assume one core per node.
workers: c('n1', 'n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'n8', 'n9', 'n10', 'n11', 'n12', 'n13')
SLURM_JOB_NODELIST = 'n[1-13]'
SLURM_JOB_CPUS_PER_NODE = '4,2,1,4,2,4,9,6,1,1,8,7,2'
workers: c('n1', 'n1', 'n1', 'n1', 'n2', 'n2', 'n3', 'n4', 'n4', 'n4', 'n4', 'n5', 'n5', 'n6', 'n6', 'n6', 'n6', 'n7', 'n7', 'n7', 'n7', 'n7', 'n7', 'n7', 'n7', 'n7', 'n8', 'n8', 'n8', 'n8', 'n8', 'n8', 'n9', 'n10', 'n11', 'n11', 'n11', 'n11', 'n11', 'n11', 'n11', 'n11', 'n12', 'n12', 'n12', 'n12', 'n12', 'n12', 'n12', 'n13', 'n13')
workers
n1 n2 n3 n4 n5 n6 n7 n8 n9 n10 n11 n12 n13
4 2 1 4 2 4 9 6 1 1 8 7 2
expanded2
n1 n2 n3 n4 n5 n6 n7 n8 n9 n10 n11 n12 n13
4 2 1 4 2 4 9 6 1 1 8 7 2
- Specification #7 of 10
nodelist: 'n[1,3-4, 11-13]'
expanded: c('n1', 'n3', 'n4', 'n0011', 'n0012', 'n0013')
truth: c('n1', 'n3', 'n4', 'n0011', 'n0012', 'n0013')
SLURM_JOB_NODELIST = 'n[1,3-4, 11-13]'
SLURM_JOB_CPUS_PER_NODE = ''
Warning in availableWorkers(methods = "Slurm") :
Expected either environment variable 'SLURM_JOB_CPUS_PER_NODE' or 'SLURM_TASKS_PER_NODE' to be set. Will assume one core per node.
workers: c('n1', 'n3', 'n4', 'n0011', 'n0012', 'n0013')
SLURM_JOB_NODELIST = 'n[1,3-4, 11-13]'
SLURM_JOB_CPUS_PER_NODE = '1,2,1,5,1,6'
workers: c('n1', 'n3', 'n3', 'n4', 'n0011', 'n0011', 'n0011', 'n0011', 'n0011', 'n0012', 'n0013', 'n0013', 'n0013', 'n0013', 'n0013', 'n0013')
workers
n1 n3 n4 n0011 n0012 n0013
1 2 1 5 1 6
expanded2
n1 n3 n4 n0011 n0012 n0013
1 2 1 5 1 6
- Specification #8 of 10
nodelist: 'a1,b[ 02-04,6-7]'
expanded: c('a1', 'b00002', 'b00003', 'b00004', 'b6', 'b7')
truth: c('a1', 'b00002', 'b00003', 'b00004', 'b6', 'b7')
SLURM_JOB_NODELIST = 'a1,b[ 02-04,6-7]'
SLURM_JOB_CPUS_PER_NODE = ''
Warning in availableWorkers(methods = "Slurm") :
Expected either environment variable 'SLURM_JOB_CPUS_PER_NODE' or 'SLURM_TASKS_PER_NODE' to be set. Will assume one core per node.
workers: c('a1', 'b00002', 'b00003', 'b00004', 'b6', 'b7')
SLURM_JOB_NODELIST = 'a1,b[ 02-04,6-7]'
SLURM_JOB_CPUS_PER_NODE = '5,3,6,3,6,6'
workers: c('a1', 'a1', 'a1', 'a1', 'a1', 'b00002', 'b00002', 'b00002', 'b00003', 'b00003', 'b00003', 'b00003', 'b00003', 'b00003', 'b00004', 'b00004', 'b00004', 'b6', 'b6', 'b6', 'b6', 'b6', 'b6', 'b7', 'b7', 'b7', 'b7', 'b7', 'b7')
workers
a1 b00002 b00003 b00004 b6 b7
5 3 6 3 6 6
expanded2
a1 b00002 b00003 b00004 b6 b7
5 3 6 3 6 6
- Specification #9 of 10
nodelist: 'n1, n1,n1,, n3,n1, n3,n3 n1,n[1-13],n[1,3-4, 11-13],a1,b[ 02-04,6-7]'
expanded: c('n1', 'n1', 'n1', 'n3', 'n1', 'n3', 'n3', 'n1', 'n1', 'n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'n8', 'n9', 'n10', 'n11', 'n12', 'n13', 'n1', 'n3', 'n4', 'n0011', 'n0012', 'n0013', 'a1', 'b00002', 'b00003', 'b00004', 'b6', 'b7')
truth: c('n1', 'n1', 'n1', 'n3', 'n1', 'n3', 'n3', 'n1', 'n1', 'n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'n8', 'n9', 'n10', 'n11', 'n12', 'n13', 'n1', 'n3', 'n4', 'n0011', 'n0012', 'n0013', 'a1', 'b00002', 'b00003', 'b00004', 'b6', 'b7')
SLURM_JOB_NODELIST = 'n1, n1,n1,, n3,n1, n3,n3 n1,n[1-13],n[1,3-4, 11-13],a1,b[ 02-04,6-7]'
SLURM_JOB_CPUS_PER_NODE = ''
Warning in availableWorkers(methods = "Slurm") :
Expected either environment variable 'SLURM_JOB_CPUS_PER_NODE' or 'SLURM_TASKS_PER_NODE' to be set. Will assume one core per node.
workers: c('n1', 'n1', 'n1', 'n3', 'n1', 'n3', 'n3', 'n1', 'n1', 'n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'n8', 'n9', 'n10', 'n11', 'n12', 'n13', 'n1', 'n3', 'n4', 'n0011', 'n0012', 'n0013', 'a1', 'b00002', 'b00003', 'b00004', 'b6', 'b7')
SLURM_JOB_NODELIST = 'n1, n1,n1,, n3,n1, n3,n3 n1,n[1-13],n[1,3-4, 11-13],a1,b[ 02-04,6-7]'
SLURM_JOB_CPUS_PER_NODE = '10,4,1,5,8,3,2,3,8,4,3,3,6,2,1,2,10,5,5,5,4,3,6,6,10,3,4,8,10,6,4,1,9'
workers: c('n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n3', 'n3', 'n3', 'n3', 'n3', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n3', 'n3', 'n3', 'n3', 'n3', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n2', 'n2', 'n2', 'n2', 'n3', 'n3', 'n3', 'n4', 'n4', 'n4', 'n5', 'n5', 'n5', 'n5', 'n5', 'n5', 'n6', 'n6', 'n7', 'n8', 'n8', 'n9', 'n9', 'n9', 'n9', 'n9', 'n9', 'n9', 'n9', 'n9', 'n9', 'n10', 'n10', 'n10', 'n10', 'n10', 'n11', 'n11', 'n11', 'n11', 'n11', 'n12', 'n12', 'n12', 'n12', 'n12', 'n13', 'n13', 'n13', 'n13', 'n1', 'n1', 'n1', 'n3', 'n3', 'n3', 'n3', 'n3', 'n3', 'n4', 'n4', 'n4', 'n4', 'n4', 'n4', 'n0011', 'n0011', 'n0011', 'n0011', 'n0011', 'n0011', 'n0011', 'n0011', 'n0011', 'n0011', 'n0012', 'n0012', 'n0012', 'n0013', 'n0013', 'n0013', 'n0013', 'a1', 'a1', 'a1', 'a1', 'a1', 'a1', 'a1', 'a1', 'b00002', 'b00002', 'b00002', 'b00002', 'b00002', 'b00002', 'b00002', 'b00002', 'b00002', 'b00002', 'b00003', 'b00003', 'b00003', 'b00003', 'b00003', 'b00003', 'b00004', 'b00004', 'b00004', 'b00004', 'b6', 'b7', 'b7', 'b7', 'b7', 'b7', 'b7', 'b7', 'b7', 'b7')
workers
n1 n3 n2 n4 n5 n6 n7 n8 n9 n10 n11
37 19 4 9 6 2 1 2 10 5 5
n12 n13 n0011 n0012 n0013 a1 b00002 b00003 b00004 b6 b7
5 4 10 3 4 8 10 6 4 1 9
expanded2
n1 n3 n2 n4 n5 n6 n7 n8 n9 n10 n11
37 19 4 9 6 2 1 2 10 5 5
n12 n13 n0011 n0012 n0013 a1 b00002 b00003 b00004 b6 b7
5 4 10 3 4 8 10 6 4 1 9
- Specification #10 of 10
nodelist: 'n1, n1,n1,, n3,n1, n3,n3 n1,n[1-13],n[1,3-4, 11-13],a1,b[ 02-04,6-7],a1,b[ 02-04,6-7],n[1,3-4, 11-13],n[1-13],n3 n1,n1, n3,n1,, n3, n1,n1'
expanded: c('n1', 'n1', 'n1', 'n3', 'n1', 'n3', 'n3', 'n1', 'n1', 'n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'n8', 'n9', 'n10', 'n11', 'n12', 'n13', 'n1', 'n3', 'n4', 'n0011', 'n0012', 'n0013', 'a1', 'b00002', 'b00003', 'b00004', 'b6', 'b7', 'a1', 'b00002', 'b00003', 'b00004', 'b6', 'b7', 'n1', 'n3', 'n4', 'n0011', 'n0012', 'n0013', 'n1', 'n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'n8', 'n9', 'n10', 'n11', 'n12', 'n13', 'n3', 'n1', 'n1', 'n3', 'n1', 'n3', 'n1', 'n1')
truth: c('n1', 'n1', 'n1', 'n3', 'n1', 'n3', 'n3', 'n1', 'n1', 'n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'n8', 'n9', 'n10', 'n11', 'n12', 'n13', 'n1', 'n3', 'n4', 'n0011', 'n0012', 'n0013', 'a1', 'b00002', 'b00003', 'b00004', 'b6', 'b7', 'a1', 'b00002', 'b00003', 'b00004', 'b6', 'b7', 'n1', 'n3', 'n4', 'n0011', 'n0012', 'n0013', 'n1', 'n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'n8', 'n9', 'n10', 'n11', 'n12', 'n13', 'n3', 'n1', 'n1', 'n3', 'n1', 'n3', 'n1', 'n1')
SLURM_JOB_NODELIST = 'n1, n1,n1,, n3,n1, n3,n3 n1,n[1-13],n[1,3-4, 11-13],a1,b[ 02-04,6-7],a1,b[ 02-04,6-7],n[1,3-4, 11-13],n[1-13],n3 n1,n1, n3,n1,, n3, n1,n1'
SLURM_JOB_CPUS_PER_NODE = ''
Warning in availableWorkers(methods = "Slurm") :
Expected either environment variable 'SLURM_JOB_CPUS_PER_NODE' or 'SLURM_TASKS_PER_NODE' to be set. Will assume one core per node.
workers: c('n1', 'n1', 'n1', 'n3', 'n1', 'n3', 'n3', 'n1', 'n1', 'n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'n8', 'n9', 'n10', 'n11', 'n12', 'n13', 'n1', 'n3', 'n4', 'n0011', 'n0012', 'n0013', 'a1', 'b00002', 'b00003', 'b00004', 'b6', 'b7', 'a1', 'b00002', 'b00003', 'b00004', 'b6', 'b7', 'n1', 'n3', 'n4', 'n0011', 'n0012', 'n0013', 'n1', 'n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'n8', 'n9', 'n10', 'n11', 'n12', 'n13', 'n3', 'n1', 'n1', 'n3', 'n1', 'n3', 'n1', 'n1')
SLURM_JOB_NODELIST = 'n1, n1,n1,, n3,n1, n3,n3 n1,n[1-13],n[1,3-4, 11-13],a1,b[ 02-04,6-7],a1,b[ 02-04,6-7],n[1,3-4, 11-13],n[1-13],n3 n1,n1, n3,n1,, n3, n1,n1'
SLURM_JOB_CPUS_PER_NODE = '10,3,2,4,1,3,9,8,6,6,4,10,2,3,3,2,6,10,4,2,10,6,8,10,6,9,4,7,3,10,10,10,6,6,2,9,9,2,5,8,1,2,4,2,7,5,6,4,3,9,2,9,9,3,7,6,2,7,7,2,1,6,5,10,8,9'
workers: c('n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n3', 'n3', 'n3', 'n3', 'n1', 'n3', 'n3', 'n3', 'n3', 'n3', 'n3', 'n3', 'n3', 'n3', 'n3', 'n3', 'n3', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n2', 'n2', 'n2', 'n2', 'n2', 'n2', 'n3', 'n3', 'n3', 'n3', 'n4', 'n4', 'n4', 'n4', 'n4', 'n4', 'n4', 'n4', 'n4', 'n4', 'n5', 'n5', 'n6', 'n6', 'n6', 'n7', 'n7', 'n7', 'n8', 'n8', 'n9', 'n9', 'n9', 'n9', 'n9', 'n9', 'n10', 'n10', 'n10', 'n10', 'n10', 'n10', 'n10', 'n10', 'n10', 'n10', 'n11', 'n11', 'n11', 'n11', 'n12', 'n12', 'n13', 'n13', 'n13', 'n13', 'n13', 'n13', 'n13', 'n13', 'n13', 'n13', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n3', 'n3', 'n3', 'n3', 'n3', 'n3', 'n3', 'n3', 'n4', 'n4', 'n4', 'n4', 'n4', 'n4', 'n4', 'n4', 'n4', 'n4', 'n0011', 'n0011', 'n0011', 'n0011', 'n0011', 'n0011', 'n0012', 'n0012', 'n0012', 'n0012', 'n0012', 'n0012', 'n0012', 'n0012', 'n0012', 'n0013', 'n0013', 'n0013', 'n0013', 'a1', 'a1', 'a1', 'a1', 'a1', 'a1', 'a1', 'b00002', 'b00002', 'b00002', 'b00003', 'b00003', 'b00003', 'b00003', 'b00003', 'b00003', 'b00003', 'b00003', 'b00003', 'b00003', 'b00004', 'b00004', 'b00004', 'b00004', 'b00004', 'b00004', 'b00004', 'b00004', 'b00004', 'b00004', 'b6', 'b6', 'b6', 'b6', 'b6', 'b6', 'b6', 'b6', 'b6', 'b6', 'b7', 'b7', 'b7', 'b7', 'b7', 'b7', 'a1', 'a1', 'a1', 'a1', 'a1', 'a1', 'b00002', 'b00002', 'b00003', 'b00003', 'b00003', 'b00003', 'b00003', 'b00003', 'b00003', 'b00003', 'b00003', 'b00004', 'b00004', 'b00004', 'b00004', 'b00004', 'b00004', 'b00004', 'b00004', 'b00004', 'b6', 'b6', 'b7', 'b7', 'b7', 'b7', 'b7', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n3', 'n4', 'n4', 'n0011', 'n0011', 'n0011', 'n0011', 'n0012', 'n0012', 'n0013', 'n0013', 'n0013', 'n0013', 'n0013', 'n0013', 'n0013', 'n1', 'n1', 'n1', 'n1', 'n1', 'n2', 'n2', 'n2', 'n2', 'n2', 'n2', 'n3', 'n3', 'n3', 'n3', 'n4', 'n4', 'n4', 'n5', 'n5', 'n5', 'n5', 'n5', 'n5', 'n5', 'n5', 'n5', 'n6', 'n6', 'n7', 'n7', 'n7', 'n7', 'n7', 'n7', 'n7', 'n7', 'n7', 'n8', 'n8', 'n8', 'n8', 'n8', 'n8', 'n8', 'n8', 'n8', 'n9', 'n9', 'n9', 'n10', 'n10', 'n10', 'n10', 'n10', 'n10', 'n10', 'n11', 'n11', 'n11', 'n11', 'n11', 'n11', 'n12', 'n12', 'n13', 'n13', 'n13', 'n13', 'n13', 'n13', 'n13', 'n3', 'n3', 'n3', 'n3', 'n3', 'n3', 'n3', 'n1', 'n1', 'n1', 'n3', 'n3', 'n3', 'n3', 'n3', 'n3', 'n1', 'n1', 'n1', 'n1', 'n1', 'n3', 'n3', 'n3', 'n3', 'n3', 'n3', 'n3', 'n3', 'n3', 'n3', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1', 'n1')
workers
n1 n3 n2 n4 n5 n6 n7 n8 n9 n10 n11
74 56 12 25 11 5 12 11 9 17 10
n12 n13 n0011 n0012 n0013 a1 b00002 b00003 b00004 b6 b7
4 17 10 11 11 13 5 19 19 12 11
expanded2
n1 n3 n2 n4 n5 n6 n7 n8 n9 n10 n11
74 56 12 25 11 5 12 11 9 17 10
n12 n13 n0011 n0012 n0013 a1 b00002 b00003 b00004 b6 b7
4 17 10 11 11 13 5 19 19 12 11
>
> message("*** Slurm w/ SLURM_JOB_NODELIST ... DONE")
*** Slurm w/ SLURM_JOB_NODELIST ... DONE
>
>
> message("*** Slurm w/ SLURM_TASKS_PER_NODE ...")
*** Slurm w/ SLURM_TASKS_PER_NODE ...
>
> slurm_expand_nodecounts <- parallelly:::slurm_expand_nodecounts
>
> specs <- list(
+ "1" = c(1L),
+ "1,3" = c(1L,3L),
+ "1, 3" = c(1L,3L),
+ "2(x3)" = rep(2L, times = 3L),
+ "2(x3),3,4(x1)" = c(rep(2L, times = 3L), 3L, 4L)
+ )
>
> for (kk in seq_along(specs)) {
+ message(sprintf("- Specification #%d of %d", kk, length(specs)))
+ nodecounts <- names(specs)[kk]
+ truth <- specs[[kk]]
+ cat(sprintf("nodecounts: %s\n", sQuote(nodecounts)))
+ expanded <- slurm_expand_nodecounts(nodecounts)
+ cat(sprintf("expanded: c(%s)\n", paste(sQuote(expanded), collapse = ", ")))
+ cat(sprintf("truth: c(%s)\n", paste(sQuote(truth), collapse = ", ")))
+ stopifnot(
+ is.integer(expanded),
+ !any(is.na(expanded)),
+ length(expanded) == length(truth),
+ identical(expanded, truth)
+ )
+ }
- Specification #1 of 5
nodecounts: '1'
expanded: c('1')
truth: c('1')
- Specification #2 of 5
nodecounts: '1,3'
expanded: c('1', '3')
truth: c('1', '3')
- Specification #3 of 5
nodecounts: '1, 3'
expanded: c('1', '3')
truth: c('1', '3')
- Specification #4 of 5
nodecounts: '2(x3)'
expanded: c('2', '2', '2')
truth: c('2', '2', '2')
- Specification #5 of 5
nodecounts: '2(x3),3,4(x1)'
expanded: c('2', '2', '2', '3', '4')
truth: c('2', '2', '2', '3', '4')
>
> message("*** Slurm w/ SLURM_TASKS_PER_NODE ... DONE")
*** Slurm w/ SLURM_TASKS_PER_NODE ... DONE
>
>
>
> message("*** HPC related ... DONE")
*** HPC related ... DONE
>
>
> ## Any R options and system environment variable
> print(availableWorkers(methods = c("width", "FOO_BAR_ENV"),
+ na.rm = FALSE, which = "all"))
$width
[1] "80"
$FOO_BAR_ENV
character(0)
>
> ## Exception handling
> Sys.setenv("FOO_BAR_ENV" = "0")
> res <- tryCatch(availableWorkers(methods = "FOO_BAR_ENV"), error = identity)
[18:38:34.225] Detected invalid (zero or less) core settings: 'FOO_BAR_ENV' = 0
> stopifnot(inherits(res, "error"))
>
> message("*** availableWorkers() ... DONE")
*** availableWorkers() ... DONE
>
> source("incl/end.R")
>
> proc.time()
user system elapsed
0.48 0.10 0.56
Running the tests in 'tests/cgroups.R' failed.
Complete output:
> source("incl/start.R")
>
> message("*** cgroups ...")
*** cgroups ...
>
> message("- getCGroups()")
- getCGroups()
> groups <- parallelly:::getCGroups()
> print(groups)
character(0)
> stopifnot(
+ is.character(groups),
+ length(groups) == 0L || !is.null(names(groups))
+ )
>
> message("- getCGroupsRoot()")
- getCGroupsRoot()
> root <- parallelly:::getCGroupsRoot()
> cat(sprintf("cgroups root path: %s\n", sQuote(root)))
cgroups root path: 'NA'
> stopifnot(length(root) == 1L, is.character(root))
>
> message("- getCGroupsPath()")
- getCGroupsPath()
> path <- parallelly:::getCGroupsPath("cpu")
> cat(sprintf("cgroups 'cpu' path: %s\n", sQuote(path)))
cgroups 'cpu' path: 'NA'
> stopifnot(length(path) == 1L, is.character(path))
>
> path <- parallelly:::getCGroupsPath("cpuset")
> cat(sprintf("cgroups 'cpuset' path: %s\n", sQuote(path)))
cgroups 'cpuset' path: 'NA'
> stopifnot(length(path) == 1L, is.character(path))
>
>
> message("- getCGroupsValue()")
- getCGroupsValue()
> value <- parallelly:::getCGroupsValue("cpu", "cpu.cfs_quota_us")
> cat(sprintf("cgroups 'cpu.cfs_quota_us' value: %s\n", sQuote(value)))
cgroups 'cpu.cfs_quota_us' value: 'NA'
> stopifnot(length(value) == 1L, is.character(value))
>
> value <- parallelly:::getCGroupsValue("cpu", "cpu.cfs_total_us")
> cat(sprintf("cgroups 'cpu.cfs_total_us' value: %s\n", sQuote(value)))
cgroups 'cpu.cfs_total_us' value: 'NA'
> stopifnot(length(value) == 1L, is.character(value))
>
> value <- parallelly:::getCGroupsValue("cpuset", "cpuset.cpus")
> cat(sprintf("cgroups 'cpuset.cpus' value: %s\n", sQuote(value)))
cgroups 'cpuset.cpus' value: 'NA'
> stopifnot(length(value) == 1L, is.character(value))
>
>
> message("- getCGroupsCpuSet()")
- getCGroupsCpuSet()
> value <- parallelly:::getCGroupsCpuSet()
> cat(sprintf("CPU set: [n=%d] %s\n", length(value), paste(sQuote(value), collapse = ", ")))
CPU set: [n=0]
> stopifnot(length(value) >= 0L, is.integer(value), !any(is.na(value)))
>
>
> message("- getCGroupsCpuQuotaMicroseconds()")
- getCGroupsCpuQuotaMicroseconds()
> value <- parallelly:::getCGroupsCpuQuotaMicroseconds()
> cat(sprintf("CPU quota (ms): %d\n", value))
CPU quota (ms): NA
> stopifnot(
+ length(value) == 1L,
+ is.integer(value),
+ is.na(value) || value == -1 || value > 0
+ )
>
> message("- getCGroupsCpuPeriodMicroseconds()")
- getCGroupsCpuPeriodMicroseconds()
> value <- parallelly:::getCGroupsCpuPeriodMicroseconds()
> cat(sprintf("CPU total (ms): %d\n", value))
CPU total (ms): NA
> stopifnot(
+ length(value) == 1L,
+ is.integer(value),
+ is.na(value) || value > 0
+ )
>
> message("- getCGroupsCpuQuota()")
- getCGroupsCpuQuota()
> value <- parallelly:::getCGroupsCpuQuota()
> cat(sprintf("CPU quota (ratio): %g\n", value))
CPU quota (ratio): NA
> stopifnot(
+ length(value) == 1L,
+ is.numeric(value),
+ !is.infinite(value),
+ is.na(value) || value > 0
+ )
>
> message("- getCGroups2CpuMax()")
- getCGroups2CpuMax()
> value <- parallelly:::getCGroups2CpuMax()
> cat(sprintf("CPU quota (ratio): %g\n", value))
CPU quota (ratio): NA
> stopifnot(
+ length(value) == 1L,
+ is.numeric(value),
+ !is.infinite(value),
+ is.na(value) || value > 0
+ )
>
> message("*** cgroups ... DONE")
*** cgroups ... DONE
>
> source("incl/end.R")
>
> proc.time()
user system elapsed
0.28 0.09 0.31
Running the tests in 'tests/freeCores.R' failed.
Complete output:
> source("incl/start.R")
>
> message("*** freeLoad() ...")
*** freeLoad() ...
>
> free <- freeCores()
> print(free)
[1] 2
attr(,"loadavg")
1min 5min 15min
NA NA NA
attr(,"maxCores")
system
96
attr(,"memory")
[1] "5min"
attr(,"fraction")
[1] 0.9
>
> stopifnot(
+ is.integer(free),
+ length(free) == 1L,
+ !is.na(free), free >= 1L
+ )
>
> message("*** freeLoad() ... DONE")
*** freeLoad() ... DONE
>
> source("incl/end.R")
>
> proc.time()
user system elapsed
0.28 0.09 0.35
Running the tests in 'tests/isForkedChild.R' failed.
Complete output:
> source("incl/start.R")
> library(parallel)
Attaching package: 'parallel'
The following object is masked _by_ '.GlobalEnv':
detectCores
> options(parallelly.debug = FALSE)
>
> message("*** isForkedChild() ...")
*** isForkedChild() ...
>
> stopifnot(!isForkedChild())
>
> if (supportsMulticore()) {
+ message("- mcparallel()/mccollect()")
+ f <- mcparallel(isForkedChild())
+ isForked <- mccollect(f)[[1]]
+ stopifnot(isForked)
+
+ message("- makeForkCluster()")
+ cl <- makeForkCluster(1L)
+ isForked <- clusterEvalQ(cl, { parallelly::isForkedChild() })
+ isForked <- unlist(isForked, use.names = FALSE)
+ stopifnot(isForked)
+ parallel::stopCluster(cl)
+ }
>
> message("- mclapply()")
- mclapply()
> isForked <- mclapply(1:2, FUN = function(ii) isForkedChild())
> isForked <- unlist(isForked, use.names = FALSE)
> if (supportsMulticore()) {
+ stopifnot(all(isForked))
+ } else {
+ stopifnot(!any(isForked))
+ }
>
> message("- makeClusterPSOCK()")
- makeClusterPSOCK()
> cl <- makeClusterPSOCK(1L)
> isForked <- clusterEvalQ(cl, { parallelly::isForkedChild() })
> isForked <- unlist(isForked, use.names = FALSE)
> stopifnot(!isForked)
> parallel::stopCluster(cl)
>
> message("*** isForkedChild() ... DONE")
*** isForkedChild() ... DONE
>
> source("incl/end.R")
>
> proc.time()
user system elapsed
0.23 0.17 1.10
Running the tests in 'tests/makeClusterMPI.R' failed.
Complete output:
> source("incl/start.R")
>
> library(parallel)
Attaching package: 'parallel'
The following object is masked _by_ '.GlobalEnv':
detectCores
>
> message("*** makeClusterMPI() ...")
*** makeClusterMPI() ...
>
> pkg <- "Rmpi"
> if (fullTest && requireNamespace(pkg, quietly = TRUE)) {
+ cl <- makeClusterMPI(2L)
+ str(cl)
+
+ res <- parLapply(cl, X = 1:2, fun = function(x) {
+ list(
+ hostname = Sys.info()[["nodename"]],
+ pid = Sys.getpid(),
+ value = x^2
+ )
+ })
+ utils::str(res)
+ y <- vapply(res, FUN = `[[`, "value", FUN.VALUE = NA_real_)
+ stopifnot(identical(y, c(1, 4)))
+
+ stopCluster(cl)
+ str(cl)
+ }
>
> message("*** makeClusterMPI() ... DONE")
*** makeClusterMPI() ... DONE
>
> source("incl/end.R")
>
> proc.time()
user system elapsed
0.23 0.07 0.29
Running the tests in 'tests/options-and-envvars.R' failed.
Complete output:
> source("incl/start.R")
>
> getOption2 <- parallelly:::getOption2
> getEnvVar2 <- parallelly:::getEnvVar2
>
> options(parallelly.some.option = NULL)
> options(parallelly.some.option = NULL)
> Sys.unsetenv("R_FUTURE_SOME_ENVVAR")
> Sys.unsetenv("R_PARALLELLY_SOME_ENVVAR")
>
>
> message("*** Options and environment variables ...")
*** Options and environment variables ...
>
> showall <- function() {
+ utils::str(list(
+ future.some.setting = getOption("future.some.setting", NULL),
+ parallelly.some.setting = getOption("parallelly.some.setting", NULL),
+ R_FUTURE_SOME_SETTING = Sys.getenv("R_FUTURE_SOME_SETTING", ""),
+ R_PARALLELLY_SOME_SETTING = Sys.getenv("R_PARALLELLY_SOME_SETTING", "")
+ ))
+ }
>
> for (what in c("option", "envvar")) {
+ if (what == "option") {
+ setvalue <- function(name, value) {
+ name <- sprintf("%s.some.setting", tolower(name))
+ if (is.null(value)) {
+ args <- list(NULL)
+ } else {
+ args <- as.list(value)
+ }
+ names(args) <- name
+ do.call(options, args = args)
+ class(args) <- "option"
+ args
+ }
+ } else if (what == "envvar") {
+ setvalue <- function(name, value) {
+ name <- sprintf("R_%s_SOME_SETTING", toupper(name))
+ if (is.null(value)) {
+ Sys.unsetenv(name)
+ args <- list(NULL)
+ names(args) <- name
+ } else {
+ args <- as.list(value)
+ names(args) <- name
+ do.call(Sys.setenv, args = args)
+ }
+ class(args) <- "envvar"
+ args
+ }
+ }
+
+ for (name in c("future", "parallelly")) {
+ for (value0 in list(NULL, TRUE)) {
+ args <- setvalue(name, value0)
+ stopifnot(inherits(args, what))
+ showall()
+
+ if (is.null(value0)) {
+ message("- getOption2()")
+ value <- getOption2("future.some.setting", NA)
+ stopifnot(is.na(value))
+ value <- getOption2("parallelly.some.setting", NA)
+ stopifnot(is.na(value))
+
+ message("- getEnvVar2()")
+ value <- getEnvVar2("R_FUTURE_SOME_ENVVAR", NA)
+ stopifnot(is.na(value))
+ value <- getEnvVar2("R_PARALLELLY_SOME_ENVVAR", NA)
+ stopifnot(is.na(value))
+ } else if (isTRUE(value0)) {
+ if (what == "option") {
+ message("- getOption2()")
+ value1 <- getOption2("future.some.setting", NA)
+ stopifnot(isTRUE(value1))
+ value2 <- getOption2("parallelly.some.setting", NA)
+ stopifnot(isTRUE(value2))
+ } else if (what == "envvar") {
+ message("- getEnvVar2()")
+ value1 <- getEnvVar2("R_FUTURE_SOME_SETTING", NA)
+ stopifnot(value1 == "TRUE")
+ value2 <- getEnvVar2("R_PARALLELLY_SOME_SETTING", NA)
+ stopifnot(value2 == "TRUE")
+ }
+ stopifnot(identical(value1, value2))
+ }
+
+ args <- setvalue(name, NULL)
+ stopifnot(inherits(args, what), is.null(args[[1]]))
+ } ## for (value ...)
+ } ## for (name ...)
+ } ## for (what ...)
List of 4
$ future.some.setting : NULL
$ parallelly.some.setting : NULL
$ R_FUTURE_SOME_SETTING : chr ""
$ R_PARALLELLY_SOME_SETTING: chr ""
- getOption2()
- getEnvVar2()
List of 4
$ future.some.setting : logi TRUE
$ parallelly.some.setting : NULL
$ R_FUTURE_SOME_SETTING : chr ""
$ R_PARALLELLY_SOME_SETTING: chr ""
- getOption2()
List of 4
$ future.some.setting : NULL
$ parallelly.some.setting : NULL
$ R_FUTURE_SOME_SETTING : chr ""
$ R_PARALLELLY_SOME_SETTING: chr ""
- getOption2()
- getEnvVar2()
List of 4
$ future.some.setting : NULL
$ parallelly.some.setting : logi TRUE
$ R_FUTURE_SOME_SETTING : chr ""
$ R_PARALLELLY_SOME_SETTING: chr ""
- getOption2()
List of 4
$ future.some.setting : NULL
$ parallelly.some.setting : NULL
$ R_FUTURE_SOME_SETTING : chr ""
$ R_PARALLELLY_SOME_SETTING: chr ""
- getOption2()
- getEnvVar2()
List of 4
$ future.some.setting : NULL
$ parallelly.some.setting : NULL
$ R_FUTURE_SOME_SETTING : chr "TRUE"
$ R_PARALLELLY_SOME_SETTING: chr ""
- getEnvVar2()
List of 4
$ future.some.setting : NULL
$ parallelly.some.setting : NULL
$ R_FUTURE_SOME_SETTING : chr ""
$ R_PARALLELLY_SOME_SETTING: chr ""
- getOption2()
- getEnvVar2()
List of 4
$ future.some.setting : NULL
$ parallelly.some.setting : NULL
$ R_FUTURE_SOME_SETTING : chr ""
$ R_PARALLELLY_SOME_SETTING: chr "TRUE"
- getEnvVar2()
>
>
> message("*** Options and environment variables ... DONE")
*** Options and environment variables ... DONE
>
> source("incl/end.R")
>
> proc.time()
user system elapsed
0.28 0.12 0.40
Running the tests in 'tests/r_bug18119.R' failed.
Complete output:
> source("incl/start.R")
>
> r_version_has_bug18119 <- function() {
+ parallelly:::r_version_has_bug18119(force = TRUE)
+ }
>
> affected_by_bug18119 <- function() {
+ parallelly:::affected_by_bug18119(force = TRUE)
+ }
>
>
> message("*** R bug #18119 ...")
*** R bug #18119 ...
>
> has <- r_version_has_bug18119()
> message("r_version_has_bug18119(<current>): ", has)
r_version_has_bug18119(<current>): FALSE
>
> Sys.setenv(R_PARALLELLY_R_VERSION="3.5.3")
> has <- r_version_has_bug18119()
> message("r_version_has_bug18119(<R 3.5.3>): ", has)
r_version_has_bug18119(<R 3.5.3>): FALSE
> stopifnot(!has)
>
> Sys.setenv(R_PARALLELLY_R_VERSION="4.0.0")
> has <- r_version_has_bug18119()
> message("r_version_has_bug18119(<R 4.0.0>): ", has)
r_version_has_bug18119(<R 4.0.0>): TRUE
> stopifnot(has)
>
> Sys.setenv(R_PARALLELLY_R_VERSION="4.0.5")
> has <- r_version_has_bug18119()
> message("r_version_has_bug18119(<R 4.0.5>): ", has)
r_version_has_bug18119(<R 4.0.5>): TRUE
> stopifnot(has)
>
> Sys.setenv(R_PARALLELLY_R_VERSION="4.1.0")
> has <- r_version_has_bug18119()
> message("r_version_has_bug18119(<R 4.1.0>): ", has)
r_version_has_bug18119(<R 4.1.0>): TRUE
> stopifnot(has)
>
> Sys.setenv(R_PARALLELLY_R_VERSION="4.1.1")
> has <- r_version_has_bug18119()
> message("r_version_has_bug18119(<R 4.1.1>): ", has)
r_version_has_bug18119(<R 4.1.1>): FALSE
> stopifnot(!has)
>
> Sys.setenv(R_PARALLELLY_R_VERSION="4.2.0")
> has <- r_version_has_bug18119()
> message("r_version_has_bug18119(<R 4.2.0>): ", has)
r_version_has_bug18119(<R 4.2.0>): FALSE
> stopifnot(!has)
>
> message("*** R bug #18119 ... DONE")
*** R bug #18119 ... DONE
>
> source("incl/end.R")
>
> proc.time()
user system elapsed
0.26 0.10 0.34
Flavor: r-devel-windows-x86_64