0024826: Wrapping of parallelisation algorithms
authormsv <msv@opencascade.com>
Thu, 5 Feb 2015 12:49:35 +0000 (15:49 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 5 Feb 2015 12:51:05 +0000 (15:51 +0300)
commitc7b59798ca0b9fbeb174c342678d609253140e97
tree937cfb2fc9f98870935f93e8a5066eab7edf8fd9
parenta61133c8c7285793ccb4fbe357cb3df5926bc979
0024826: Wrapping of parallelisation algorithms

Simple primitives to parallelize loops type "for" and "foreach" were implemented. The primitives encapsulates complete logic for creating and managing parallel context of loops. Moreover the primitives may be a wrapper for some primitives from 3rd-party library - TBB.

To use it is necessary to implement TBB like interface which is based on functors. For example:

Class Functor
{
public:
  void operator() ([proccesing instance]) const
  {
    //...
  }
};

In the body of the operator () should be implemented thread-safe logic of computations that can be performed in parallel context. If parallelized loop iterates on the collections with direct access by index (such as Vector, Array), it is more efficient to use the primitive ParallelFor (because it has no critical section).

All parts of  OCC code which are using tbb were changed on new primitives.

0024826: Wrapping of parallelisation algorithms

Small fix.
34 files changed:
src/BOPAlgo/BOPAlgo_BuilderSolid.cxx
src/BOPAlgo/BOPAlgo_Builder_2.cxx
src/BOPAlgo/BOPAlgo_Builder_3.cxx
src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx
src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx
src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx
src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx
src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx
src/BOPAlgo/BOPAlgo_PaveFiller_7.cxx
src/BOPAlgo/BOPAlgo_PaveFiller_9.cxx
src/BOPAlgo/BOPAlgo_ShellSplitter.cxx
src/BOPAlgo/BOPAlgo_WireSplitter.cxx
src/BOPCol/BOPCol_Parallel.hxx [new file with mode: 0644]
src/BOPCol/BOPCol_TBB.hxx [deleted file]
src/BOPCol/FILES
src/BOPDS/BOPDS_Iterator.cxx
src/BOPTest/BOPTest_CheckCommands.cxx
src/BOPTest/BOPTest_Chronometer.hxx [deleted file]
src/BOPTest/BOPTest_PartitionCommands.cxx
src/BOPTest/FILES
src/BOPTools/BOPTools_AlgoTools_1.cxx
src/BRepMesh/BRepMesh_FastDiscret.cxx
src/BRepMesh/BRepMesh_IncrementalMesh.cxx
src/BRepMesh/BRepMesh_WireChecker.cxx
src/BRepMesh/BRepMesh_WireInterferenceChecker.cxx
src/BRepMesh/BRepMesh_WireInterferenceChecker.hxx
src/MeshTest/MeshTest_PluginCommands.cxx
src/OSD/EXTERNLIB
src/OSD/FILES
src/OSD/OSD_Parallel.cxx [new file with mode: 0644]
src/OSD/OSD_Parallel.hxx [new file with mode: 0644]
src/OpenGl/OpenGl_SceneGeometry.cxx
src/QABugs/QABugs_19.cxx
src/QANCollection/QANCollection_Stl.cxx