-
Notifications
You must be signed in to change notification settings - Fork 42
Description
While doing some work updating and overhauling (Rcpp)Armadillo last summer and fall, we also revisited / simplified some of the threading (including as always a redo of what macOS does; let's leave that aside for now).
I carried some of that over to RcppEigen as well so that by default we get all cores (if a user opts in). I still have that code here and had been meaning to reach out to 'interested parties': @jaganmn @bbolker @bgoodri @SteveBronder come to mind.
My current thinking is that we should be able to set something up that 'does no harm' (i.e. defaults to a max of two threads unless told otherwise to not cause harm at CRAN) but goes beyond if suitable local environment variables or config settings are found. So the current status quo, as I recall it, is that
- package RcppEigen ignores the existence of OpenMP around R,
RcppEigen:::EigenNbThreads()(which existed for years) return 1 - just by adding 'use OpenMP where is exists' we can do better, i.e. on my machine I now get all cores (which would upset CRAN)
- we just decide which throttling mechanism we like
- ie maybe borrow the data.table one which uses 50%
- and/or combine with a configuration variable as I once did for
tiledb
Thoughts? I'll try what I have here (uncommitted, and it isn't much yet) into another branch