-// Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
#include "SMESH_ComputeError.hxx"
#include "SMESH_Controls.hxx"
#include "SMESH_Hypothesis.hxx"
+#include "SMESH_subMesh.hxx"
#include "SMDS_Iterator.hxx"
#include "Utils_SALOME_Exception.hxx"
#include "MEDCouplingMemArray.hxx"
-#include "ctpl.h"
-
#include <map>
#include <list>
#include <vector>
#include <ostream>
+
+#ifndef WIN32
#include <boost/filesystem.hpp>
+#include <boost/asio/thread_pool.hpp>
+#endif
+#include <boost/thread.hpp>
#ifdef WIN32
#pragma warning(disable:4251) // Warning DLL Interface ...
class DriverMED_W_SMESHDS_Mesh;
+typedef std::set<int> TSetOfInt;
typedef std::list<int> TListOfInt;
typedef std::list<TListOfInt> TListOfListOfInt;
std::ostream& Dump(std::ostream & save);
- // Data for parallel computation
+ // Parallel computation functions
- void Lock() {_my_lock.lock();};
- void Unlock() {_my_lock.unlock();};
+ virtual void Lock(){};
+ virtual void Unlock(){};
- int GetNbThreads(){return _NbThreads;};
- void SetNbThreads(int nbThreads){_NbThreads=nbThreads;};
+ virtual int GetNbThreads(){return 0;};
+ virtual void SetNbThreads(long nbThreads){(void) nbThreads;};
- void InitPoolThreads(){_pool = new ctpl::thread_pool(_NbThreads);};
- void DeletePoolThreads(){delete _pool;};
+ virtual void InitPoolThreads(){std::cout << "Should not pass here: InitPoolThread" << std::endl;};
+ virtual void DeletePoolThreads(){std::cout << "Should not pass here: DeletePoolThread" << std::endl;};
+ virtual void wait(){std::cout << "Should not pass here: wait" << std::endl;};
- bool IsParallel(){return _NbThreads > 0;}
+ virtual bool IsParallel(){std::cout << "Should not pass here: IsParallel" << std::endl;return false;};
- // Temporary folder used during parallel Computation
- boost::filesystem::path tmp_folder;
- // TODO: Replace by number of thread
- ctpl::thread_pool * _pool = nullptr; //thread pool for computation
+#ifndef WIN32
+ virtual boost::filesystem::path GetTmpFolder() {return "";};
+ virtual boost::asio::thread_pool* GetPool() {return NULL;};
+#endif
+ virtual bool ComputeSubMeshes(
+ SMESH_Gen* gen,
+ SMESH_Mesh & aMesh,
+ const TopoDS_Shape & aShape,
+ const ::MeshDimension aDim,
+ TSetOfInt* aShapesId /*=0*/,
+ TopTools_IndexedMapOfShape* allowedSubShapes,
+ SMESH_subMesh::compute_event &computeEvent,
+ const bool includeSelf,
+ const bool complexShapeFirst,
+ const bool aShapeOnly){(void) gen;(void) aMesh;(void) aShape;(void) aDim;(void) aShapesId;(void) allowedSubShapes;(void) computeEvent;(void) includeSelf;(void) complexShapeFirst;(void) aShapeOnly;std::cout << "Should not pass here: computesubmesh" << std::endl;return false;};
private:
TCallUp* _callUp;
// Mutex for multhitreading write in SMESH_Mesh
- std::mutex _my_lock;
- int _NbThreads=0;
+#ifndef WIN32
+ boost::mutex _my_lock;
+#endif
+ int _NbThreads=-1;
protected:
SMESH_Mesh();
SMESH_Mesh(const SMESH_Mesh&) {};
};
-
#endif