View Issue Details

IDProjectCategoryView StatusLast Update
0022600CommunityOCCT:Meshpublic2012-11-09 10:06
Reporterszy Assigned Tobugmaster  
Status closedResolutionfixed 
Target Version6.5.2Fixed in Version6.5.2 
Summary0022600: TBB has to be disabled in BRepMesh due to data races
DescriptionRLN contribution (RLN_fix460)
- Summary: TBB has to be disabled in BRepMesh due to data races.
- Detailed description: On some shape configurations (e.g. shared subshapes)
there are data races when computing points on B-Splines. See detailed
explanation in
  There are several options:
  1. Remove TBB from BRepMesh - quick, easy but withdraws all advantages of
multi-core support (which was a strong message of the release)
  2. Fix BRepMesh to traverse partner shapes without repetition. It will allow
to compute triangulation only once.
  3. Remove cache use in Geom/Geom2d_BSpline/Bezier Surface/Curve, or make it
user parameter-based (off by default). This will help avoid such data races in
many other places. I think this can be the best option.

Current fix just uses 1 solution (workaround), final solution to be elaborated.
TagsNo tags attached.
Test case numberTest case is not required

Attached Files

  • kgv-OCC22600-EMesh-v1.tar.gz (665 bytes)


related to 0022584 closedRoman Lygin Community Optimization of BRepMesh_DiscretFactory to cache registered factory methods 
related to 0022647 closedsan Open CASCADE Memory leak in BRepMesh_DiscretFactory  
child of 0022825 closedabv Community Integration of contributions by Roman Lygin to OCCT 6.5.2 



2011-06-16 19:36

developer   ~0017662

SVN branch http://svn/svn/occt/branches/OCC22600_BrepmeshDisableTbb for
this BUG reviewed and completelly rejected.

Intel TBB (and HAVE_TBB macro) currently used in OCCT only BRepMesh package.
Additionally disabling the code that already isolated with HAVE_TBB macro is
superfluous. Current multithreading triangulation should be either heeled or
documented as broken indicating it experimental state and unready for
industrial usage.


2011-06-23 19:09

developer   ~0017663

Currently mesh parallelization controlled in not obvious manner (HAVE_TBB
macros + Standard::IsReentrant()).

Within new patch this control now given directly to BRepMesh classes as a non-
global field accessed via SetParallel() / IsParallel() public methods. Thus
user can explicitly choose desired behaviour.

BRepMesh_DiscretFactory was completelly redesigned to resolve several problems.
Discret() method now returns Handle instead of pointer to private field in the
global Factory. Plugin connection now performed in method SetDefault() and
cached thus Discret() method become offloaded and just create new Meshing tool

New method SetParallelDefault() was added to BRepMesh_IncrementalMesh to
control default parallelization flag for Factory. DRAWEXE command mpparallel
allow to switch this flag on fly.

Notice that Standard::IsReentrant() will be removed or turned on by default
within another fix to ensure thread-safety of memory manager.

BRepMesh_DiscretFactory is suggested to be moved to TKBRep toolkit and its
concretization to TKV3d toolkit for clarity where this factory is really used
(in AIS visualization) but currently leaved in TKBrepMesh toolkit.

All changes integrated to http://svn/svn/occt/branches/OCC22600 branch.


2011-06-23 19:13

developer   ~0017664

Dear Bugmaster,

please assign this BUG to me
and perform regression tests for http://svn/svn/occt/branches/OCC22600 branch.

2011-07-13 12:17


kgv-OCC22600-EMesh-v1.tar.gz (665 bytes)


2011-07-13 12:40

tester   ~0017665

Last edited: 2011-11-22 17:47

Dear BugMaster,
Error on extraction procedure

