SBC icon indicating copy to clipboard operation
SBC copied to clipboard

Automatically detect globals in gen quants

Open martinmodrak opened this issue 3 years ago • 1 comments

To use generated_quantities with parallel processing, the user currently has to manually provide a list of "globals": A list of names of objects that are defined in the global environment and need to present for the gen. quants. to evaluate. It is added to the globals argument to [future::future()], to make those objects available on all workers.

We should be able to detect those globals automatically by inspecting the syntax trees of the expressions (this is presumably how future does it's autodetction.

martinmodrak avatar Sep 06 '21 18:09 martinmodrak

It appears the globals package could make this a breeze (https://cran.r-project.org/web/packages/globals/index.html)

martinmodrak avatar Jul 08 '22 16:07 martinmodrak