Converts either an absolute thread count or a proportion of available CPU
cores into an integer number of worker threads. The number of available cores
is determined by parallel::detectCores().
Value
An integer-like numeric scalar giving the normalized number of worker threads. A message reports the selected and available thread counts.
Details
Absolute thread counts exceeding the number of cores reported by
parallel::detectCores() are silently capped to that limit with a message.
Values less than or equal to zero and non-numeric inputs produce an error.
This function is also used by refine_records() to normalize its threads
argument.
