Skip to content

Commit e40b833

Browse files
committed
update docs and rely on release nanonext
1 parent 5a10265 commit e40b833

File tree

15 files changed

+117
-118
lines changed

15 files changed

+117
-118
lines changed

.github/workflows/check-standard.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141

4242
- name: Add r-universe to repos
4343
run: |
44-
cat("\noptions(repos=c(RMV='https://shikokuchuo.r-universe.dev',CRAN ='https://cloud.r-project.org'))\n", file = "~/.Rprofile", append = TRUE)
44+
cat("\noptions(repos=c(RMV='https://community.r-multiverse.org',CRAN ='https://cloud.r-project.org'))\n", file = "~/.Rprofile", append = TRUE)
4545
shell: Rscript {0}
4646

4747
- uses: r-lib/actions/setup-r-dependencies@v2

.github/workflows/pkgdown.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131

3232
- name: Add r-universe to repos
3333
run: |
34-
cat("\noptions(repos=c(RMV='https://shikokuchuo.r-universe.dev',CRAN ='https://cloud.r-project.org'))\n", file = "~/.Rprofile", append = TRUE)
34+
cat("\noptions(repos=c(RMV='https://community.r-multiverse.org',CRAN ='https://cloud.r-project.org'))\n", file = "~/.Rprofile", append = TRUE)
3535
shell: Rscript {0}
3636

3737
- uses: r-lib/actions/setup-r-dependencies@v2

.github/workflows/rhub.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
job-config: ${{ matrix.config.job-config }}
5959
- name: Add r-universe to repos
6060
run: |
61-
cat("\noptions(repos=c(RMV='https://shikokuchuo.r-universe.dev',CRAN ='https://cloud.r-project.org'))\n", file = "~/.Rprofile", append = TRUE)
61+
cat("\noptions(repos=c(RMV='https://community.r-multiverse.org',CRAN ='https://cloud.r-project.org'))\n", file = "~/.Rprofile", append = TRUE)
6262
shell: Rscript {0}
6363
- uses: r-hub/actions/setup-deps@v1
6464
with:

.github/workflows/test-coverage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525

2626
- name: Add r-universe to repos
2727
run: |
28-
cat("\noptions(repos=c(RMV='https://shikokuchuo.r-universe.dev',CRAN ='https://cloud.r-project.org'))\n", file = "~/.Rprofile", append = TRUE)
28+
cat("\noptions(repos=c(RMV='https://community.r-multiverse.org',CRAN ='https://cloud.r-project.org'))\n", file = "~/.Rprofile", append = TRUE)
2929
shell: Rscript {0}
3030

3131
- uses: r-lib/actions/setup-r-dependencies@v2

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: mirai
22
Type: Package
33
Title: Minimalist Async Evaluation Framework for R
4-
Version: 1.1.1.9019
4+
Version: 1.1.1.9020
55
Description: Designed for simplicity, a 'mirai' evaluates an R expression
66
asynchronously in a parallel process, locally or distributed over the
77
network, with the result automatically available upon completion. Modern
@@ -27,7 +27,7 @@ Encoding: UTF-8
2727
Depends:
2828
R (>= 3.6)
2929
Imports:
30-
nanonext (>= 1.1.1.9018)
30+
nanonext (>= 1.2.0)
3131
Enhances:
3232
parallel,
3333
promises

NEWS.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# mirai 1.1.1.9019 (development)
1+
# mirai 1.1.1.9020 (development)
22

