Skip to content

Commit 1b4b93d

Browse files
Add help page for 'batchtools_multicore'
1 parent 4459ecf commit 1b4b93d

14 files changed

+111
-76
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-9916
2+
Version: 0.12.2-9917
33
Depends:
44
R (>= 3.2.0),
55
parallelly,

R/batchtools_bash.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ BatchtoolsBashFutureBackend <- function(...,
5858
#'
5959
#' f <- future(Sys.getpid())
6060
#' pid <- value(f)
61-
#' message("Workers process ID: ", pid)
61+
#' message("Worker process ID: ", pid)
6262
#'
6363
#' @export
6464
batchtools_bash <- function(

R/batchtools_interactive.R

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,29 @@ BatchtoolsInteractiveFutureBackend <- function(...) {
2121
#' The batchtools interactive backend is useful for verifying parts of your
2222
#' \pkg{batchtools} setup locally, while still being able to do interactive
2323
#' debugging.
24-
#' An alternative to the batchtools interactive backend is to use
25-
#' `plan(future::sequential)`, which is a faster way process futures
26-
#' sequentially and that also can be debugged interactively.
2724
#'
2825
#' @inheritParams BatchtoolsFutureBackend
2926
#' @inheritParams BatchtoolsInteractiveFutureBackend
3027
#'
3128
#' @param \ldots Not used.
3229
#'
3330
#' @details
34-
#' Batchtools interactive futures uses \pkg{batchtools} cluster functions
31+
#' Batchtools interactive futures use \pkg{batchtools} cluster functions
3532
#' created by [batchtools::makeClusterFunctionsInteractive()] with
3633
#' `external = TRUE`.
3734
#'
35+
#' An alternative to the batchtools interactive backend is to use
36+
#' `plan(future::sequential)`, which is a faster way process futures
37+
#' sequentially and that also can be debugged interactively.
38+
#'
3839
#' @examples
3940
#' plan(batchtools_interactive)
4041
#'
4142
#' message("Main process ID: ", Sys.getpid())
4243
#'
4344
#' f <- future(Sys.getpid())
4445
#' pid <- value(f)
45-
#' message("Workers process ID: ", pid)
46+
#' message("Worker process ID: ", pid)
4647
#'
4748
#' @inheritParams BatchtoolsInteractiveFutureBackend
4849
#'

R/batchtools_local.R

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
#' An alternative to batchtools interactive futures is to use
2929
#' `plan(sequential, split = TRUE)` futures of the \pkg{future} package.
3030
#'
31-
#' @example incl/batchtools_local.R
32-
#'
3331
#' @rdname BatchtoolsFutureBackend
3432
#' @keywords internal
3533
#'
@@ -54,31 +52,30 @@ BatchtoolsLocalFutureBackend <- function(...) {
5452
#'
5553
#' The batchtools local backend is useful for verifying parts of your
5654
#' \pkg{batchtools} setup locally, before using a more advanced backend such
57-
#' as the job-scheduler backends.
58-
#' An alternative to the batchtools interactive backend is to use
59-
#' `plan(future::cluster, workers = I(1))`.
55+
#' as the job-scheduler backends.
6056
#'
6157
#' @inheritParams BatchtoolsFutureBackend
6258
#' @inheritParams BatchtoolsLocalFutureBackend
6359
#'
6460
#' @param \ldots Not used.
6561
#'
6662
#' @details
67-
#' Batchtools local futures uses \pkg{batchtools} cluster functions
63+
#' Batchtools local futures use \pkg{batchtools} cluster functions
6864
#' created by [batchtools::makeClusterFunctionsInteractive()] with
6965
#' `external = TRUE`.
7066
#'
67+
#' An alternative to the batchtools interactive backend is to use
68+
#' `plan(future::cluster, workers = I(1))`.
69+
#'
7170
#' @examples
7271
#' plan(batchtools_local)
7372
#'
7473
#' message("Main process ID: ", Sys.getpid())
7574
#'
7675
#' f <- future(Sys.getpid())
7776
#' pid <- value(f)
78-
#' message("Workers process ID: ", pid)
77+
#' message("Worker process ID: ", pid)
7978
#'
80-
#' @inheritParams BatchtoolsLocalFutureBackend
81-
#'
8279
#' @export
8380
batchtools_local <- function(...) {
8481
stop("INTERNAL ERROR: The future.batchtools::batchtools_local() must never be called directly")

R/batchtools_multicore.R

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#' @rdname BatchtoolsFutureBackend
2727
#' @keywords internal
2828
#'
29-
#' @aliases batchtools_custom batchtools_multicore
29+
#' @aliases batchtools_custom
3030
#' @importFrom batchtools makeClusterFunctionsMulticore
3131
#' @importFrom parallelly availableCores supportsMulticore
3232
#' @importFrom tools pskill
@@ -71,8 +71,30 @@ BatchtoolsMulticoreFutureBackend <- function(workers = availableCores(constraint
7171
}
7272

7373

74+
#' A batchtools backend that resolves futures in parallel via forked background R processes
75+
#'
76+
#' @inheritParams BatchtoolsFutureBackend
7477
#' @inheritParams BatchtoolsMulticoreFutureBackend
7578
#'
79+
#' @param \ldots Not used.
80+
#'
81+
#' @details
82+
#' Batchtools multicore futures use \pkg{batchtools} cluster functions
83+
#' created by [batchtools::makeClusterFunctionsMulticore()] with
84+
#' `ncpus = workers`.
85+
#'
86+
#' An alternative to the batchtools multicore backend is to use
87+
#' `plan(future::multicore)`.
88+
#'
89+
#' @examples
90+
#' plan(batchtools_multicore, workers = 2)
91+
#'
92+
#' message("Main process ID: ", Sys.getpid())
93+
#'
94+
#' f <- future(Sys.getpid())
95+
#' pid <- value(f)
96+
#' message("Worker process ID: ", pid)
97+
#'
7698
#' @export
7799
batchtools_multicore <- function(..., workers = availableCores(constraints = "multicore")) {
78100
stop("INTERNAL ERROR: The future.batchtools::batchtools_multicore() must never be called directly")

R/batchtools_template.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#' [TORQUE](https://en.wikipedia.org/wiki/TORQUE) / PBS
3333
#'
3434
#' @aliases BatchtoolsLsfFutureBackend BatchtoolsOpenLavaFutureBackend BatchtoolsSGEFutureBackend BatchtoolsSlurmFutureBackend BatchtoolsTorqueFutureBackend
35-
#' @aliases batchtools_lsf batchtools_openlava batchtools_sge batchtools_slurm batchtools_ssh batchtools_torque
35+
#' @aliases batchtools_lsf batchtools_openlava batchtools_sge batchtools_slurm batchtools_torque
3636
#'
3737
#' @importFrom batchtools makeClusterFunctionsLSF
3838
#' @importFrom batchtools makeClusterFunctionsOpenLava

incl/batchtools_local.R

Lines changed: 0 additions & 23 deletions
This file was deleted.

man/BatchtoolsFutureBackend.Rd

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

man/BatchtoolsTemplateFutureBackend.Rd

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/batchtools_bash.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)