DiscussionsIssue archiveOCCT:Modeling Algorithms

Archived issue #0027814

Modeling Algorithms - Parallelize BRepCheck_Analyzer

CommunityOCCT:Modeling Algorithmsclosed73 public notes

Search issues

Description

Would it be easily possible to parallelize BRepCheck_Analyzer?

For more complex solids, checking the shape's validity can become time-consuming, especially if also the geometry should be checked.

How big is the potential to use multi-threading in BRepCheck_Analyzer and could it be easily implemented?

Steps to reproduce

restore Attachment 2 (BREP) c
checkshape c

Public activity

73 archived notes

Participants are labeled by their role within this record.

01Commenter 3
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Mon Jun 21 19:15:09 2021 +0300

    0027814: Parallelize BRepCheck_Analyzer
02Commenter 3
Branch [archived branch] has been deleted by Participant.

[revision removed]
03Commenter 3
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Mon Jun 21 19:15:09 2021 +0300

    0027814: Parallelize BRepCheck_Analyzer
04Commenter 3
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Wed Jun 23 15:23:45 2021 +0300

    Parallel for the whole map

Author: asuraven
Date: Wed Jun 23 14:32:25 2021 +0300

    chrone for Perform

05Commenter 3
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Thu Jun 24 15:26:47 2021 +0300

    IndexedDataMap

06Commenter 3
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Thu Jun 24 19:51:04 2021 +0300

    force linear

07Commenter 3
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Mon Jun 28 19:12:59 2021 +0300

    arrays for tasks + mutexes + refactor

08Commenter 3
Branch [archived branch] has been deleted by Participant.

[revision removed]
09Commenter 3
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Mon Jun 28 19:12:59 2021 +0300

    arrays for tasks + mutexes + refactor

Author: asuraven
Date: Thu Jun 24 15:26:47 2021 +0300

    IndexedDataMap

Author: asuraven
Date: Thu Jun 24 19:51:04 2021 +0300

    force linear

Author: asuraven
Date: Mon Jun 21 19:15:09 2021 +0300

    0027814: Parallelize BRepCheck_Analyzer

Author: asuraven
Date: Wed Jun 23 14:32:25 2021 +0300

    chrone for Perform

Author: asuraven
Date: Wed Jun 23 15:23:45 2021 +0300

    Parallel for the whole map
10Commenter 3
Branch [archived branch] has been deleted by Participant.

[revision removed]
11Commenter 3
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Mon Jun 21 19:15:09 2021 +0300

    0027814: Parallelize BRepCheck_Analyzer
    
    Change BRepCheck_Analyzer::Perform algorithm from recursion to 'for' loop
    Add parallelization to BRepCheck_Analyzer::Perform
    Add '-parallel' option to checkshape command to use parallelization. Default mode is single-thread.
12Commenter 21
Change BRepCheck_Analyzer::Perform algorithm from recursion to 'for' loop
Add parallelization to BRepCheck_Analyzer::Perform
Add '-parallel' option to checkshape command to use parallelization. Default mode is single-thread.

Performance increase in parallel mode is about 2.32x
Performance in single-threaded mode relative to master is about 0.97
See attached Attachment 1 (XLSX)

Tests passed: http://jenkins-test-occt.nnov.opencascade.com/view/CR27814-master-ASURAVEN/view/COMPARE/
13Commenter 4
Performance became up to 6% slower in single-threaded execution, which doesn't look good to me.

Performance tables are expected to specify units, not just numbers.

In addition, it is also important providing information about tested CPU and number of threads within multi-threaded implementation used in tests.

OCCT has option to use TBB and built-in thread pool - please put information about OCCT building options (HAVE_TBB) and consider performing comparison.

14Commenter 4
   if (myMap.IsBound(S)) {
     return;
   }

-  BRepCheck_ListOfStatus thelist;
-  myMap.Bind(S, thelist);
-
-  BRepCheck_ListOfStatus& lst = myMap(S);
+  BRepCheck_ListOfStatus aList;
...
+  Standard_Mutex::Sentry aLock(myMutex);
+  myMap.Bind(S, aList);

