Executes a set of registered diagnostics in parallel when multiple CPU cores are available, falling back to sequential execution otherwise.
Arguments
- model
Fitted model object passed to each diagnostic. Must be compatible with the internal
.test_factoryregistry.- data
Data frame used to fit
modeland supplied to each diagnostic.- tests
Character vector naming the diagnostics to execute.
- n_cores
Optional positive integer giving the number of worker processes to spawn. Defaults to
parallel::detectCores() - 1, with a lower bound of 1.
Details
When n_cores exceeds one and the parallel package is available, the helper
evaluates the diagnostics via parallel::parLapply() after exporting the
model and data to the worker environment. On systems without fork support the
function gracefully reverts to sequential execution.
See also
cachedTest() for memoised execution of individual diagnostics.