=====> QMesh:xcpp.fill
Info : Direct use : /../KAS/dev/ycy-occt-3/src/BRepMesh/BRepMesh.cdl
Info : Used : /../KAS/dev/ycy-occt-3/src/Plugin/Plugin.cdl
Info : Generic :
Info : Complete : /../KAS/dev/ycy-products-3/src/QMesh/QMesh_Discret.cdl
Info : Type used : /../KAS/dev/ycy-occt-3/src/BRepMesh/BRepMesh_Vertex.cdl
Info : Type used :
Info : Type used :
Info : Type used : /../KAS/dev/ycy-occt-3/src/BRepMesh/BRepMesh_Edge.cdl
Info : Type used : /../KAS/dev/ycy-occt-3/src/BRepMesh/BRepMesh_Triangle.cdl
Info : Type used : /../KAS/dev/ycy-occt-3/src/BRepMesh/BRepMesh_BiPoint.cdl
Info : Type used :
Info : Type used :
Info : Type used :
Error : the method QMesh_Discret::Perform() cannot have the keyword 'out' but
'mutable' because it's comes from a Persistent or a Transient class.
Error : Check of QMesh has failed
Error : Failed during execution
Info : Step xcpp.fill
Error : Step xcpp.fill failed
Error : Step xcpp.src not done : almost QMesh:xcpp.fill failed
Error : Step xcpp.header not done : almost QMesh:xcpp.fill failed
Error : Step xcpp.template not done : almost QMesh:xcpp.fill failed


2011-07-13 14:18

developer   ~0017667

>Error on extraction procedure
Express mesh is not in OCCT but in the products.


2011-08-10 15:45

tester   ~0017954

Dear BugMaster,
Error on extraction procedure
=====> QMesh:obj.comp
Error : Output file list of step (xcpp.src) is not available
Error : Please perform this step before using step : obj.comp
Error : Failed during WOKMake_Step::GetInputFlow
Error : Failed during getting input list
Info : Step obj.comp
Error : Step obj.comp failed


2011-08-11 12:02

developer   ~0017959

could you please provide more detailed log for building errors?
Your quotations are mostly indicate the FACT of error(s) but not EXACTLY error(s).

Your last error doesn't reproduced on Windows platform with configuration:
- OCCT, http://svn/svn/occt/branches/OCC22600
- Products, trunk + patch 'kgv-OCC22600-EMesh-v1.tar.gz' applied

=====> QMesh:obj.comp
Info : -------> QMesh.cxx
Info : -------> QMesh_Discret.cxx
Info : Generating build file
Info : Step obj.comp is successfull


2011-09-02 12:59

tester   ~0018064

Dear BugMaster,
Created SVN branch http://svn/svn/occt-products/branches/OCC22600


2011-09-02 14:28

tester   ~0018067

Last edited: 2011-11-22 17:48

