View Issue Details

IDProjectCategoryView StatusLast Update
0026365Open CASCADEOCCT:Foundation Classespublic2021-05-29 13:12
ReporternbvAssigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Target Version7.6.0Fixed in Version7.6.0 
Summary0026365: Optimization of work of OSD_Parallel class members for GeomLib_CheckCurveOnSurface
DescriptionExisting OCCT parallelization algorithm (without TBB) requires using many system resources (it creates a thread for every parallel process) and much time (time spent on thread creation sometimes is much more than time for execution this thread).

It is not optimal and we need to recode this algorithm.
Steps To ReproduceNot required
Additional information
and documentation updates
1. See OSD_Parallel class. Especially, OSD_Parallel::For(...) member.

2. After the fix, please change the following fragment of BRepLib_CheckCurveOnSurface::Compute(...) method:

#ifdef HAVE_TBB
  OSD_Parallel::For(anIntervals.Lower(), anIntervals.Upper(), aComp);
#else
  ...
  OSD_Parallel::For(anIntervals.Lower(), anIntervals.Upper(), aComp, Standard_True);
#endif

should be replaced with
OSD_Parallel::For(anIntervals.Lower(), anIntervals.Upper(), aComp);
TagsNo tags attached.
Test case numberNot required

Relationships

related to 0026506 closedbugmaster Open CASCADE Change class BRepLib_CheckCurveOnSurface 
related to 0028931 closedbugmaster Open CASCADE Eliminate dependency from TBB in OSD_Parallel header 
related to 0028199 assigneddpasukhi Open CASCADE Foundation Classes - Add possibility to set number of threads for parallel execution 
related to 0022146 closedabv Open CASCADE Foundation Classes - Integration of OCC in-house parallelization tool 
related to 0029935 closedbugmaster Open CASCADE Foundation Classes - introduce OSD_ThreadPool class defining a thread pool 
related to 0029059 closedbugmaster Open CASCADE Modeling Algorithms - It is necessary to have a unique way of checking of the validity of the edge and its 2D curves 

Activities

msv

2015-06-23 15:41

developer   ~0042363

Dear Andrey, please include this task in planning.

git

2019-01-10 16:39

administrator   ~0081722

Branch CR26365 has been created by kgv.

SHA-1: 1984a15e669e7f8567d13956ed65a71966b72809


Detailed log of new commits:

Author: kgv
Date: Thu Jan 10 16:35:25 2019 +0300

    0026365: Optimization of work of OSD_Parallel class members for GeomLib_CheckCurveOnSurface
    
    Removed workaround within GeomLib_CheckCurveOnSurface.

kgv

2019-01-10 20:44

developer   ~0081733

The issue with threads re-creation has been handled within patch for 0029935.

This bug describes the problem, but does not provide any reproducer nor numbers, so that it is difficult to check how parallelization affects performance in this particular case.

Patch CR26365 removes HAVE_TBB check; through it is desired verifying performance - hints / test cases are welcome.

msv

2019-01-11 09:32

developer   ~0081743

Dear Nikolay, could you recommend the test cases to check performance of the considered code?

nbv

2019-01-11 10:11

developer   ~0081744

Last edited: 2019-01-11 10:53

Unfortunately I do not remember all problematic test cases. However, you can find the tests where following DRAW commands are used: "xdistef", "checkcurveonsurf".

Additionally, this algorithm has already been implemented in "bopargcheck" algorithm and in FACE/FACE intersection algorithm called from Boolean operation.

Please try to switch on Parallel mode option in corresponding test cases and check their performance.

msv

2019-01-11 10:48

developer   ~0081749

Last edited: 2019-01-11 10:48

Actually, this algorithm works each time when intersection of 2 faces is performed inside PaveFiller. I.e., during each Boolean operation. So, any BO test can be impacted by this change if HAVE_TBB is not defined.
There is another simple way to call this code from Draw, it is to run the command:

checkcurveonsurf shape

It will call this code for each pcurve of the shape.

I have another concern about this patch. 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().

I propose to include this change in the current patch.

msv

2019-01-11 11:10

developer   ~0081750

My proposed above change can be done later in scope of another bug, e.g. linked 0028199. And the current patch is worth to be integrated as is.

msv

2019-01-11 11:14

developer   ~0081752

For simplicity, please just run the standard tests to check the patch if there is no regressions in no HAVE_TBB mode.

git

2019-04-02 12:39

administrator   ~0083357

Branch CR26365_1 has been created by kgv.

SHA-1: 35785ecaa27eee8a7e7a9b1cc466bf6fa4132655


Detailed log of new commits:

Author: kgv
Date: Thu Jan 10 16:35:25 2019 +0300

    0026365: Optimization of work of OSD_Parallel class members for GeomLib_CheckCurveOnSurface
    
    Removed workaround within GeomLib_CheckCurveOnSurface.

msv

2021-05-25 20:40

developer   ~0101367

Dear Kirill, please rebase the patch and test it.

git

2021-05-26 15:48

administrator   ~0101395

Branch CR26365_2 has been created by kgv.

SHA-1: 91c69af4983d19e5403a33c60984135c38b61ce8


Detailed log of new commits:

Author: kgv
Date: Thu Jan 10 16:35:25 2019 +0300

    0026365: Optimization of work of OSD_Parallel class members for GeomLib_CheckCurveOnSurface
    
    Removed workaround within GeomLib_CheckCurveOnSurface.

kgv

2021-05-26 17:34

developer   ~0101402

Last edited: 2021-05-26 17:35

Rebased patch has been pushed
- OCCT: branch CR26365_2.

http://jenkins-test-occt/view/CR26365_2-master-KGV/
(de/step_4/G6 is unstable on Jenkins within this week)

