Documenting / rethinking environment var STAN_NUM_THREADS

I think using environment variables is cumbersome and not what R/python users are accustomed to. And that is who are audience is.

I also understand why it was done this way. Partly that its used in parallel frameworks sometimes and partly because it was easier for testing/developing in Math because of the 3 repo structure. The latter is also why the Opencl context is initialized the way it is, which could be done in a simpler way if developed as a Stan-first and not Math-first component.

EDit: its also why MPI caching implementation is fairly complex. One of the reasons I am pushing for a monorepo.

2 Likes