Releases: shikokuchuo/mirai
Releases · shikokuchuo/mirai
mirai 1.2.0
everywhere()
adds argument '.serial' to accept serialization configurations created byserial_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.serialization()
is now deprecated in favour of the above usage ofeverywhere()
, and will be removed in a future version.mirai_map()
enhanced to perform multiple map over 2D lists/vectors, allowing advanced patterns such as mapping over the rows of a dataframe or matrix.- 'mirai_map'
[]
method gains the option[.flat]
to collect and flatten results, avoiding coercion. - Collecting a 'mirai_map' no longer spuriously introduces empty names where none were present originally.
- Faster local
daemons(dispatcher = FALSE)
andmake_cluster()
by using asynchronous launches (thanks @mtmorgan #123). - Local dispatcher daemons now synchronize with host, the same as non-dispatcher daemons (prevents use before all have connected).
- Fixes rare cases of
everywhere()
not reaching all daemons when using dispatcher. - More efficient dispatcher startup by only loading the base package, in addition to not reading startup configurations (thanks @krlmlr).
- Removes hard dependency on
stats
andutils
base packages. - Requires
nanonext
>= 1.2.0.
mirai 1.1.1
serialization()
function signature and return value slightly modified for clarity. Successful registration / cancellation messages are no longer printed to the console.dispatcher()
argument 'retry' now defaults to FALSE for consistency with non-dispatcher behaviour.remote_config()
gains argument 'quote' to control whether or not to quote the daemon launch command, and now works with Slurm (thanks @michaelmayer2 #119).- Ephemeral daemons now exit as soon as permissible, eliminating the 2s linger period.
- Requires
nanonext
>= 1.1.1.
mirai 1.1.0
- Adds
mirai_map()
for asynchronous parallel/distributed map usingmirai
, withpromises
integration. Allows recovery from partial failure or else early stopping, together with optional progress reporting.x[]
collects the results of a mirai_mapx
, waiting for all asynchronous operations to complete.x[.progress]
collects the results whilst showing a text progress bar.x[.stop]
collects the results applying early-stopping, which stops at the first error, and aborts remaining in-progress operations.
- Adds the 'mirai' method
x[]
as a more efficient equivalent of the interruptiblecall_mirai_(x)$data
. - Adds
collect_mirai()
as a more efficient equivalent of the non-interruptiblecall_mirai(x)$data
. unresolved()
,call_mirai()
,collect_mirai()
andstop_mirai()
now accept a list of 'mirai' such as that returned bymirai_map()
.- Improved mirai print method indicates whether a mirai has resolved.
- Calling
daemons()
with new settings when the compute profile is already set now implicitly resets daemons before applying the new settings instead of silently doing nothing. - Argument 'resilience' retired at
daemons()
as automatic re-tries are no longer performed for non-dispatcher daemons. - New argument 'retry' at
dispatcher()
governs whether to auto-retry in the dispatcher case. - Fixes promises method for potential crashes when launching improbably short-lived mirai.
- Fixes bug that could cause a hang or crash when launching additional non-dispatcher daemons.
- Requires
nanonext
>= 1.1.0.
mirai 1.0.0
- Implements completely event-driven (non-polling) promises (thanks @jcheng5 for prototyping).
- This is an innovation which allows higher responsiveness and massive scalability for 'mirai' promises.
- Behavioural changes to
mirai()
andeverywhere()
:- (breaking change) no longer permits an unnamed list to be supplied to '.args'.
- allows an environment e.g.
environment()
to be supplied to '.args' or as the only element of '...'. - allows evaluation of a symbol in the 'mirai' environment, e.g.
mirai(x, x = 1)
.
ssh_config()
improvements:- new argument 'host' allows specifying the localhost URL and port to create a standalone configuration object.
- order of arguments 'tunnel' and 'timeout' reversed.
stop_mirai()
now resolves to an 'errorValue' 20 (operation canceled) in the case the asynchronous task was still ongoing (thanks @jcheng5 #110).- Rejected promises now show the complete error code and message in the case of an 'errorValue'.
- A 'miraiError' reverts to not including a trailing line break (as prior to mirai 0.13.2).
- Non-dispatcher local daemons now synchronize with host in all cases (prevents use before all have connected).
[
method for 'miraiCluster' no longer produces a 'miraiCluster' object (thanks @HenrikBengtsson #83).- Faster startup time as the
parallel
package is now only loaded when first used. - Requires
nanonext
>= 1.0.0.
mirai 0.13.2
mirai()
andeverywhere()
behaviour changed such that '...' args are now assigned to the global environment of the daemon process.- Adds
with()
method for mirai daemons, allowing for example:with(daemons(4), {expr})
, where the daemons last for the duration of 'expr'. - Adds
register_cluster()
for registering 'miraiCluster' as a parallel Cluster type (requires R >= 4.4). - Adds
is.promising()
method for 'mirai' for the promises package. - A 'miraiError' now includes the full call stack, which may be accessed at
$stack.trace
, and includes the trailing line break for consistency with 'as.character.error()'. - mirai promises now preserve deep stacks when a 'miraiError' occurs within a Shiny app (thanks @jcheng5 #104).
- Simplified registration for 'parallel' and 'promises' methods (thanks @jcheng5 #103).
- Fixes to promises error handling and Shiny vignette (thanks @jcheng5 #98 #99).
- Requires R >= 3.6.
mirai 0.13.1
- Fixes regression in mirai 0.12.1, which introduced the potential for unintentional low level errors to emerge when querying dispatcher (thanks @dsweber2 for reporting in downstream {targets}).
mirai 0.13.0
serialization
adds arguments 'class' and 'vec' for custom serialisation of all reference object types.- Requires nanonext >= 0.13.3.
CRAN release 0.12.1
- Dispatcher initial sync timeout widened to 10s to allow for launching large numbers of daemons.
- Default for
ssh_config()
argument 'timeout' widened to 10 (seconds). - Fixes
daemons()
specifying 'output = FALSE' registering as TRUE instead. - Fixes use of
everywhere()
specifying '.args' as an unnamed list or '.expr' as a language object. - Ensures compatibility with nanonext >= 0.13.0.
- Internal performance enhancements.
CRAN release 0.12.0
- More minimal print methods for 'mirai' and 'miraiCluster'.
- Adds
local_url()
helper to construct a random inter-process communications URL for local daemons (thanks @noamross #90). daemon()
argument 'autoexit' now accepts a signal value such astools::SIGINT
in order to raise it upon exit.daemon()
now records the state of initial global environment objects (e.g. those created in .Rprofile) for cleanup purposes (thanks @noamross #91).- Slightly more optimal
as.promise()
method for 'mirai'. - Eliminates potential memory leaks along certain error paths.
- Requires nanonext >= 0.12.0.
CRAN release 0.11.3
- Implements
serialization()
for registering custom serialization and unserialization functions when using daemons. - Introduces
call_mirai_()
, a user-interruptible version ofcall_mirai()
suitable for interactive use. - Simplification of
mirai()
interface:- '.args' will now coerce to a list if an object other than a list is supplied, rather than error.
- '.signal' argument removed - now all 'mirai' signal if daemons are set up.
everywhere()
now returns invisible NULL in the case the specified compute profile is not set up, rather than error.mirai()
specifying a timeout whendaemons()
has not been set - the timeout begins immediately rather than after the ephemeral daemon has connected - please factor in a small amount of time for the daemon to launch.make_cluster()
now prints daemon launch commands where 'url' is specified without 'remote' whether or not interactive.- Cluster node failures during load balanced operations now rely on the 'parallel' mechanism to error and no longer fail early or automatically stop the cluster.
- Fixes regression since 0.11.0 which prevented dispatcher exiting in a timely manner when tasks are backlogged (thanks @wlandau #86).
- Improved memory efficiency and stability at dispatcher.
- No longer loads the 'promises' package if not already loaded (but makes the 'mirai' method available via a hook function).
- Requires nanonext >= 0.11.0.