This logic is confusing - myMap.IsBound(S) is done without mutex lock, while adding to the map is protected by mutex.
Note that IsBound() is also not thread-safe - it may lead to data races even if concurrent thread will try adding another shape to the map.

If existing logic ensures that function will be called with the same S only from one thread, then changes below could be considered redundant and list could be bound to map at the beginning without extra copy just with a mutex lock (but BRepCheck_ListOfStatus have to be replaced by a handle to keep pointer after mutex release).

+  Standard_Mutex myMutex;

Consider avoiding myMutex allocation in single-threaded scenario (Standard_Mutex::Sentry supports interface for passing NULL / Standard_Mutex pointer).

+  for (BRepCheck_DataMapIteratorOfDataMapOfShapeResult aMapIterator(myMap); aMapIterator.More(); aMapIterator.Next())
+  {
+    Standard_Integer aMapIndex = myMap.FindIndex(aMapIterator.Key())-1;

Why using Iterator and lookup index from key instead of straightforward iteration by index within indexed data map?

+  NCollection_Vector< NCollection_Vector<TopoDS_Shape> > aVectOfVect;

NCollection_Vector doesn't look like a best choice for this logic - it seems that arrays size can be calculated in advance making NCollection_Array1 or std::vector a better choice.

+  Handle(NCollection_Shared< NCollection_Vector< NCollection_Vector<TopoDS_Shape> > >) aSharedVect =
+    new NCollection_Shared< NCollection_Vector< NCollection_Vector<TopoDS_Shape> > >(aVectOfVect);
+  Handle(NCollection_Shared< BRepCheck_DataMapOfShapeResult >) aSharedMap = 
+    new NCollection_Shared< BRepCheck_DataMapOfShapeResult >(myMap);

Is it really necessary making these extra copies?

15Commenter 24
src/BRepCheck/BRepCheck_Analyzer.hxx
Make indentation 2 in lines 48-67.

src/BRepCheck/BRepCheck_DataMapOfShapeResult.hxx
Please rename BRepCheck_DataMapOfShapeResult to BRepCheck_IndexedDataMapOfShapeResult (both the type and the file) to avoid misinterpretation.

src/BRepCheck/BRepCheck_Analyzer.cxx
  class ParallelAnalizer

Misprint -> ParallelAnalyzer
16Commenter 25
Using TBB has same performance as built-in thread pool. See results in updated attached table
17Commenter 26
Split the test bug27814 on several scripts, one per shape. Put the common procedure in "begin".

Add in the test the check that the results of single-thread and multi-thread are the same.

Correct the help:
checkshape [-top] shape [result] [-short | -parallel]
to
checkshape [-top] shape [result] [-short] [-parallel]
Also correct the logic of treatment of cmd arguments. The variable aPref must be set along with setting of the flag IsContextDump, as now the argument 'result' is allowed being located anywhere after 'shape'.
18Commenter 27
In order to balance loading, it is needed to provide each thread with more than one task. I propose the following logic to compute task size:
  const Standard_Integer aMapSize = myMap.Size();
  const Standard_Integer aMinTaskSize = 10;
  const Handle(OSD_ThreadPool)& aThreadPool = OSD_ThreadPool::DefaultPool();
  const Standard_Integer aNbThreads = aThreadPool->NbThreads();
  Standard_Integer aNbTasks = aNbThreads * 10;
  Standard_Integer aTaskSize = Max ((Standard_Integer)Ceiling(aMapSize/aNbTasks), aMinTaskSize);


19Commenter 3
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Mon Jul 5 11:24:38 2021 +0300

    fix

20Commenter 3
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Mon Jun 21 19:15:09 2021 +0300

    0027814: Parallelize BRepCheck_Analyzer
    
    Change BRepCheck_Analyzer::Perform algorithm from recursion to 'for' loop
    Add parallelization to BRepCheck_Analyzer::Perform
    Add '-parallel' option to checkshape command to use parallelization. Default mode is single-thread.
21Commenter 3
Branch [archived branch] has been deleted by Participant.

[revision removed]
22Commenter 3
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Mon Jun 21 19:15:09 2021 +0300

    0027814: Parallelize BRepCheck_Analyzer
    
    Change BRepCheck_Analyzer::Perform algorithm from recursion to 'for' loop
    Add parallelization to BRepCheck_Analyzer::Perform
    Add '-parallel' option to checkshape command to use parallelization. Default mode is single-thread.
23Commenter 3
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Wed Jul 7 14:19:06 2021 +0300

    more mutexes

24Commenter 3
Branch [archived branch] has been deleted by Participant.

[revision removed]
25Commenter 3
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Mon Jun 21 19:15:09 2021 +0300

    0027814: Parallelize BRepCheck_Analyzer
    
    Change BRepCheck_Analyzer::Perform algorithm from recursion to 'for' loop
    Add parallelization to BRepCheck_Analyzer::Perform
    Add '-parallel' option to checkshape command to use parallelization. Default mode is single-thread.
26Commenter 3
Branch [archived branch] has been deleted by Participant.

[revision removed]
27Commenter 3
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Mon Jun 21 19:15:09 2021 +0300

    0027814: Parallelize BRepCheck_Analyzer
    
    Change BRepCheck_Analyzer::Perform algorithm from recursion to 'for' loop
    Add parallelization to BRepCheck_Analyzer::Perform
    Add '-parallel' option to checkshape command to use parallelization. Default mode is single-thread.
28Commenter 41
Make a definition of an alias in the file BRepCheck_ListOfStatus.hxx and use it:
typedef Handle(NCollection_Shared<BRepCheck_ListOfStatus>) BRepCheck_HListOfStatus;


src/BRepCheck/BRepCheck.hxx
Do not change the API of the method Add(). Instead, dereference handle of the list at each call of Add().

In the methods Minimum():
    Handle(NCollection_Shared<BRepCheck_ListOfStatus>) lst = myMap(myShape);

Instead, use this:
    BRepCheck_ListOfStatus& aList = *myMap(myShape);


In the methods InContext():
After the handle 'lst' is ready define a reference to the list:
BRepCheck_ListOfStatus& aList = *lst;

And pass it later to BRepCheck::Add().

src/BRepCheck/BRepCheck_Analyzer.cxx
  Standard_Integer aTaskSize = (Standard_Integer)Ceiling((double)aMapSize / aNbTasks);
  if (aTaskSize < aMinTaskSize)
  {
    aTaskSize = aMinTaskSize;
  }
  NCollection_Array1< NCollection_Array1<TopoDS_Shape> >  aArrayOfArray(0, aNbTasks);

If aTaskSize has been adjusted you need to adjust also aNbTasks.
Why aArrayOfArray is initializes with (0, aNbTasks)? Then now the number of items is aNbTasks+1. And the last item will be an uninitialized array!

                    { // critical section
                      Standard_Mutex::Sentry aLock(myIsParallel ? &myMutex : NULL);

This mutex is common for all execution. It will stop treatment of all other shapes in critical sections. It is better to use the mutex of the particular result.

src/BRepCheck/BRepCheck_Analyzer.hxx
  BRepCheck_Analyzer(const TopoDS_Shape& S,
                      const Standard_Boolean GeomControls = Standard_True,
                      const Standard_Boolean theIsParallel = Standard_False);

Correct indentation of the tailing lines.

typedef NCollection_IndexedDataMap<TopoDS_Shape,Handle(BRepCheck_Result),TopTools_OrientedShapeMapHasher>::Iterator BRepCheck_IndexedDataMapIteratorOfDataMapOfShapeResult;

This type is not used and can be removed. Also remove the redundant files BRepCheck_DataMapIteratorOfDataMapOfShapeResult.hxx and BRepCheck_DataMapIteratorOfDataMapOfShapeListOfStatus.hxx.

src/BRepCheck/BRepCheck_Result.hxx
The two methods:
  Standard_EXPORT const Handle(NCollection_Shared<BRepCheck_ListOfStatus>)& StatusOnShape (const TopoDS_Shape& S);
    const Handle(NCollection_Shared<BRepCheck_ListOfStatus>)& StatusOnShape() const;

are ambiguous, but have very different sense. I propose to remove non-const version, as it seems it is not used by the algorithm logic, but it can be used by compiler on some platform by mistake.

About the usage of BRepCheck_Result::InitContextIterator(). I consider it is useless, because anywhere it is used only for finding a shape that is a key in the map. It is better to use the general functions of the map to find the needed shape by key instead of iterating all the map to find that key. Please consider making a small refactoring concerning this thing. After that the type BRepCheck_DataMapIteratorOfDataMapOfShapeListOfStatus will be also useless and can be removed.
29Commenter 42
There are still many places where BRepCheck::Add() is called without locking a mutex. This can cause data races.

src/BRepCheck/BRepCheck_Result.hxx
    const Handle(NCollection_Shared <BRepCheck_ListOfStatus>)& Status() const;

This change of API is unjustified. And it can lead to incompatibility of many user applications (and it is proved by your change of other files in this patch). Please restore this function return value type.

I see that mechanism of InitContextIterator() can be used in a user code. So, I propose to make this method obsolete, and provide another more efficient method to get access to contextual results.
30Commenter 43
src/BRepTest/BRepTest_CheckCommands.cxx
Why the lines 969, 1004, 1009-1021, 1028 and others are changed in contradiction with coding rules?

          Standard_CString aPref = a[aCurInd + 1];
          StructuralDump(theCommands, anAna, aShapeName, aPref, aShape);

The local aPref hides the same from the upper level.

tests/heal/grids.list
014 same_parameter_locked
015 update_tolerance_locked
024 checkshape

Please numerate grids uniquely. The numbers 14 and 15 are busy above. It was a mistake by someone earlier.
31Commenter 44
Review.
32Commenter 3
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Mon Jun 21 19:15:09 2021 +0300

    0027814: Parallelize BRepCheck_Analyzer
    
    Change BRepCheck_Analyzer::Perform algorithm from recursion to 'for' loop
    Add parallelization to BRepCheck_Analyzer::Perform
    Add '-parallel' option to checkshape command to use parallelization. Default mode is single-thread.
33Commenter 3
Branch [archived branch] has been deleted by Participant.

[revision removed]
34Commenter 3
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Mon Jun 21 19:15:09 2021 +0300

    0027814: Parallelize BRepCheck_Analyzer
    
    Change BRepCheck_Analyzer::Perform algorithm from recursion to 'for' loop
    Add parallelization to BRepCheck_Analyzer::Perform
    Add '-parallel' option to checkshape command to use parallelization. Default mode is single-thread.
35Commenter 3
Branch [archived branch] has been deleted by Participant.

[revision removed]
36Commenter 3
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Mon Jun 21 19:15:09 2021 +0300

    0027814: Parallelize BRepCheck_Analyzer
    
    Change BRepCheck_Analyzer::Perform algorithm from recursion to 'for' loop
    Add parallelization to BRepCheck_Analyzer::Perform
    Add '-parallel' option to checkshape command to use parallelization. Default mode is single-thread.
37Commenter 5
38Commenter 54
src/BRepCheck/BRepCheck_Result.hxx
    const BRepCheck_HListOfStatus& StatusOnShape() const;

Return const BRepCheck_ListOfStatus& to preserve compatibility.

Rename IsContextualShape to IsStatusOnShape.
Rename ContextualShapeStatuses to StatusOnShape.
It is just for more logical naming.

src/BRepCheck/BRepCheck_Result.cxx
src/BRepCheck/BRepCheck_Result.lxx
Remove word 'obsolete' in comments.

Sorry, in my previous remark I was wrong. Please replace the type
typedef Handle(NCollection_Shared<BRepCheck_ListOfStatus>) BRepCheck_HListOfStatus;

with
typedef NCollection_Shared<BRepCheck_ListOfStatus> BRepCheck_HListOfStatus;

And then replace the lines like
    BRepCheck_HListOfStatus aNewList = new NCollection_Shared<BRepCheck_ListOfStatus>();

with
    Handle(BRepCheck_HListOfStatus) aNewList = new BRepCheck_HListOfStatus();

Otherwise, it is unclear in the code that the type BRepCheck_HListOfStatus indeed is a handle.

To avoid double search in the map, instead of
    myMap.Bind(S, aNewList);
    aHList = myMap(S);

use this:
    aHList = *myMap.Bound(S, aNewList);


Remove the redundant files BRepCheck_DataMapIteratorOfDataMapOfShapeResult.hxx and BRepCheck_DataMapIteratorOfDataMapOfShapeListOfStatus.hxx.

Add protection by mutex in the method BRepCheck_Shell::SetUnorientable.

In BRepCheck_Solid::Minimum(), replace "BRepCheck::Add(*myMap(myShape)" with "BRepCheck::Add(aLST".
39Commenter 3
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Wed Jul 14 16:51:20 2021 +0300

    0027814: [tests only] Modeling Algorithms - Parallelize BRepCheck_Analyzer
40Commenter 3
Branch [archived branch] has been deleted by Participant.

[revision removed]
41Commenter 3
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Mon Jun 21 19:15:09 2021 +0300

    0027814: Parallelize BRepCheck_Analyzer
    
    Change BRepCheck_Analyzer::Perform algorithm from recursion to 'for' loop
    Add parallelization to BRepCheck_Analyzer::Perform
    Add '-parallel' option to checkshape command to use parallelization. Default mode is single-thread.
42Commenter 3
Branch [archived branch] has been deleted by Participant.

[revision removed]
43Commenter 3
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Mon Jun 21 19:15:09 2021 +0300

    0027814: Parallelize BRepCheck_Analyzer
    
    Change BRepCheck_Analyzer::Perform algorithm from recursion to 'for' loop
    Add parallelization to BRepCheck_Analyzer::Perform
    Add '-parallel' option to checkshape command to use parallelization. Default mode is single-thread.
44Commenter 62
tests are ok:
http://jenkins-test-occt.nnov.opencascade.com/view/CR27814_2-master-ASURAVEN/view/COMPARE/
See branch CR27814_2.
Tests on branch CR27814_3 (http://jenkins-test-occt.nnov.opencascade.com/view/CR27814_3-master-ASURAVEN/view/COMPARE/) demonstrate that a test bug27814_6 problem with unstability numbers of
 faulty in checkshape isn't a parallelization problem

45Commenter 63
Please correct compilation warnings.
46Commenter 3
Branch [archived branch] has been deleted by Participant.

[revision removed]
47Commenter 3
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Mon Jun 21 19:15:09 2021 +0300

    0027814: Parallelize BRepCheck_Analyzer
    
    Change BRepCheck_Analyzer::Perform algorithm from recursion to 'for' loop
    Add parallelization to BRepCheck_Analyzer::Perform
    Add '-parallel' option to checkshape command to use parallelization. Default mode is single-thread.
48Commenter 66
fixed in CR27814_2
49Commenter 67
OCCT - CR27814_2
Products - none.
50Commenter 4
+ const Handle(BRepCheck_Face)& aFaceRes = Handle(BRepCheck_Face)::DownCast(aResult);

DownCast() returns a copy - please avoid defining a variable as & reference.

+    Standard_Mutex::Sentry aLock(myIsParallel ? &myMutex : NULL);

What I've suggested is to define myMutex as Handle(NCollection_Shared<Standard_Mutex>) and allocate mutex in sync with IsParallel flag, but OK.

+    return myMap.IsBound(theShape) ? Standard_True : Standard_False;

Could be just "return myMap.IsBound(theShape);".

+    else if (!strcmp(a[anAI], "-parallel"))

Case-insensitive compares in preferred for Draw Harness command arguments.
TCollection_AsciiString anArg(a[anAI]);
anArg.LowerCase();
if (anArg == "-parallel") {}
51Commenter 69
Agree with Kirill's remarks.
52Commenter 3
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Fri Jul 16 18:09:23 2021 +0300

    fix

53Commenter 3
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
54Commenter 3
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
55Commenter 3
Branch [archived branch] has been created by Commenter 4.

[revision removed]


Detailed log of new commits:

Author: Commenter 4
Date: Mon Jul 19 12:12:31 2021 +0300

    # cosmetics

Author: asuraven
Date: Mon Jun 21 19:15:09 2021 +0300

    0027814: Parallelize BRepCheck_Analyzer
    
    Change BRepCheck_Analyzer::Perform algorithm from recursion to 'for' loop
    Add parallelization to BRepCheck_Analyzer::Perform
    Add '-parallel' option to checkshape command to use parallelization. Default mode is single-thread.
56Commenter 3
Branch [archived branch] has been created by Commenter 4.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Mon Jun 21 19:15:09 2021 +0300

    0027814: Parallelize BRepCheck_Analyzer
    
    Change BRepCheck_Analyzer::Perform algorithm from recursion to 'for' loop
    Add parallelization to BRepCheck_Analyzer::Perform
    Add '-parallel' option to checkshape command to use parallelization. Default mode is single-thread.
57Commenter 4
Cosmetic changes have been pushed to CR27814_4.
58Commenter 4
After taking a deeper look into code, it seems that every single sub-shape associated with BRepCheck_Result creates its own Mutex object - e.g. it might be thousands and more (recursivelly).
So I withdraw my early thought - it doesn't look OK to me creating that much of mutexes, especially in case of a single-threaded execution.

  if (!HR.IsNull())
  {
    HR->SetParallel (theIsParallel);
  }
  myMap.Add (theShape, HR);

  for (TopoDS_Iterator theIterator (theShape); theIterator.More(); theIterator.Next())
  {
    Put (theIterator.Value(), B, theIsParallel); // performs minimum on each shape
  }
59Commenter 3
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: asuraven
Date: Mon Jul 19 17:11:08 2021 +0300

    mutex as Handle

60Commenter 3
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
61Commenter 3
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
62Commenter 3
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
63Commenter 83
Mutexes are wrapped in handles.
Flag isParallel excluded.
After consulting with msv, it was decided not to exclude the mutex from BRepCheck_Result.
Tests results: http://jenkins-test-occt.nnov.opencascade.com/view/CR27814_4-master-KGV/view/COMPARE/
64Commenter 4
--- a/src/BRepCheck/BRepCheck_Analyzer.cxx
+++ b/src/BRepCheck/BRepCheck_Analyzer.cxx
@@ -44,11 +44,9 @@ class BRepCheck_ParallelAnalyzer
...
   mutable Standard_Mutex myMutex;
-  Standard_Boolean myIsParallel;

myMutex is never used and can be removed.

+void BRepCheck_Result::SetParallel(Standard_Boolean theIsParallel)
+{
+  if (theIsParallel && myMutex.IsNull())
+  {
+    myMutex.reset(new Standard_HMutex());
+  }
...
+  if (!HR.IsNull())
+  {
+    HR->SetParallel (theIsParallel);
+  }

SetParallel() method looks confusing.
Wouldn't it be simpler passing theIsParallel to constructor of statuses?
65Commenter 3
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
66Commenter 86
myMutex was deleted
67Commenter 1
Combination -
OCCT branch : [archived branch]
master SHA - [revision removed]
[revision removed]
Products branch : [archived branch] SHA - [revision removed]
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: 17248.180000000266 / 17229.680000000302 [+0.11%]
Products
Total CPU difference: 11453.40000000009 / 11477.160000000118 [-0.21%]
Windows-64-VC14:
OCCT
Total CPU difference: 19038.78125 / 19020.171875 [+0.10%]
Products
Total CPU difference: 12762.65625 / 12734.125 [+0.22%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
68Commenter 3
Branch [archived branch] has been deleted by Participant.

[revision removed]
69Commenter 3
Branch [archived branch] has been deleted by Participant.

[revision removed]
70Commenter 3
Branch [archived branch] has been deleted by Participant.

[revision removed]
71Commenter 3
Branch [archived branch] has been deleted by Participant.

[revision removed]
72Commenter 3
Branch [archived branch] has been deleted by Participant.

[revision removed]
73Commenter 3
Branch [archived branch] has been deleted by Participant.

[revision removed]

Related records