File: batchtools_hpc.R

package info (click to toggle)
r-cran-future.batchtools 0.12.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 528 kB
  • sloc: sh: 82; makefile: 2
file content (32 lines) | stat: -rw-r--r-- 713 bytes parent folder | download | duplicates (3)
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
source("incl/start.R")

## Setup all strategies including custom once for testing on HPC environments
print(all_strategies())

message("All HPC strategies:")

strategies <- c("batchtools_lsf", "batchtools_openlava", "batchtools_sge",
                "batchtools_slurm", "batchtools_torque")
mprint(strategies, debug = TRUE)

message("Supported HPC strategies:")
strategies <- strategies[sapply(strategies, FUN = test_strategy)]
mprint(strategies, debug = TRUE)

for (strategy in strategies) {
  plan(strategy)
  print(plan())

  f <- future(42L)
  print(f)
  v <- value(f)
  print(v)
  stopifnot(v == 42L)

  x %<-% Sys.info()
  print(x)

  message(sprintf("*** %s() ... DONE", strategy))
}

source("incl/end.R")