Skip to content
  • Xavier Valls Pla's avatar
    [IMT] Add a function to compute best number of threads for IMT. · bab74f41
    Xavier Valls Pla authored
    * Add a function to retrieve the most appropriate number of threads
    by checking for cpu scheduler cgroup files in /sys/fs/cgroup.
    * When inside a cgroup with cpu limits (e.g. docker on SWAN), use
    cfs_quota and cfs_period to compute the best number of threads
    accordingly. This prevents starting more threads than execution slots,
    which leads to context-switch overhead that slows down the execution.
    * If no cgroup files are found or if not on linux, fall back to TBB's default,
    the number of logical cores. Users can override all defaults by giving on
    explicit number in EnableIMT().
    * Initialise TPoolManager with new defaults.
    bab74f41
Loading