Skip to content

Make (Rcpp)Eigen use threads the way (Rcpp)Armadillo does #144

@eddelbuettel

Description

@eddelbuettel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions