EDI uses an empirical, blocklist-first dispatch policy to decide when an
inference routine's "bootstrap" or "rand_ci" resampling should
be forced serial even if multiple cores are available (see
get_parallel_dispatch_policy for the built-in table and the
PCRE pattern/response-type matching rules it encodes). This function lets
the user update that policy at runtime without editing package internals.
Value
Invisible NULL when policy is supplied (a mutation), or
invisibly the current policy configuration list when called for its
side-effect-free query/reset value.
Details
The policy can be updated in two mutually exclusive ways:
Pass a named list to
policyto merge with the current policy configuration viamodifyList, one section at a time. Supported top-level keys arebootstrapandrand_ci, and each key's value is itself a list that may containserial_inference_class_patterns(character vector of PCRE regular expressions) and/orserial_response_types(character vector of exact response-type strings); an unrecognized top-level key raises an error rather than being silently ignored.Pass a custom function with signature
function(inference_class, response_type, operation)topolicyto replace the entire pattern-table dispatch logic with your own rule; it must return a list with at leastforce_serial(logical) andreason(character). Supplying a function clears any list-based overrides accumulated so far and is stored separately from the pattern-table configuration.
Use reset = TRUE to discard both the list-based overrides and any
custom function, restoring the package's built-in default policy exactly as
returned by get_parallel_dispatch_policy. Do not expect a
universal "more cores is faster" rule — this policy exists because several
resampling workloads have shown consistent multicore slowdowns in
package benchmarks.
See also
get_parallel_dispatch_policy for the policy schema and
built-in defaults (including why this table is a safety blocklist, not
a performance one); set_num_cores for setting the actual
worker-count upper bound this policy operates within;
tune_EDI_for_this_machine for the separate,
machine-dependent question of when parallel execution is
worthwhile (never applied here — this policy is only ever
overridden explicitly, by you).
