Archived issue #0028199
Foundation Classes - Add possibility to set number of threads for parallel execution
Description
Nowadays OCCT library contains set of algorithms with parallel sections. Now it is possible to turn on parallel mode and not possible to set number of threads.
Public activity
3 archived notes
Participants are labeled by their role within this record.
Since OSD_ThreadPool introduction by #0029935 it is now possible specifying number of threads within OSD_ThreadPool::Launcher constructor (to specify lower amount of threads from pool) and within OSD_ThreadPool constructor / OSD_ThreadPool::Init() to specify amount of threads in pool.
This does not affect properties of TBB pool, when it is used instead of OSD pool.
This does not affect properties of TBB pool, when it is used instead of OSD pool.
Just an idea to consider may be during this patch preparation. BO has the option IsParallel. If the user does not set it to true he expects all the code will run in one thread. But the code of GeomLib_CheckCurveOnSurface is always called in multi-thread mode (the argument of Perform() method isTheMultyTheradDisabled = Standard_False).
So, in order to make consistent behavior of the code regarding the flag myRunParallel of BO, it is needed to pass this flag through the chain of calls BOPAlgo_PaveFiller::PerformFF() -> IntTools_FaceFace -> IntTools_Tools::ComputeTolerance() -> GeomLib_CheckCurveOnSurface::Perform().
So, in order to make consistent behavior of the code regarding the flag myRunParallel of BO, it is needed to pass this flag through the chain of calls BOPAlgo_PaveFiller::PerformFF() -> IntTools_FaceFace -> IntTools_Tools::ComputeTolerance() -> GeomLib_CheckCurveOnSurface::Perform().
Main logic - to hide thread number into a single interface and keep this number actual for general OSD_Parallel:For TBB, Threads, OMP, and STD implementations.
OMP and TBB need to call specific global static functions.
Additionally, it will help to disable the general multithreading of OCCT-based solutions(when 0 is the maximum thread number).
A maximum number of threads will be applied and used, especially for cases with servers.
OMP and TBB need to call specific global static functions.
Additionally, it will help to disable the general multithreading of OCCT-based solutions(when 0 is the maximum thread number).
A maximum number of threads will be applied and used, especially for cases with servers.
Related records
- #0026365 · related to · closedOptimization of work of OSD_Parallel class members for GeomLib_CheckCurveOnSurface
- #0033625 · related to · newFoundation Classes - for_each parallel integration for c++17
- #0033626 · related to · newFoundation Classes - for_each parallel integration based on OMP
- #0030573 · parent of · closedOSD_Parallel_TBB: limit number of execution threads using settings of OSD_ThreadPool::DefaultPool()
- #0029935 · related to · closedFoundation Classes - introduce OSD_ThreadPool class defining a thread pool