1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0024157: Parallelization of assembly part of BO

New metod was implemented to class BOPAlgo_Builder
   - method:
void BOPAlgo_Builder::SetRunParallel(const Standard_Boolean theFlag)
The method sets the flag of parallel processing
 if <theFlag> is true  the parallel processing is switched on
 if <theFlag> is false the parallel processing is switched off
  - method:
Standard_Boolean BOPAlgo_Builder::RunParallel()const
The method returns the  flag of parallel processing

Class BOPTest was changed
   - static function:
Standard_Integer bbuild(Draw_Interpretor& di, Standard_Integer n, const char** a)
The optional parameters [ -s -t ] have been added to the command line of
the command 'bbuild':
bbuild r [-s -t]
-s : builds the result using serial procesing
-t : show the wall time
This commit is contained in:
pkv
2013-10-22 13:13:38 +04:00
committed by abv
parent 426dc099e9
commit 796a784d36
4 changed files with 161 additions and 36 deletions

View File

@@ -106,15 +106,24 @@ is
---Purpose: Returns true if the shape theS has been deleted.
returns Boolean from Standard
is redefined;
SetRunParallel(me:out;
theFlag:Boolean from Standard);
---Purpose: Set the flag of parallel processing
-- if <theFlag> is true the parallel processing is switched on
-- if <theFlag> is false the parallel processing is switched off
--
RunParallel(me)
returns Boolean from Standard;
---Purpose: Returns the flag of parallel processing
--
-- Debug
--
Images(me)
returns DataMapOfShapeListOfShape from BOPCol;
---C++: return const &
--
--
-- protected methods
--
@@ -241,6 +250,8 @@ fields
--
mySplits : DataMapOfShapeListOfShape from BOPCol is protected;
myOrigins : DataMapOfShapeShape from BOPCol is protected;
--
myRunParallel : Boolean from Standard is protected;
--
end Builder;

View File