33
* `everywhere()` adds argument '.serial' to accept serialization configurations created by `serial_config()`. These allow normally non-exportable reference objects such as Arrow Tables or torch tensors to be used seamlessly across parallel processes without additional marshalling steps. Configurations apply on a per compute profile basis.
44
* `serialization()` is now deprecated in favour of the above usage of `everywhere()`, and will be removed in a future version.
@@ -7,9 +7,10 @@
77
* Collecting a 'mirai_map' no longer spuriously introduces empty names where none were present originally.
88
* Faster local `daemons(dispatcher = FALSE)` and `make_cluster()` by using asynchronous launches (thanks @mtmorgan #123).
99
* Local dispatcher daemons now synchronize with host, the same as non-dispatcher daemons (prevents use before all have connected).
10+
* Fixes rare cases of `everywhere()` not reaching all daemons when using dispatcher.
1011
* More efficient dispatcher startup by only loading the base package, in addition to not reading startup configurations (thanks @krlmlr).
1112
* Removes hard dependency on `stats` and `utils` base packages.
12-
* Requires `nanonext` >= [1.1.1.9018].
13+
* Requires `nanonext` >= 1.2.0.
1314

1415
# mirai 1.1.1
1516

R/mirai.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ everywhere <- function(.expr, ..., .args = list(), .serial = NULL, .compute = "d
264264
.expr <- c(.register, .expr)
265265
.args <- c(.args, list(.serial = .serial))
266266
`opt<-`(envir[["sock"]], "serial", .serial)
267-
`[[<-`(envir, "serial", .serial)
268267
}
269268

270269
if (is.null(envir[["sockc"]])) {

README.Rmd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Whilst the async operation is ongoing, attempting to access a mirai's data yield
5656
m
5757
m$data
5858
```
59-
To check whether a mirai remains unresolved i.e. its async operation is still ongoing:
59+
To check whether a mirai remains unresolved (yet to complete):
6060
```{r unres}
6161
unresolved(m)
6262
```
@@ -91,8 +91,8 @@ Daemons may also be deployed [remotely](https://shikokuchuo.net/mirai/articles/m
9191

9292
```{r map}
9393
df <- data.frame(
94-
fruit = c("melon", "pear", "coconut"),
95-
price = c(5L, 1L, 2L)
94+
fruit = c("melon", "grapes", "coconut"),
95+
price = c(3L, 5L, 2L)
9696
)
9797
m <- mirai_map(df, sprintf, .args = list(fmt = "%s: $%d"))
9898
```

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,7 @@ m$data
6464
#> 'unresolved' logi NA
6565
```
6666

67-
To check whether a mirai remains unresolved i.e. its async operation is
68-
still ongoing:
67+
To check whether a mirai remains unresolved (yet to complete):
6968

7069
``` r
7170
unresolved(m)
@@ -76,7 +75,7 @@ To wait for and collect the return value, use the mirai’s `[]` method:
7675

7776
``` r
7877
m[]
79-
#> [1] 6.275195 6.697046 7.518985 6.332227 6.446677
78+
#> [1] 5.735529 7.862045 6.024613 7.572171 5.791506
8079
```
8180

8281
As a mirai represents an async operation, it is never necessary to wait
@@ -90,7 +89,7 @@ while (unresolved(m)) {
9089
m
9190
#> < mirai [$data] >
9291
m$data
93-
#> [1] 6.275195 6.697046 7.518985 6.332227 6.446677
92+
#> [1] 5.735529 7.862045 6.024613 7.572171 5.791506
9493
```
9594

9695
#### Daemons
@@ -124,8 +123,8 @@ rows of a dataframe or matrix.
124123

125124
``` r
126125
df <- data.frame(
127-
fruit = c("melon", "pear", "coconut"),
128-
price = c(5L, 1L, 2L)
126+
fruit = c("melon", "grapes", "coconut"),
127+
price = c(3L, 5L, 2L)
129128
)
130129
m <- mirai_map(df, sprintf, .args = list(fmt = "%s: $%d"))
131130
```
@@ -140,7 +139,7 @@ progress indicators.
140139
m
141140
#> < mirai map [3/3] >
142141
m[.flat]
143-
#> [1] "melon: $5" "pear: $1" "coconut: $2"
142+
#> [1] "melon: $3" "grapes: $5" "coconut: $2"
144143
```
145144

146145
All errors are returned as ‘errorValues’, facilitating recovery from

vignettes/mirai.Rmd

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ m
5151
m$data
5252
#> 'unresolved' logi NA
5353
```
54-
To check whether a mirai remains unresolved i.e. its async operation is still ongoing:
54+
To check whether a mirai remains unresolved (yet to complete):
5555

5656
``` r
5757
unresolved(m)
@@ -61,15 +61,15 @@ To wait for and collect the return value, use the mirai's `[]` method:
6161

6262
``` r
6363
m[]
64-
#> [1] 5.035731 2.525158 4.462494 4.866664 5.847000
64+
#> [1] 4.686698 3.649466 5.643721 5.237069 3.828488
6565
```
6666
As a mirai represents an async operation, it is never necessary to wait for it. Other code can continue to be run. Once it completes, the return value automatically becomes available at `$data`.
6767

6868
``` r
6969
m
7070
#> < mirai [$data] >
7171
m$data
72-
#> [1] 5.035731 2.525158 4.462494 4.866664 5.847000
72+
#> [1] 4.686698 3.649466 5.643721 5.237069 3.828488
7373
```
7474
For easy programmatic use of `mirai()`, '.expr' accepts a pre-constructed language object, and also a list of named arguments passed via '.args'. So, the following would be equivalent to the above:
7575

@@ -81,7 +81,7 @@ args <- list(time = x$time, mean = x$mean)
8181

8282
m <- mirai(.expr = expr, .args = args)
8383
m[]
84-
#> [1] 3.481751 4.707875 4.207655 5.762250 2.692773
84+
#> [1] 4.812297 4.021603 3.333087 4.998890 3.676835
8585
```
8686

8787
[&laquo; Back to ToC](#table-of-contents)
@@ -158,11 +158,11 @@ for (i in 1:10) {
158158
#> iteration 1 successful
159159
#> iteration 2 successful
160160
#> iteration 3 successful
161-
#> Error: random error
162161
#> iteration 4 successful
163162
#> iteration 5 successful
164163
#> iteration 6 successful
165164
#> iteration 7 successful
165+
#> Error: random error
166166
#> iteration 8 successful
167167
#> iteration 9 successful
168168
#> iteration 10 successful
@@ -199,12 +199,12 @@ status()
199199
#>
200200
#> $daemons
201201
#> i online instance assigned complete
202-
#> abstract://9ac5654134c5ea197184df9e 1 1 1 0 0
203-
#> abstract://090d4c6e7211e5108bd04164 2 1 1 0 0
204-
#> abstract://abaee2eee2558d736d801a2a 3 1 1 0 0
205-
#> abstract://a4eaa8fa5e705a6037a28705 4 1 1 0 0
206-
#> abstract://edb7f2c078d439aed2ca3b3b 5 1 1 0 0
207-
#> abstract://e74f405d21b249c69c88bec4 6 1 1 0 0
202+
#> abstract://a0b81e5334b04e1434e37552 1 1 1 0 0
203+
#> abstract://8ff80f924503294749199213 2 1 1 0 0
204+
#> abstract://b082aab5aad836d568dac23a 3 1 1 0 0
205+
#> abstract://6ff7d4056fb2d0d447fcad00 4 1 1 0 0
206+
#> abstract://67005db15f4748b788093372 5 1 1 0 0
207+
#> abstract://3a1ba8fb052d8544585e7c0b 6 1 1 0 0
208208
```
209209
The default `dispatcher = TRUE` creates a `dispatcher()` background process that connects to individual daemon processes on the local machine. This ensures that tasks are dispatched efficiently on a first-in first-out (FIFO) basis to daemons for processing. Tasks are queued at the dispatcher and sent to a daemon as soon as it can accept the task for immediate execution.
210210

@@ -233,7 +233,7 @@ status()
233233
#> [1] 6
234234
#>
235235
#> $daemons
236-
#> [1] "abstract://3447f493f716be0137955a97"
236+
#> [1] "abstract://1561773b749829cf1e118973"
237237
```
238238
This implementation sends tasks immediately, and ensures that tasks are evenly-distributed amongst daemons. This means that optimal scheduling is not guaranteed as the duration of tasks cannot be known *a priori*. As an example, tasks could be queued at a daemon behind a long-running task, whilst other daemons are idle having already completed their tasks.
239239

@@ -261,11 +261,11 @@ m <- mirai(capture.output(str(con)))
261261
m[]
262262
#> [1] "Formal class 'SQLiteConnection' [package \"RSQLite\"] with 8 slots"
263263
#> [2] " ..@ ptr :<externalptr> "
264-
#> [3] " ..@ dbname : chr \"/tmp/RtmpMRdBww/file3d141b7a2d72\""
264+
#> [3] " ..@ dbname : chr \"/tmp/RtmpKgiYbm/file6ecd76c526ac\""
265265
#> [4] " ..@ loadable.extensions: logi TRUE"
266266
#> [5] " ..@ flags : int 70"
267267
#> [6] " ..@ vfs : chr \"\""
268-
#> [7] " ..@ ref :<environment: 0x5d47b3fff338> "
268+
#> [7] " ..@ ref :<environment: 0x5c4ae4950318> "
269269
#> [8] " ..@ bigint : chr \"integer64\""
270270
#> [9] " ..@ extended_types : logi FALSE"
271271
```
@@ -356,7 +356,7 @@ By specifying `dispatcher = FALSE`, remote daemons connect directly to the host
356356

357357
``` r
358358
daemons(url = host_url(), dispatcher = FALSE)
359-
#> [1] "tcp://hostname:40087"
359+
#> [1] "tcp://hostname:40369"
360360
```
361361
Note that above, calling `host_url()` without a port value uses the default of '0'. This is a wildcard value that will automatically cause a free ephemeral port to be assigned. The actual assigned port is provided in the return value of the call, or it may be queried at any time via `status()`.
362362

@@ -370,7 +370,7 @@ status()
370370
#> [1] 0
371371
#>
372372
#> $daemons
373-
#> [1] "tcp://hostname:40087"
373+
#> [1] "tcp://hostname:40369"
374374
```
375375
To reset all connections and revert to default behaviour:
376376

@@ -457,10 +457,10 @@ daemons(n = 2, url = host_url())
457457
#> [1] 2
458458
launch_remote(1:2)
459459
#> [1]
460-
#> Rscript -e 'mirai::daemon("tcp://hostname:41643",rs=c(10407,-1333183123,-1821263542,-1849417149,-770713944,-616731511,456908470))'
460+
#> Rscript -e 'mirai::daemon("tcp://hostname:42061",rs=c(10407,65206378,-1681371421,978039496,964317737,-1891049514,1351556191))'
461461
#>
462462
#> [2]
463-
#> Rscript -e 'mirai::daemon("tcp://hostname:42847",rs=c(10407,-1917107425,-704481308,1750322114,1991745078,-659632702,-603397324))'
463+
#> Rscript -e 'mirai::daemon("tcp://hostname:42401",rs=c(10407,-789354243,-1756126780,-884928208,-2037464012,-229484652,-49442703))'
464464
daemons(0)
465465
#> [1] 0
466466
```
@@ -487,37 +487,37 @@ The generated self-signed certificate is available via `launch_remote()`. This f
487487
``` r
488488
launch_remote(1)
489489
#> [1]
490-
#> Rscript -e 'mirai::daemon("wss://hostname:35191/1",tls=c("-----BEGIN CERTIFICATE-----
490+
#> Rscript -e 'mirai::daemon("wss://hostname:45045/1",tls=c("-----BEGIN CERTIFICATE-----
491491
#> MIIFNzCCAx+gAwIBAgIBATANBgkqhkiG9w0BAQsFADAzMREwDwYDVQQDDAhrdW1h
492492
#> bW90bzERMA8GA1UECgwITmFub25leHQxCzAJBgNVBAYTAkpQMB4XDTAxMDEwMTAw
493493
#> MDAwMFoXDTMwMTIzMTIzNTk1OVowMzERMA8GA1UEAwwIa3VtYW1vdG8xETAPBgNV
494494
#> BAoMCE5hbm9uZXh0MQswCQYDVQQGEwJKUDCCAiIwDQYJKoZIhvcNAQEBBQADggIP
495-
#> ADCCAgoCggIBAM4WX01vQyMpV2jWSeT/mhrGCWxZu6AXFpeOcZmiLWBgaT+EOoVZ
496-
#> C2caPAuxbTkqqAB8omXmwwxO/chouYZQNEuGdCXYimDsb+q5HLRnQknM03DzwWDV
497-
#> l00d3t/JrdQrjxU04wdzizeQTFyON5xWz8ie64QJE7RezBYtIALoSt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3QNuu9dbTCwL51MrAkrEOtCKmR/Y
505+
#> 9wRlv5UaimZ8fvkBGR5I+yLwh9A9MjCJLQ3WjaUHSkSOdB//lSdt8oplAgMBAAGj
506+
#> VjBUMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFB8Aqw5F7Jcln6PzU9ZV
507+
#> Aiw5HiSCMB8GA1UdIwQYMBaAFB8Aqw5F7Jcln6PzU9ZVAiw5HiSCMA0GCSqGSIb3
508+
#> DQEBCwUAA4ICAQAPgcjF428G/AzD4H9lmAzKLRIj+4m9s9JwX3fvXc8GjGFQp0ej
509+
#> gtw+CDAls7EgrF1vB2Hgx2BeqdOK2oW2JBvTWqubMxkGkgjs7frF/ANhTG45pvcd
510+
#> gY525bKbSYpL4P4wb0C31WoA0832HpMduJztjW/qFBsknOvqpZunf6mywvr1lgtL
511+
#> lI2Vt0KtqqgAGvwRrhzuiJ5gQbzX4D244OKAU5CWq3F9ER63nL9/Fe9D4LbwmHYd
512+
#> Y7a021gQGyiXoqj1FLp9sq11HxWgL6oAVfklHF8RI01BUiqSKRJ05y1p2pIJAgH6
513+
#> XkrM86SGLYoxQQ/zoAcek1aPRWMYGYLOng+FejvjVbunaazq9+evzN8bZEuM8fTH
514+
#> JCyg6omOF6gS+Dkvub8QLZUFOA43pJ1GWuSwcEadX4HR7mZ1Gog8a2jQ8UnTHg6m
515+
#> 0K+GIP2SvwcMcSX/4t0zUpwHBm4+UD66wMCS7RDDt0fExTALyDSMA+80OmDRDott
516+
#> 6v9YLQ4ILm8TZvsLAn+hSR32MzMbMkPh19sG+thBAwbYRByTvX86Y1m+o6biVu+n
517+
#> alJeEYJNSxVBCG6HoMOFsqIItjyVdGNu5YtRcxOL1cCDXtz+9i/WJb3HRgoQtFCu
518+
#> jQem+uQorPXNjESw5WjLg4UPLRS9d4WGQo9Sa4xPyOPPB4Q8CZ6OeIdgmw==
519519
#> -----END CERTIFICATE-----
520-
#> ",""),rs=c(10407,1853456881,618089214,-1171000473,-1302518660,-1276345523,-1705177686))'
520+
#> ",""),rs=c(10407,526850812,2095802317,1687455786,-1643828317,-117557112,-2063979287))'
521521
```
522522
The printed value may be deployed directly on a remote machine.
523523

@@ -749,10 +749,10 @@ daemons(4)
749749
vec <- c(1, 1, 4, 4, 1, 1, 1, 1)
750750
system.time(mirai_map(vec, Sys.sleep)[])
751751
#> user system elapsed
752-
#> 0.000 0.008 4.008
752+
#> 0.005 0.002 4.006
753753
system.time(parLapply(cl, vec, Sys.sleep))
754754
#> user system elapsed
755-
#> 0.008 0.006 8.011
755+
#> 0.010 0.000 8.012
756756
```
757757
`.args` is used to specify further constant arguments to `.f` - the 'mean' and 'sd' in the example below:
758758

@@ -762,13 +762,13 @@ with(
762762
mirai_map(1:3, rnorm, .args = list(mean = 20, sd = 2))[]
763763
)
764764
#> [[1]]
765-
#> [1] 18.30614
765+
#> [1] 18.72358
766766
#>
767767
#> [[2]]
768-
#> [1] 22.89714 19.74490
768+
#> [1] 21.81064 20.25435
769769
#>
770770
#> [[3]]
771-
#> [1] 20.94216 17.98050 18.15185
771+
#> [1] 20.00686 19.66549 18.66953
772772
```
773773
Use `...` to further specify objects referenced but not defined in `.f` - the 'do' in the anonymous function below:
774774

@@ -783,13 +783,13 @@ ml
783783
#> < mirai map [3/3] >
784784
ml[]
785785
#> $a
786-
#> [1] "39"
786+
#> [1] "e0"
787787
#>
788788
#> $b
789-
#> [1] ff 1c
789+
#> [1] 84 de
790790
#>
791791
#> $c
792-
#> [1] "9eaf02"
792+
#> [1] "4d73ce"
793793
```
794794
Use of `mirai_map()` assumes that `daemons()` have previously been set. If not then one (non-dispatcher) daemon is set to allow the function to proceed. This ensures safe behaviour, but is unlikely to be optimal, so please ensure daemons are set beforehand.
795795

vignettes/mirai.Rmd.orig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Whilst the async operation is ongoing, attempting to access a mirai's data yield
5353
m
5454
m$data
5555
```
56-
To check whether a mirai remains unresolved i.e. its async operation is still ongoing:
56+
To check whether a mirai remains unresolved (yet to complete):
5757
```{r unres}
5858
unresolved(m)
5959
```

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy