//#define PRINT_WHO_COMPUTE_WHAT
#endif
-#define PRINT_WHO_COMPUTE_WHAT
+//#define PRINT_WHO_COMPUTE_WHAT
//=============================================================================
/*!
* \brief Allocate some memory at construction and release it at destruction.
return _algo;
}
-//================================================================================
-/*!
- * \brief Returns a current algorithm
- */
-//================================================================================
-
-SMESH_Algo* SMESH_subMesh::CopyAlgo() const
-{
- //SMESH_Algo* algo = (SMESH_Algo*) new StdMeshers_Regular_1D(666, _father->GetGent());
- SMESH_Algo* algo;
-
- return algo;
-}
-
//================================================================================
/*!
* \brief Allow algo->Compute() if a sub-shape of lower dim is meshed but
case COMPUTE_SUBMESH:
{
algo = GetAlgo();
- SMESH_Algo* algo2 = CopyAlgo();
- cout << "Algo2" << algo2;
ASSERT(algo);
- //_father->Lock();
- //ret = algo->CheckHypothesis((*_father), _subShape, hyp_status);
- //_father->Unlock();
+ if(!_father->IsParallel())
+ ret = algo->CheckHypothesis((*_father), _subShape, hyp_status);
+ else
+ ret = true;
if (!ret)
{
MESSAGE("***** verify compute state *****");
break;
}
TopoDS_Shape shape = _subShape;
- algo->SubMeshesToCompute().assign( 1, this );
+ if(!_father->IsParallel())
+ algo->SubMeshesToCompute().assign( 1, this );
// check submeshes needed
- // Forcing to false for parallel run
- // TODO: Remove forced false
- if (_father->HasShapeToMesh() && false) {
+ // In parallel there would be no submesh to check
+ if (_father->HasShapeToMesh() && !_father->IsParallel()) {
bool subComputed = false, subFailed = false;
if (!algo->OnlyUnaryInput()) {
// --- commented for bos#22320 to compute all sub-shapes at once if possible;
}
else
{
+ // TODO: Do switch of compute here instead of within algo
ret = algo->Compute((*_father), shape);
}
// algo can set _computeError of submesh
updateDependantsState( SUBMESH_COMPUTED );
}
// let algo clear its data gathered while algo->Compute()
- //_father->Lock();
- //algo->CheckHypothesis((*_father), _subShape, hyp_status);
- //_father->Unlock();
+ if(!_father->IsParallel())
+ algo->CheckHypothesis((*_father), _subShape, hyp_status);
}
break;
case COMPUTE_CANCELED: // nothing to do
return _subShape;
const bool skipAuxHyps = false;
- _father->Lock();
list<const SMESHDS_Hypothesis*> usedHyps =
theAlgo->GetUsedHypothesis( *_father, _subShape, skipAuxHyps ); // copy
- _father->Lock();
std::list < TopoDS_Shape > assiShapes = theAlgo->GetAssignedShapes();
// put in a compound all shapes with the same hypothesis assigned
}
else if ( subMesh->GetComputeState() == READY_TO_COMPUTE )
{
- _father->Lock();
SMESH_Algo* anAlgo = subMesh->GetAlgo();
if (( anAlgo->IsSameName( *theAlgo )) && // same algo
( anAlgo->GetUsedHypothesis( *_father, S, skipAuxHyps ) == usedHyps ) && // same hyps
theSubComputed = false;
theSubs.push_back( subMesh );
}
- _father->Unlock();
}
}