thresholdForks() with this host's state: the R heap in use (each fork is a copy-on-write image of this process that diverges as the garbage collector marks the heap, so budget one heap per fork; the gc() call also leaves less garbage to copy), the memory available, the busy threads, parallelly::availableCores() and options(mc.cores), and capped by the host's load (fireSenseUtils::nThreads()). In a Slurm job given part of the node (parallelly::availableCores() below parallel::detectCores()) the busy threads and the load are other jobs' and are ignored, as clusters:::.limitToJob() does. Used by the start population and the "powerLaw" calibration, so several fits on one host, or a fit run inside a cluster worker, share the same caps.

forkBudget(nTasks)

Arguments

nTasks

integer; number of tasks to spread over the forks.

Value

integer, at least 1.