Skip to content

Commit bed5117

Browse files
More informative info gathered for examples
1 parent 37b4138 commit bed5117

19 files changed

+151
-35
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: future.batchtools
2-
Version: 0.12.2-9956
2+
Version: 0.12.2-9957
33
Depends:
44
R (>= 3.2.0),
55
parallelly,

R/batchtools_bash.R

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,16 @@ BatchtoolsBashFutureBackend <- function(..., template = "bash", fs.latency = 0.0
6363
#'
6464
#' message("Main process ID: ", Sys.getpid())
6565
#'
66-
#' f <- future(Sys.getpid())
67-
#' pid <- value(f)
68-
#' message("Worker process ID: ", pid)
66+
#' f <- future({
67+
#' data.frame(
68+
#' hostname = Sys.info()[["nodename"]],
69+
#' os = Sys.info()[["sysname"]],
70+
#' cores = unname(parallelly::availableCores()),
71+
#' pid = Sys.getpid()
72+
#' )
73+
#' })
74+
#' info <- value(f)
75+
#' print(info)
6976
#'
7077
#' @export
7178
batchtools_bash <- function(..., template = "bash", fs.latency = 0.0, resources = list()) {

R/batchtools_interactive.R

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,16 @@ BatchtoolsInteractiveFutureBackend <- function(fs.latency = 0.0, ...) {
4747
#'
4848
#' message("Main process ID: ", Sys.getpid())
4949
#'
50-
#' f <- future(Sys.getpid())
51-
#' pid <- value(f)
52-
#' message("Worker process ID: ", pid)
50+
#' f <- future({
51+
#' data.frame(
52+
#' hostname = Sys.info()[["nodename"]],
53+
#' os = Sys.info()[["sysname"]],
54+
#' cores = unname(parallelly::availableCores()),
55+
#' pid = Sys.getpid()
56+
#' )
57+
#' })
58+
#' info <- value(f)
59+
#' print(info)
5360
#'
5461
#' @inheritParams BatchtoolsInteractiveFutureBackend
5562
#'

R/batchtools_local.R

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,16 @@ BatchtoolsLocalFutureBackend <- function(fs.latency = 0.0, ...) {
7979
#'
8080
#' message("Main process ID: ", Sys.getpid())
8181
#'
82-
#' f <- future(Sys.getpid())
83-
#' pid <- value(f)
84-
#' message("Worker process ID: ", pid)
82+
#' f <- future({
83+
#' data.frame(
84+
#' hostname = Sys.info()[["nodename"]],
85+
#' os = Sys.info()[["sysname"]],
86+
#' cores = unname(parallelly::availableCores()),
87+
#' pid = Sys.getpid()
88+
#' )
89+
#' })
90+
#' info <- value(f)
91+
#' print(info)
8592
#'
8693
#' @export
8794
batchtools_local <- function(..., fs.latency = 0.0) {

R/batchtools_lsf.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@ BatchtoolsLsfFutureBackend <- function(...) {
4444
#' asis = c("-n 4", "-R 'span[hosts=1]'", "-q freecycle")
4545
#' ))
4646
#'
47-
#' f <- future(Sys.info())
47+
#' f <- future({
48+
#' data.frame(
49+
#' hostname = Sys.info()[["nodename"]],
50+
#' os = Sys.info()[["sysname"]],
51+
#' cores = unname(parallelly::availableCores())
52+
#' )
53+
#' })
4854
#' info <- value(f)
4955
#' print(info)
5056
#'

R/batchtools_multicore.R

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,16 @@ BatchtoolsMulticoreFutureBackend <- function(workers = availableCores(constraint
9090
#'
9191
#' message("Main process ID: ", Sys.getpid())
9292
#'
93-
#' f <- future(Sys.getpid())
94-
#' pid <- value(f)
95-
#' message("Worker process ID: ", pid)
93+
#' f <- future({
94+
#' data.frame(
95+
#' hostname = Sys.info()[["nodename"]],
96+
#' os = Sys.info()[["sysname"]],
97+
#' cores = unname(parallelly::availableCores()),
98+
#' pid = Sys.getpid()
99+
#' )
100+
#' })
101+
#' info <- value(f)
102+
#' print(info)
96103
#'
97104
#' @export
98105
batchtools_multicore <- function(..., workers = availableCores(constraints = "multicore"), fs.latency = 0.0) {

R/batchtools_openlava.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@ BatchtoolsOpenLavaFutureBackend <- function(...) {
4444
#' asis = c("-n 4", "-R 'span[hosts=1]'", "-q freecycle")
4545
#' ))
4646
#'
47-
#' f <- future(Sys.info())
47+
#' f <- future({
48+
#' data.frame(
49+
#' hostname = Sys.info()[["nodename"]],
50+
#' os = Sys.info()[["sysname"]],
51+
#' cores = unname(parallelly::availableCores())
52+
#' )
53+
#' })
4854
#' info <- value(f)
4955
#' print(info)
5056
#'

R/batchtools_sge.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,13 @@ BatchtoolsSGEFutureBackend <- function(...) {
4848
#' asis = c("-pe smp 4", "-q freecycle.q")
4949
#' ))
5050
#'
51-
#' f <- future(Sys.info())
51+
#' f <- future({
52+
#' data.frame(
53+
#' hostname = Sys.info()[["nodename"]],
54+
#' os = Sys.info()[["sysname"]],
55+
#' cores = unname(parallelly::availableCores())
56+
#' )
57+
#' })
5258
#' info <- value(f)
5359
#' print(info)
5460
#'

R/batchtools_slurm.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,13 @@ BatchtoolsSlurmFutureBackend <- function(...) {
4949
#' asis = c("--nodes=1", "--ntasks=4", "--partition=freecycle")
5050
#' ))
5151
#'
52-
#' f <- future(Sys.info())
52+
#' f <- future({
53+
#' data.frame(
54+
#' hostname = Sys.info()[["nodename"]],
55+
#' os = Sys.info()[["sysname"]],
56+
#' cores = unname(parallelly::availableCores())
57+
#' )
58+
#' })
5359
#' info <- value(f)
5460
#' print(info)
5561
#'

R/batchtools_torque.R

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ BatchtoolsTorqueFutureBackend <- function(...) {
4343
#' asis = c("-l nodes=1:ppn=4", "-q freecycle")
4444
#' ))
4545
#'
46-
#' f <- future(Sys.info())
46+
#' f <- future({
47+
#' data.frame(
48+
#' hostname = Sys.info()[["nodename"]],
49+
#' os = Sys.info()[["sysname"]],
50+
#' cores = unname(parallelly::availableCores())
51+
#' )
52+
#' })
4753
#' info <- value(f)
4854
#' print(info)
4955
#'

0 commit comments

Comments
 (0)