Skip to content

Commit 76044da

Browse files
Rename exported objects 'MPI' and 'PSOCK' to 'RMPI' and 'RPSOCK'
1 parent 3cc2168 commit 76044da

7 files changed

+28
-18
lines changed

NAMESPACE

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ S3method(print,RichSOCKnode)
2929
S3method(stopCluster,RichMPIcluster)
3030
S3method(summary,RichSOCKcluster)
3131
S3method(summary,RichSOCKnode)
32-
export(MPI)
33-
export(PSOCK)
32+
export(RMPI)
33+
export(RPSOCK)
3434
export(as.cluster)
3535
export(autoStopCluster)
3636
export(availableConnections)

NEWS.md

+10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@
66
This means that as soon as it has been called, environment variables
77
such as `NSLOTS` will no longer be queried.
88

9+
* Starting with R 4.5.0 (currently R-devel), one can use
10+
`parallel::makeCluster(n, type = parallelly::RPSOCK)` as an
11+
alternative to `parallelly::makeClusterPSOCK(n)`. Similarly, `type
12+
= parallelly::RMPI` creates a cluster using
13+
`parallelly::makeClusterMPI()`, and `type = parallelly::SEQ`
14+
creates a cluster using `parallelly::makeClusterSequential()`.
15+
This was first introduced in **parallelly** 1.38.0, but here we rename
16+
`PSOCK` to `RPSOCK` and `MPI` to `RMPI` to minimize the risk for
17+
mistaking them from the built-in types in the **parallel** package.
18+
919
## Documentation
1020

1121
* Add more help on the R option `parallelly.maxWorkers.localhost`

R/makeClusterMPI.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Create a Message Passing Interface (MPI) Cluster of R Workers for Parallel Processing
1+
#' Create a Rich Message Passing Interface (MPI) Cluster of R Workers for Parallel Processing
22
#'
33
#' The `makeClusterMPI()` function creates an MPI cluster of \R workers
44
#' for parallel processing. This function utilizes
@@ -47,7 +47,7 @@
4747
#' @seealso
4848
#' [makeClusterPSOCK()] and [parallel::makeCluster()].
4949
#'
50-
#' @aliases MPI
50+
#' @aliases RMPI
5151
#' @importFrom parallel makeCluster
5252
#' @export
5353
makeClusterMPI <- function(workers, ..., autoStop = FALSE, verbose = getOption2("parallelly.debug", FALSE)) {

R/makeClusterPSOCK.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Create a PSOCK Cluster of R Workers for Parallel Processing
1+
#' Create a Rich PSOCK Cluster of R Workers for Parallel Processing
22
#'
33
#' The `makeClusterPSOCK()` function creates a cluster of \R workers
44
#' for parallel processing. These \R workers may be background \R sessions
@@ -128,7 +128,7 @@
128128
#'
129129
#' @example incl/makeClusterPSOCK.R
130130
#'
131-
#' @aliases PSOCK
131+
#' @aliases RPSOCK
132132
#' @importFrom parallel stopCluster
133133
#' @export
134134
makeClusterPSOCK <- function(workers, makeNode = makeNodePSOCK, port = c("auto", "random"), user = NULL, ..., autoStop = FALSE, tries = getOption2("parallelly.makeNodePSOCK.tries", 3L), delay = getOption2("parallelly.makeNodePSOCK.tries.delay", 15.0), validate = getOption2("parallelly.makeNodePSOCK.validate", TRUE), verbose = getOption2("parallelly.debug", FALSE)) {

R/registerClusterTypes.R

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
## Register makeClusterMPI() and makeClusterPSOCK() as a cluster types
22
## such that they can be created using parallel::makeCluster(), e.g.
3-
## cl <- parallel::makeCluster(..., type = parallelly::PSOCK)
3+
## cl <- parallel::makeCluster(..., type = parallelly::RPSOCK)
44

5-
#' @rawNamespace export(MPI)
6-
MPI <- "parallelly::MPI"
5+
#' @rawNamespace export(RMPI)
6+
RMPI <- "parallelly::RMPI"
77

8-
#' @rawNamespace export(PSOCK)
9-
PSOCK <- "parallelly::PSOCK"
8+
#' @rawNamespace export(RPSOCK)
9+
RPSOCK <- "parallelly::RPSOCK"
1010

1111
#' @rawNamespace if (getRversion() >= "4.4") export(SEQ)
1212
SEQ <- "parallelly::SEQ"
@@ -26,9 +26,9 @@ registerClusterTypes <- local({
2626
## WORKAROUND: 'R CMD build' somehow creates and calls this function
2727
## twice, resulting in warnings from parallel::registerClusterType().
2828
suppressWarnings({
29-
registerClusterType(MPI, makeClusterMPI, make.default = FALSE)
30-
registerClusterType(PSOCK, makeClusterPSOCK, make.default = FALSE)
31-
registerClusterType(SEQ, makeClusterSequential, make.default = FALSE)
29+
registerClusterType(RMPI, makeClusterMPI, make.default = FALSE)
30+
registerClusterType(RPSOCK, makeClusterPSOCK, make.default = FALSE)
31+
registerClusterType(SEQ, makeClusterSequential, make.default = FALSE)
3232
})
3333
done <<- TRUE
3434
}

man/makeClusterMPI.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/makeClusterPSOCK.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)