msv

2021-05-26 18:35

developer   ~0101407

Please raise CR26365_2 into occt.

bugmaster

2021-05-29 12:02

administrator   ~0101473

Combination -
OCCT branch : IR-2021-05-28
master SHA - 2315a044240803013da63dd2f5209c739ab03727
a87b7ddc8cb44606b91e3f37113847c3f5f50fdc
Products branch : IR-2021-05-28 SHA - 2131ac830b9e3c707d427f2aac9c50dcfa5c74db
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 17574.5700000004 / 17867.41000000037 [-1.64%]
Products
Total CPU difference: 11533.700000000124 / 11535.680000000108 [-0.02%]
Windows-64-VC14:
OCCT
Total CPU difference: 19393.5625 / 19367.75 [+0.13%]
Products
Total CPU difference: 12891.8125 / 12920.9375 [-0.23%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2021-05-29 13:12

administrator   ~0101484

Branch CR26365 has been deleted by mnt.

SHA-1: 1984a15e669e7f8567d13956ed65a71966b72809

git

2021-05-29 13:12

administrator   ~0101485

Branch CR26365_1 has been deleted by mnt.

SHA-1: 35785ecaa27eee8a7e7a9b1cc466bf6fa4132655

git

2021-05-29 13:12

administrator   ~0101486

Branch CR26365_2 has been deleted by mnt.

SHA-1: 91c69af4983d19e5403a33c60984135c38b61ce8

Related Changesets

occt: master 3738565a

2019-01-10 13:35:25

kgv


Committer: bugmaster Details Diff
0026365: Optimization of work of OSD_Parallel class members for GeomLib_CheckCurveOnSurface

Removed workaround within GeomLib_CheckCurveOnSurface.
Affected Issues
0026365
mod - src/BOPAlgo/BOPAlgo_CheckerSI.cxx Diff File
mod - src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx Diff File
mod - src/BOPTest/BOPTest_BOPCommands.cxx Diff File
mod - src/GeomLib/GeomLib_CheckCurveOnSurface.cxx Diff File
mod - src/IntTools/IntTools_FaceFace.cxx Diff File
mod - src/IntTools/IntTools_FaceFace.hxx Diff File
mod - src/IntTools/IntTools_Tools.cxx Diff File
mod - src/IntTools/IntTools_Tools.hxx Diff File

Issue History

Date Modified Username Field Change
2015-06-23 14:28 nbv New Issue
2015-06-23 14:28 nbv Assigned To => msv
2015-06-23 15:41 msv Note Added: 0042363
2015-06-23 15:41 msv Assigned To msv => abv
2015-07-31 16:02 nbv Relationship added related to 0026506
2016-11-03 17:07 abv Target Version 7.1.0 => 7.2.0
2017-04-15 18:10 kgv Relationship added related to 0028657
2017-04-15 18:48 kgv Relationship deleted related to 0028657
2017-07-20 12:34 kgv Relationship added related to 0028199
2017-07-20 12:37 kgv Relationship added related to 0022146
2017-07-26 16:41 abv Target Version 7.2.0 => 7.4.0
2017-08-11 13:05 apv Test case number => Not required
2017-08-11 13:07 oan Relationship added related to 0028931
2018-07-07 02:32 kgv Relationship added related to 0029935
2019-01-10 16:38 kgv Summary Optimization of work of OSD_Parallel class members => Optimization of work of OSD_Parallel class members for GeomLib_CheckCurveOnSurface
2019-01-10 16:39 git Note Added: 0081722
2019-01-10 20:44 kgv Note Added: 0081733
2019-01-10 20:44 kgv Assigned To abv => msv
2019-01-10 20:44 kgv Status new => feedback
2019-01-11 09:31 msv Assigned To msv => nbv
2019-01-11 09:32 msv Note Added: 0081743
2019-01-11 10:04 msv Assigned To nbv => msv
2019-01-11 10:11 nbv Note Added: 0081744
2019-01-11 10:48 msv Note Added: 0081749
2019-01-11 10:48 msv Note Edited: 0081749
2019-01-11 10:53 nbv Note Edited: 0081744
2019-01-11 11:10 msv Note Added: 0081750
2019-01-11 11:14 msv Note Added: 0081752
2019-01-11 11:14 msv Assigned To msv => kgv
2019-01-11 11:14 msv Status feedback => assigned
2019-04-02 12:39 git Note Added: 0083357
2019-08-13 12:04 kgv Target Version 7.4.0 => 7.5.0
2020-09-11 16:13 utverdov Target Version 7.5.0 => 7.6.0
2021-04-21 17:17 asuraven Relationship added related to 0029059
2021-05-25 20:40 msv Note Added: 0101367
2021-05-26 15:48 git Note Added: 0101395
2021-05-26 17:34 kgv Note Added: 0101402
2021-05-26 17:34 kgv Assigned To kgv => msv
2021-05-26 17:34 kgv Status assigned => resolved
2021-05-26 17:35 kgv Note Edited: 0101402
2021-05-26 18:35 msv Note Added: 0101407
2021-05-26 18:35 msv Assigned To msv => bugmaster
2021-05-26 18:35 msv Status resolved => reviewed
2021-05-29 12:02 bugmaster Note Added: 0101473
2021-05-29 12:02 bugmaster Status reviewed => tested
2021-05-29 12:12 bugmaster Changeset attached => occt master 3738565a
2021-05-29 12:12 bugmaster Status tested => verified
2021-05-29 12:12 bugmaster Resolution open => fixed
2021-05-29 13:12 git Note Added: 0101484
2021-05-29 13:12 git Note Added: 0101485
2021-05-29 13:12 git Note Added: 0101486