Each par_*() function is currently a wrapper for parameter injection with a template (grid polygons, a list of file paths, or a field with stratifiable values). For better usability, a complete wrapper of a normal terra, sf, or chopin function code snippet can serve as a candidate. It automatically detects one of the parameters that is crucial for parallelization (e.g., what should be partitioned), then divides it into smaller pieces depending on a parallel processing mode. For example,
# input is the large input, which is to be partitioned
result <- foo(x = input, y = op, ...)
# prepare for parallelization
# auto-parallelize only by moving the RHS of the single-core (if not ordinary) execution code inside par_par (not a real name; only for demonstration)
result_par <-
chopin::par_par({
foo(x = input, y = op, ...)
})
Each
par_*()function is currently a wrapper for parameter injection with a template (grid polygons, a list of file paths, or a field with stratifiable values). For better usability, a complete wrapper of a normalterra,sf, orchopinfunction code snippet can serve as a candidate. It automatically detects one of the parameters that is crucial for parallelization (e.g., what should be partitioned), then divides it into smaller pieces depending on a parallel processing mode. For example,