@@ -34,7 +34,7 @@
//function :
//purpose :
//=======================================================================
BOPAlgo_Builder::BOPAlgo_Builder()
BOPAlgo_Builder::BOPAlgo_Builder()
:
BOPAlgo_BuilderShape(),
myArguments(myAllocator),
@@ -46,14 +46,16 @@
myImages(100, myAllocator),
myShapesSD(100, myAllocator),
mySplits(100, myAllocator),
myOrigins(100, myAllocator)
myOrigins(100, myAllocator),
myRunParallel(Standard_False)
{
}
//=======================================================================
//function :
//purpose :
//=======================================================================
BOPAlgo_Builder::BOPAlgo_Builder(const Handle(NCollection_BaseAllocator)& theAllocator)
BOPAlgo_Builder::BOPAlgo_Builder
(const Handle(NCollection_BaseAllocator)& theAllocator)
:
BOPAlgo_BuilderShape(theAllocator),
myArguments(myAllocator),
@@ -65,14 +67,15 @@
myImages(100, myAllocator),
myShapesSD(100, myAllocator),
mySplits(100, myAllocator),
myOrigins(100, myAllocator)
myOrigins(100, myAllocator),
myRunParallel(Standard_False)
{
}
//=======================================================================
//function : ~
//purpose :
//=======================================================================
BOPAlgo_Builder::~BOPAlgo_Builder()
BOPAlgo_Builder::~BOPAlgo_Builder()
{
if (myEntryPoint==1) {
if (myPaveFiller) {
@@ -85,7 +88,7 @@
//function : Clear
//purpose :
//=======================================================================
void BOPAlgo_Builder::Clear()
void BOPAlgo_Builder::Clear()
{
myArguments.Clear();
myMapFence.Clear();
@@ -95,10 +98,26 @@
myOrigins.Clear();
}
//=======================================================================
//function : SetRunParallel
//purpose :
//=======================================================================
void BOPAlgo_Builder::SetRunParallel(const Standard_Boolean theFlag)
{
myRunParallel=theFlag;
}
//=======================================================================
//function : RunParallel
//purpose :
//=======================================================================
Standard_Boolean BOPAlgo_Builder::RunParallel()const
{
return myRunParallel;
}
//=======================================================================
//function : AddArgument
//purpose :
//=======================================================================
void BOPAlgo_Builder::AddArgument(const TopoDS_Shape& theShape)
void BOPAlgo_Builder::AddArgument(const TopoDS_Shape& theShape)
{
if (myMapFence.Add(theShape)) {
myArguments.Append(theShape);
@@ -108,7 +127,7 @@
//function : Arguments
//purpose :
//=======================================================================
const BOPCol_ListOfShape& BOPAlgo_Builder::Arguments()const
const BOPCol_ListOfShape& BOPAlgo_Builder::Arguments()const
{
return myArguments;
}
@@ -116,7 +135,7 @@
//function : Images
//purpose :
//=======================================================================
const BOPCol_DataMapOfShapeListOfShape& BOPAlgo_Builder::Images()const
const BOPCol_DataMapOfShapeListOfShape& BOPAlgo_Builder::Images()const
{
return myImages;
}
@@ -124,7 +143,7 @@
//function : Origins
//purpose :
//=======================================================================
const BOPCol_DataMapOfShapeShape& BOPAlgo_Builder::Origins()const
const BOPCol_DataMapOfShapeShape& BOPAlgo_Builder::Origins()const
{
return myOrigins;
}
@@ -133,7 +152,7 @@
//function : ShapesSd
//purpose :
//=======================================================================
const BOPCol_DataMapOfShapeShape& BOPAlgo_Builder::ShapesSD()const
const BOPCol_DataMapOfShapeShape& BOPAlgo_Builder::ShapesSD()const
{
return myShapesSD;
}
@@ -141,7 +160,7 @@
//function : Splits
//purpose :
//=======================================================================
const BOPCol_DataMapOfShapeListOfShape& BOPAlgo_Builder::Splits()const
const BOPCol_DataMapOfShapeListOfShape& BOPAlgo_Builder::Splits()const
{
return mySplits;
}
@@ -149,7 +168,7 @@
//function : PPaveFiller
//purpose :
//=======================================================================
BOPAlgo_PPaveFiller BOPAlgo_Builder::PPaveFiller()
BOPAlgo_PPaveFiller BOPAlgo_Builder::PPaveFiller()
{
return myPaveFiller;
}
@@ -157,7 +176,7 @@
//function : PDS
//purpose :
//=======================================================================
BOPDS_PDS BOPAlgo_Builder::PDS()
BOPDS_PDS BOPAlgo_Builder::PDS()
{
return myDS;
}
@@ -165,7 +184,7 @@
// function: CheckData
// purpose:
//=======================================================================
void BOPAlgo_Builder::CheckData()
void BOPAlgo_Builder::CheckData()
{
Standard_Integer aNb;
//
@@ -193,7 +212,7 @@
//function : Prepare
//purpose :
//=======================================================================
void BOPAlgo_Builder::Prepare()
void BOPAlgo_Builder::Prepare()
{
myErrorStatus=0;
//
@@ -209,7 +228,7 @@
//function : Perform
//purpose :
//=======================================================================
void BOPAlgo_Builder::Perform()
void BOPAlgo_Builder::Perform()
{
myErrorStatus=0;
//
@@ -235,7 +254,7 @@
//function : PerformWithFiller
//purpose :
//=======================================================================
void BOPAlgo_Builder::PerformWithFiller(const BOPAlgo_PaveFiller& theFiller)
void BOPAlgo_Builder::PerformWithFiller(const BOPAlgo_PaveFiller& theFiller)
{
myEntryPoint=0;
PerformInternal(theFiller);
@@ -244,7 +263,7 @@
//function : PerformInternal
//purpose :
//=======================================================================
void BOPAlgo_Builder::PerformInternal(const BOPAlgo_PaveFiller& theFiller)
void BOPAlgo_Builder::PerformInternal(const BOPAlgo_PaveFiller& theFiller)
{
myErrorStatus=0;
//
@@ -366,7 +385,7 @@
//function : PostTreat
//purpose :
//=======================================================================
void BOPAlgo_Builder::PostTreat()
void BOPAlgo_Builder::PostTreat()
{
//BRepLib::SameParameter(myShape, 1.e-7, Standard_True);
BOPTools_AlgoTools::CorrectTolerances(myShape, 0.05);

View File

@@ -263,8 +263,7 @@ void BOPAlgo_Builder::BuildSplitFaces()
aNbBF=aVBF.Extent();
//
//===================================================
bRunParallel=Standard_True;
BOPAlgo_BuilderFaceCnt::Perform(bRunParallel, aVBF);
BOPAlgo_BuilderFaceCnt::Perform(myRunParallel, aVBF);
//===================================================
//
for (k=0; k<(Standard_Integer)aNbBF; ++k) {
@@ -422,7 +421,7 @@ void BOPAlgo_Builder::FillSameDomainFaces()
//
aIDMSS.Clear();
//
Standard_Boolean bRunParallel, bFlagSD;
Standard_Boolean bFlagSD;
Standard_Integer aNbVPSB, aNbVVS, aNbF, aNbF1;
BOPAlgo_VectorOfPairOfShapeBoolean aVPSB;
//
@@ -446,8 +445,7 @@ void BOPAlgo_Builder::FillSameDomainFaces()
}
}
//====================================================
bRunParallel=Standard_True;
BOPAlgo_BuilderSDFaceCnt::Perform(bRunParallel, aVPSB);
BOPAlgo_BuilderSDFaceCnt::Perform(myRunParallel, aVPSB);
//====================================================
aAllocator=new NCollection_IncAllocator();
BOPCol_IndexedDataMapOfShapeListOfShape aDMSLS(100, aAllocator);