Skip to content

Commit bbc2226

Browse files
Examples now also report on env var 'LOADEDMODULES' to help illustrate how resources 'modules' can be used
1 parent aa98cf2 commit bbc2226

18 files changed

+54
-22
lines changed

R/batchtools_bash.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ BatchtoolsBashFutureBackend <- function(..., template = "bash", fs.latency = 0.0
6868
#' hostname = Sys.info()[["nodename"]],
6969
#' os = Sys.info()[["sysname"]],
7070
#' cores = unname(parallelly::availableCores()),
71-
#' pid = Sys.getpid()
71+
#' pid = Sys.getpid(),
72+
#' modules = Sys.getenv("LOADEDMODULES")
7273
#' )
7374
#' })
7475
#' info <- value(f)

R/batchtools_custom.R

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,17 @@
2020
#'
2121
#' message("Main process ID: ", Sys.getpid())
2222
#'
23-
#' f <- future(Sys.getpid())
24-
#' pid <- value(f)
25-
#' message("Worker process ID: ", pid)
23+
#' f <- future({
24+
#' data.frame(
25+
#' hostname = Sys.info()[["nodename"]],
26+
#' os = Sys.info()[["sysname"]],
27+
#' cores = unname(parallelly::availableCores()),
28+
#' pid = Sys.getpid(),
29+
#' modules = Sys.getenv("LOADEDMODULES")
30+
#' )
31+
#' })
32+
#' info <- value(f)
33+
#' print(info)
2634
#'
2735
#' @rdname BatchtoolsFutureBackend
2836
#' @keywords internal

R/batchtools_interactive.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ BatchtoolsInteractiveFutureBackend <- function(fs.latency = 0.0, ...) {
5252
#' hostname = Sys.info()[["nodename"]],
5353
#' os = Sys.info()[["sysname"]],
5454
#' cores = unname(parallelly::availableCores()),
55-
#' pid = Sys.getpid()
55+
#' pid = Sys.getpid(),
56+
#' modules = Sys.getenv("LOADEDMODULES")
5657
#' )
5758
#' })
5859
#' info <- value(f)

R/batchtools_local.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ BatchtoolsLocalFutureBackend <- function(fs.latency = 0.0, ...) {
8484
#' hostname = Sys.info()[["nodename"]],
8585
#' os = Sys.info()[["sysname"]],
8686
#' cores = unname(parallelly::availableCores()),
87-
#' pid = Sys.getpid()
87+
#' pid = Sys.getpid(),
88+
#' modules = Sys.getenv("LOADEDMODULES")
8889
#' )
8990
#' })
9091
#' info <- value(f)

R/batchtools_lsf.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ BatchtoolsLsfFutureBackend <- function(...) {
4848
#' data.frame(
4949
#' hostname = Sys.info()[["nodename"]],
5050
#' os = Sys.info()[["sysname"]],
51-
#' cores = unname(parallelly::availableCores())
51+
#' cores = unname(parallelly::availableCores()),
52+
#' modules = Sys.getenv("LOADEDMODULES")
5253
#' )
5354
#' })
5455
#' info <- value(f)

R/batchtools_multicore.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ BatchtoolsMulticoreFutureBackend <- function(workers = availableCores(constraint
9595
#' hostname = Sys.info()[["nodename"]],
9696
#' os = Sys.info()[["sysname"]],
9797
#' cores = unname(parallelly::availableCores()),
98-
#' pid = Sys.getpid()
98+
#' pid = Sys.getpid(),
99+
#' modules = Sys.getenv("LOADEDMODULES")
99100
#' )
100101
#' })
101102
#' info <- value(f)

R/batchtools_openlava.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ BatchtoolsOpenLavaFutureBackend <- function(...) {
4848
#' data.frame(
4949
#' hostname = Sys.info()[["nodename"]],
5050
#' os = Sys.info()[["sysname"]],
51-
#' cores = unname(parallelly::availableCores())
51+
#' cores = unname(parallelly::availableCores()),
52+
#' modules = Sys.getenv("LOADEDMODULES")
5253
#' )
5354
#' })
5455
#' info <- value(f)

R/batchtools_sge.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ BatchtoolsSGEFutureBackend <- function(...) {
5252
#' data.frame(
5353
#' hostname = Sys.info()[["nodename"]],
5454
#' os = Sys.info()[["sysname"]],
55-
#' cores = unname(parallelly::availableCores())
55+
#' cores = unname(parallelly::availableCores()),
56+
#' modules = Sys.getenv("LOADEDMODULES")
5657
#' )
5758
#' })
5859
#' info <- value(f)

R/batchtools_slurm.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ BatchtoolsSlurmFutureBackend <- function(...) {
5353
#' data.frame(
5454
#' hostname = Sys.info()[["nodename"]],
5555
#' os = Sys.info()[["sysname"]],
56-
#' cores = unname(parallelly::availableCores())
56+
#' cores = unname(parallelly::availableCores()),
57+
#' modules = Sys.getenv("LOADEDMODULES")
5758
#' )
5859
#' })
5960
#' info <- value(f)

man/BatchtoolsFutureBackend.Rd

Lines changed: 11 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)