ExecutionEngine
Execution Engine
Description
Execution Engine
Execution Engine
Details
Execution Engine
Internal execution engine that orchestrates rule-based dependency resolution and scheduling for requested resources.
The execution engine exposes both:
-
resolve.async()returning an execution object. -
resolve()as a blocking wrapper around async execution.
Runtime backend details are isolated in private submit(), ready(), and collect() helpers so the worker implementation can be swapped later without changing scheduling logic.
Core allocation:
-
max.cores = NULLauto-detects available cores and uses at mostavailable - 1(minimum 1). -
Detection prefers
availableCores()and falls back to common scheduler/job environment variables (SLURM_CPUS_PER_TASK,SLURM_CPUS_ON_NODE,PBS_NP,NSLOTS,LSB_DJOB_NUMPROC,NCPUS,OMP_NUM_THREADS) and thenparallel::detectCores().
Active bindings
-
requested.max.cores -
Read-only user-requested max cores (
NULLmeans auto). -
max.cores -
Read-only maximum cores for batched execution.
-
max.memory -
Read-only maximum memory budget.
-
registry -
Read-only rule registry used by this execution engine.
Methods
Public methods
Method new()
Create a reactive execution engine.
Usage
ExecutionEngine$new( store, registry = NULL, max.cores = NULL, max.memory = Inf, execution.dir = NULL )
Arguments
-
store -
ResourceStore instance.
-
registry -
Optional RuleRegistry instance.
-
max.cores -
Maximum cores for batched execution.
NULL(default) auto-selects up to available cores minus one. -
max.memory -
Maximum memory budget.
-
execution.dir -
Optional execution working directory.
Method resolve()
Resolve output specs by using execution-engine scheduling and cache lookup.
Usage
ExecutionEngine$resolve( outputs, inputs = NULL, action = NULL, execution.status = NULL )
Arguments
-
outputs -
Output spec(s): single
ResourceSpec, list/vector ofResourceSpec, orResourceSpecSet. -
inputs -
Optional input spec(s) in the same accepted forms as
.arg outputs. -
action -
Optional label shown in execution-engine status output.
-
execution.status -
Optional execution-status mode override (
“auto”,“yes”,“no”).
Returns
ResourceSpec when one output is requested, otherwise list of ResourceSpec.
Method resolve.async()
Start async execution for requested outputs.
Usage
ExecutionEngine$resolve.async( outputs, inputs = NULL, action = NULL, execution.status = NULL )
Arguments
-
outputs -
Output spec(s): single
ResourceSpec, list/vector ofResourceSpec, orResourceSpecSet. -
inputs -
Optional input spec(s) in the same accepted forms as
.arg outputs. -
action -
Optional label shown in execution-engine status output.
-
execution.status -
Optional execution-status mode override (
“auto”,“yes”,“no”).
Returns
An execution object accepted by await().
Method await()
Wait for an async execution to finish.
Usage
ExecutionEngine$await(execution, poll.interval = 2, timeout = Inf)
Arguments
-
execution -
Execution object returned by
resolve.async(). -
poll.interval -
Poll interval in seconds while waiting for workers.
-
timeout -
Maximum wait time in seconds (
Inffor no timeout).
Returns
Invisibly returns the updated execution.
Method execute.status()
Get execution status.
Usage
ExecutionEngine$execute.status(execution)
Arguments
-
execution -
Execution object returned by
resolve.async().
Returns
Character status.
Method execute.summary()
Get execution summary.
Usage
ExecutionEngine$execute.summary(execution)
Arguments
-
execution -
Execution object returned by
resolve.async().
Returns
Named list summarizing execution-engine progress.
Method execute.graph()
Return execution dependency graph with node states.
Usage
ExecutionEngine$execute.graph(execution)
Arguments
-
execution -
Execution object returned by
resolve.async().
Returns
Named list with nodes, edges, and blocked.by data frames.
Method last.execution()
Return the most recently started execution.
Usage
ExecutionEngine$last.execution()
Returns
Execution object or NULL when no execution has run yet.
Method print()
Print execution-engine summary.
Usage
ExecutionEngine$print(...)
Arguments
-
… -
Unused.
Method clone()
The objects of this class are cloneable with this method.
Usage
ExecutionEngine$clone(deep = FALSE)
Arguments
-
deep -
Whether to make a deep clone.