From a2f0df33fb4d40f19e579d568329307a9b7a22cd Mon Sep 17 00:00:00 2001 From: shikokuchuo <53399081+shikokuchuo@users.noreply.github.com> Date: Wed, 30 Oct 2024 14:52:52 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20shikokuc?= =?UTF-8?q?huo/mirai@a555938332fc47ede3c946114733c3cb4b98cd46=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- articles/mirai.html | 124 ++++++++++++++++++----------------- pkgdown.yml | 2 +- reference/host_url.html | 10 +-- reference/remote_config.html | 2 +- reference/serial_config.html | 4 +- search.json | 2 +- 6 files changed, 73 insertions(+), 71 deletions(-) diff --git a/articles/mirai.html b/articles/mirai.html index 14b9a229d..3ca967a27 100644 --- a/articles/mirai.html +++ b/articles/mirai.html @@ -154,7 +154,7 @@
[]
method:
m[]
-#> [1] 3.809949 3.009536 3.580907 4.174612 3.275564
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
.
m
#> < mirai [$data] >
m$data
-#> [1] 3.809949 3.009536 3.580907 4.174612 3.275564
+#> [1] 4.021118 4.931766 5.243967 3.375100 5.667178
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
@@ -174,7 +174,7 @@
The default dispatcher = "process"
creates a
dispatcher()
background process that connects to individual
daemon processes on the local machine. This ensures that tasks are
@@ -341,7 +342,7 @@
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 @@ -374,14 +375,14 @@
m <- mirai(capture.output(str(con)))
m[]
-#> [1] "Formal class 'SQLiteConnection' [package \"RSQLite\"] with 8 slots"
-#> [2] " ..@ ptr :<externalptr> "
-#> [3] " ..@ dbname : chr \"/tmp/RtmpzXpeSH/file34b5234a60eea\""
-#> [4] " ..@ loadable.extensions: logi TRUE"
-#> [5] " ..@ flags : int 70"
-#> [6] " ..@ vfs : chr \"\""
-#> [7] " ..@ ref :<environment: 0x5df816664b50> "
-#> [8] " ..@ bigint : chr \"integer64\""
+#> [1] "Formal class 'SQLiteConnection' [package \"RSQLite\"] with 8 slots"
+#> [2] " ..@ ptr :<externalptr> "
+#> [3] " ..@ dbname : chr \"/tmp/Rtmp8RYD0H/file38fb134e0316\""
+#> [4] " ..@ loadable.extensions: logi TRUE"
+#> [5] " ..@ flags : int 70"
+#> [6] " ..@ vfs : chr \"\""
+#> [7] " ..@ ref :<environment: 0x56e93a2ecdf8> "
+#> [8] " ..@ bigint : chr \"integer64\""
#> [9] " ..@ extended_types : logi FALSE"
Disconnect from the database everywhere, and set the number of daemons to zero to reset.
@@ -518,7 +519,7 @@The number of daemons connecting to the host URL is not limited and network resources may be added or removed at any time, with tasks automatically distributed to all connected daemons.
@@ -600,17 +601,18 @@remote_config()
may be used to run a command to deploy
daemons using a resource manager.
Taking Slurm as an example, the following uses srun
to
+
Taking Slurm as an example, the following uses sbatch
to
launch 2 daemons on the cluster, with some additional arguments to
-srun
specifying the resource allocation:
sbatch
specifying the resource allocation:
daemons(
n = 2,
url = host_url(ws = TRUE),
remote = remote_config(
- command = "srun",
- args = c("--mem 512", "-n 1", "."),
- rscript = file.path(R.home("bin"), "Rscript")
+ command = "sbatch",
+ args = c("--mem 512", "-n 1", "--wrap", "."),
+ rscript = file.path(R.home("bin"), "Rscript"),
+ quote = TRUE
)
)
Note that daemons()
should be set up on the host machine
@@ -666,37 +668,37 @@
launch_remote(1)
#> [1]
-#> Rscript -e 'mirai::daemon("wss://hostname:45635/1",tls=c("-----BEGIN CERTIFICATE-----
+#> Rscript -e 'mirai::daemon("wss://hostname:33667/1",tls=c("-----BEGIN CERTIFICATE-----
#> MIIFNzCCAx+gAwIBAgIBATANBgkqhkiG9w0BAQsFADAzMREwDwYDVQQDDAhrdW1h
#> bW90bzERMA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1OU8olRgjycRuxqJI+zBMlepUk+
+#> jYGcMp4mczoK+KCqZI9BR5M4hs4nurE2QDaeEW8gC6tM4KlP5O+dI+CjXb8QV6IZ
+#> VgfxXVSch+9LpCynaQf+JdomygH35d+XYsps7KjkASJeig9poT7QdDqpWSAyID21
+#> RAWLnGaioVrEqp5SDiVEGyh0bX4fmSFWXv1TorfLDNbB1GAm6pGXn8yLjQ==
#> -----END CERTIFICATE-----
-#> ",""),rs=c(10407,1672045068,-894820451,225659322,-372605965,-77358952,-166139463))'
+#> ",""),rs=c(10407,-190365515,-1460862478,1356191947,1879828880,1039554641,2031211998))'
The printed value may be deployed directly on a remote machine.
@@ -1005,10 +1007,10 @@.args
is used to specify further constant arguments to
.f
- the ‘mean’ and ‘sd’ in the example below:
@@ -1017,13 +1019,13 @@Key advantages: mirai_map(1:3, rnorm, .args = list(mean = 20, sd = 2))[] ) #> [[1]] -#> [1] 21.78985 +#> [1] 20.27145 #> #> [[2]] -#> [1] 20.14001 17.18939 +#> [1] 20.55287 22.25358 #> #> [[3]] -#> [1] 20.35270 20.68685 22.75893
Use ...
to further specify objects referenced but not
defined in .f
- the ‘do’ in the anonymous function
below:
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
diff --git a/pkgdown.yml b/pkgdown.yml
index b2052d2b2..b75bd5c2d 100644
--- a/pkgdown.yml
+++ b/pkgdown.yml
@@ -9,7 +9,7 @@ articles:
promises: promises.html
shiny: shiny.html
torch: torch.html
-last_built: 2024-10-30T14:45Z
+last_built: 2024-10-30T14:52Z
urls:
reference: https://shikokuchuo.net/mirai/reference
article: https://shikokuchuo.net/mirai/articles
diff --git a/reference/host_url.html b/reference/host_url.html
index 8bdafaddd..e171d3b95 100644
--- a/reference/host_url.html
+++ b/reference/host_url.html
@@ -109,16 +109,16 @@
host_url()
-#> [1] "tcp://fv-az569-105:0"
+#> [1] "tcp://fv-az661-991:0"
host_url(ws = TRUE)
-#> [1] "ws://fv-az569-105:0"
+#> [1] "ws://fv-az661-991:0"
host_url(tls = TRUE)
-#> [1] "tls+tcp://fv-az569-105:0"
+#> [1] "tls+tcp://fv-az661-991:0"
host_url(ws = TRUE, tls = TRUE, port = 5555)
-#> [1] "wss://fv-az569-105:5555"
+#> [1] "wss://fv-az661-991:5555"
local_url()
-#> [1] "abstract://62806b3c386ff17f3d95d156"
+#> [1] "abstract://b303001ab17932607922a093"
[default FALSE] logical value whether or not to quote the daemon launch command (not required for Slurm ‘srun’ for example, but -required for ‘ssh’).