Skip to content

Commit 21552e1

Browse files
authored
Update docs for some cases of missed cluster_config() (#386)
* Update parallel vignette for omission found in #382 * Also make update in main `make_cluster()` docs
1 parent 25fff3e commit 21552e1

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

R/parallel.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
#' connections, e.g. 'tcp://10.75.37.40:5555'. Specify a URL with the scheme
1717
#' 'tls+tcp://' to use secure TLS connections.
1818
#' @param remote \[default NULL\] (specify to launch remote nodes) a remote
19-
#' launch configuration generated by [remote_config()] or [ssh_config()]. If
20-
#' not supplied, nodes may be deployed manually on remote resources.
21-
#' @param ... additional arguments passed onto [daemons()].
19+
#' launch configuration generated by [ssh_config()], [cluster_config()] or
20+
#' [remote_config()]. If not supplied, nodes may be deployed manually on
21+
#' remote resources.
22+
#' @param ... additional arguments passed to [daemons()].
2223
#'
2324
#' @return For **make_cluster**: An object of class 'miraiCluster' and
2425
#' 'cluster'. Each 'miraiCluster' has an automatically assigned ID and `n`

dev/vignettes/_v04-parallel.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This function calls `make_cluster()`, which may also be used to create a 'miraiC
2525

2626
+ Specify 'n' to launch nodes on the local machine.
2727
+ Specify 'url' for receiving connections from remote nodes.
28-
+ Optionally, specify 'remote' to launch remote daemons using a remote configuration generated by `remote_config()` or `ssh_config()`.
28+
+ Optionally, specify 'remote' to launch remote daemons using a remote configuration generated by `ssh_config()`, `cluster_config` or `remote_config()`.
2929

3030
Created clusters may be used for any function in the `parallel` base package such as `parallel::clusterApply()` or `parallel::parLapply()`, or the load-balanced versions such as `parallel::parLapplyLB()`.
3131
```{r}

man/make_cluster.Rd

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

vignettes/v04-parallel.Rmd

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ This function calls `make_cluster()`, which may also be used to create a 'miraiC
1818

1919
+ Specify 'n' to launch nodes on the local machine.
2020
+ Specify 'url' for receiving connections from remote nodes.
21-
+ Optionally, specify 'remote' to launch remote daemons using a remote configuration generated by `remote_config()` or `ssh_config()`.
21+
+ Optionally, specify 'remote' to launch remote daemons using a remote configuration generated by `ssh_config()`, `cluster_config` or `remote_config()`.
2222

2323
Created clusters may be used for any function in the `parallel` base package such as `parallel::clusterApply()` or `parallel::parLapply()`, or the load-balanced versions such as `parallel::parLapplyLB()`.
2424

@@ -28,7 +28,7 @@ library(mirai)
2828

2929
cl <- makeCluster(6, type = "MIRAI")
3030
cl
31-
#> < miraiCluster | ID: `1` nodes: 6 active: TRUE >
31+
#> < miraiCluster | ID: `0` nodes: 6 active: TRUE >
3232
parLapply(cl, iris, mean)
3333
#> $Sepal.Length
3434
#> [1] 5.843333
@@ -54,7 +54,7 @@ status(cl)
5454
#> [1] 6
5555
#>
5656
#> $daemons
57-
#> [1] "abstract://1ffa515b477cb048623e8a7c"
57+
#> [1] "ipc:///tmp/8262e7fcb3b17b9f4a1260cf"
5858
stopCluster(cl)
5959
```
6060

@@ -65,10 +65,10 @@ cl <- make_cluster(n = 2, url = host_url())
6565
#> Shell commands for deployment on nodes:
6666
#>
6767
#> [1]
68-
#> Rscript -e 'mirai::daemon("tcp://192.168.1.71:36061",dispatcher=FALSE,cleanup=FALSE,rs=c(10407,608223508,314351877,910111234,-668523109,970783776,-1964800607))'
68+
#> Rscript -e 'mirai::daemon("tcp://192.168.7.12:49778",dispatcher=FALSE,cleanup=FALSE,rs=c(10407,-1371709182,102090907,-1019444448,-314728287,-1138569746,977403287))'
6969
#>
7070
#> [2]
71-
#> Rscript -e 'mirai::daemon("tcp://192.168.1.71:36061",dispatcher=FALSE,cleanup=FALSE,rs=c(10407,1589879997,1665986728,-2021887029,-1113401414,1948876325,1799837871))'
71+
#> Rscript -e 'mirai::daemon("tcp://192.168.7.12:49778",dispatcher=FALSE,cleanup=FALSE,rs=c(10407,-2003393061,101709059,-2143338667,404319410,-1028859762,-51192095))'
7272
stop_cluster(cl)
7373
```
7474

@@ -92,10 +92,10 @@ registerDoParallel(cl)
9292
m <- matrix(rnorm(9), 3, 3)
9393
foreach(i = 1:nrow(m), .combine = rbind) %dopar%
9494
(m[i, ] / mean(m[i, ]))
95-
#> [,1] [,2] [,3]
96-
#> result.1 0.5373009 1.073723 1.388976
97-
#> result.2 -8.7848778 7.635917 4.148961
98-
#> result.3 -3.6102409 10.285887 -3.675646
95+
#> [,1] [,2] [,3]
96+
#> result.1 3.213601 -0.2546854 0.0410841
97+
#> result.2 -1.581967 7.0901582 -2.5081915
98+
#> result.3 1.459975 -0.4330745 1.9730994
9999

100100
# simple parallel matrix multiply
101101
a <- matrix(1:16, 4, 4)

0 commit comments

Comments
 (0)