Dear BugMaster,
SVN branch ( http://svn/svn/occt/branches/OCC22600 ) was
testing, test results were compared with KAS:dev:products-20110810-opt

There are not regressions in SVN branch ( http://svn/svn/occt/branches/OCC22600 ) regarding to

See results in /QADisk/occttests/results/KAS/dev/ycy-products-3_01092011/lin
See reference results in /QADisk/occttests/results/KAS/dev/products-20110810-opt_11082011/lin
See test cases in /QADisk/occttests/tests/ED
N.B. In order to launch testing case you can make use the following instructions
http://doc/doku.php?id=occt:certification [^]


2011-09-07 12:39

administrator   ~0018081

Integration into trunk of occt repository

Date: 2011-09-07 12:30:31 +0400 (Wed, 07 Sep 2011)
New Revision: 8972


Integration into trunk of occt-products repository

Date: 2011-09-07 12:36:50 +0400 (Wed, 07 Sep 2011)
New Revision: 18194



2011-09-29 11:32

developer   ~0018284

There is a small mistake in integrated patch.
Two new methods in BRepMesh_FastDiscret are declared but not implemented (::SetParallel() and ::IsParallel()). Found by Salome team.


2011-09-29 11:34

developer   ~0018285

Patch was corrected and pushed to branch http://svn/svn/occt/branches/OCC22600 (only file BRepMesh_FastDiscret.cxx was changed). No need for testing company because these methods are not in use.


2011-09-30 11:02

administrator   ~0018293

Integration to trunk of occt repository

Date: 2011-09-30 10:49:56 +0400 (Fri, 30 Sep 2011)
New Revision: 9141


BRepMesh_FastDiscret class, added missed ::SetParallel(), ::IsParallel() methods implementations.

Related Changesets

occt: master 0b97567d

2011-09-07 08:30:31


Committer: bugmaster Details Diff
0022600: TBB has to be disabled in BRepMesh due to data races Affected Issues
mod - src/BRepMesh/BRepMesh.cdl Diff File
mod - src/BRepMesh/BRepMesh_DiscretFactory.cdl Diff File
mod - src/BRepMesh/BRepMesh_DiscretFactory.cxx Diff File
mod - src/BRepMesh/BRepMesh_DiscretRoot.cdl Diff File
mod - src/BRepMesh/BRepMesh_DiscretRoot.cxx Diff File
mod - src/BRepMesh/BRepMesh_FastDiscret.cdl Diff File
mod - src/BRepMesh/BRepMesh_FastDiscret.cxx Diff File
mod - src/BRepMesh/BRepMesh_IncrementalMesh.cdl Diff File
mod - src/BRepMesh/BRepMesh_IncrementalMesh.cxx Diff File
add - src/BRepMesh/BRepMesh_PluginEntryType.hxx Diff File
mod - src/BRepMesh/FILES Diff File
mod - src/MeshTest/MeshTest_PluginCommands.cxx Diff File
mod - src/Plugin/Plugin.cdl Diff File
mod - src/Prs3d/Prs3d_ShadedShape.gxx Diff File

occt: master 0981302b

2011-09-30 06:42:58


Committer: bugmaster Details Diff
0022600: TBB has to be disabled in BRepMesh due to data races BRepMesh_FastDiscret class, added missed ::SetParallel(), ::IsParallel() methods implementations. Affected Issues
mod - src/BRepMesh/BRepMesh_FastDiscret.cxx Diff File

occt: master 5e59c041

2011-09-30 06:49:56


Committer: bugmaster Details Diff
0022600: TBB has to be disabled in BRepMesh due to data races BRepMesh_FastDiscret class, added missed ::SetParallel(), ::IsParallel() methods implementations. Corrected integration Affected Issues
mod - src/BRepMesh/BRepMesh_FastDiscret.cxx Diff File

Issue History

Date Modified Username Field Change
2011-06-23 18:31 kgv BugsThisDependsOn => 22584
2011-07-04 18:28 kgv BugsThisDependsOn => 22647
2011-07-05 18:12 kgv CC => kgv
2011-07-14 18:42 bugmaster Status closed => assigned
2011-07-14 18:42 bugmaster Resolution suspended => @0@
2011-07-14 18:42 bugmaster Assigned To bugmaster => kgv
2011-07-14 18:42 bugmaster Status assigned => resolved
2011-07-29 13:13 bugmaster Status resolved => reviewed
2011-07-29 13:13 bugmaster Fixed in Version EMPTY =>
2011-08-02 11:31 bugmaster Category OCCT:MOA => OCCT:Modeling Algorithms
2011-08-10 15:45 ycy Note Added: 0017954
2011-08-10 17:43 bugmaster Target Version => 6.5.2
2011-08-10 17:43 bugmaster Description Updated
2011-08-11 12:02 kgv Note Added: 0017959
2011-08-11 12:03 kgv Assigned To kgv => ycy
2011-09-02 12:59 ycy Note Added: 0018064
2011-09-02 14:28 ycy Note Added: 0018067
2011-09-02 16:51 mkv Status reviewed => tested
2011-09-07 12:39 bugmaster Note Added: 0018081
2011-09-07 12:39 bugmaster Status tested => verified
2011-09-07 18:53 mkv Test case number => Test case is not required
2011-09-29 11:32 kgv Note Added: 0018284
2011-09-29 11:32 kgv Assigned To ycy => kgv
2011-09-29 11:32 kgv Status verified => assigned
2011-09-29 11:34 kgv Note Added: 0018285
2011-09-29 11:34 kgv Assigned To kgv => bugmaster
2011-09-29 11:34 kgv Status assigned => reviewed
2011-09-30 11:02 bugmaster Note Added: 0018293
2011-09-30 11:02 bugmaster Status reviewed => verified
2011-11-22 17:47 szy Note Edited: 0017665
2011-11-22 17:48 szy Note Edited: 0018067
2011-11-25 12:17 szy Description Updated
2011-12-05 11:19 abv Relationship added child of 0022825
2012-01-17 18:37 abv Assigned To bugmaster => Roman Lygin
2012-03-29 17:26 bugmaster Changeset attached => occt master 5e59c041
2012-03-29 17:26 bugmaster Changeset attached => occt master 0981302b
2012-03-29 17:26 bugmaster Changeset attached => occt master 0b97567d
2012-11-09 10:06 abv Category OCCT:Modeling Algorithms => OCCT:Mesh