From: Nabil Ghodbane Date: Wed, 20 Sep 2023 13:48:33 +0000 (+0200) Subject: bos #37471: fix compilation on Windows operating system. Note that SMESH_Gen::send_m... X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c7a9d1b06ad4b102f72f53170a83bdf081aafd9f;p=modules%2Fsmesh.git bos #37471: fix compilation on Windows operating system. Note that SMESH_Gen::send_mesh current implementation is vetoed on windows OS (system call) --- diff --git a/src/SMESH/SMESH_Gen.cxx b/src/SMESH/SMESH_Gen.cxx index deab14abc..48fc0da2f 100644 --- a/src/SMESH/SMESH_Gen.cxx +++ b/src/SMESH/SMESH_Gen.cxx @@ -301,6 +301,7 @@ const std::function(aMesh); // Calling run_mesher // Path to mesher script @@ -351,6 +352,7 @@ void SMESH_Gen::send_mesh(SMESH_Mesh& aMesh, std::string file_name) msg += cmd + "\n"; throw SALOME_Exception(msg); } +#endif } //============================================================================= diff --git a/src/SMESH/SMESH_ParallelMesh.cxx b/src/SMESH/SMESH_ParallelMesh.cxx index 237dad6be..2bce451f3 100644 --- a/src/SMESH/SMESH_ParallelMesh.cxx +++ b/src/SMESH/SMESH_ParallelMesh.cxx @@ -32,10 +32,8 @@ #include #endif -#ifndef WIN32 #include namespace fs=boost::filesystem; -#endif #ifndef WIN32 #include @@ -106,11 +104,9 @@ bool SMESH_ParallelMesh::keepingTmpFolfer() //============================================================================= void SMESH_ParallelMesh::CreateTmpFolder() { -#ifndef WIN32 // Temporary folder that will be used by parallel computation tmp_folder = fs::temp_directory_path()/fs::unique_path(fs::path("SMESH_%%%%-%%%%")); fs::create_directories(tmp_folder); -#endif } // //============================================================================= @@ -120,10 +116,8 @@ void SMESH_ParallelMesh::CreateTmpFolder() //============================================================================= void SMESH_ParallelMesh::DeleteTmpFolder() { -#ifndef WIN32 MESSAGE("Deleting temporary folder" << tmp_folder.string()); fs::remove_all(tmp_folder); -#endif } //============================================================================= diff --git a/src/SMESH/SMESH_ParallelMesh.hxx b/src/SMESH/SMESH_ParallelMesh.hxx index a531bdb85..4a418a49f 100644 --- a/src/SMESH/SMESH_ParallelMesh.hxx +++ b/src/SMESH/SMESH_ParallelMesh.hxx @@ -35,7 +35,10 @@ #include "SMESH_Gen.hxx" #include "SMESH_subMesh.hxx" - +#ifdef WIN32 +#include +#include +#endif enum ParallelismMethod {MultiThread, MultiNode}; class SMESH_EXPORT SMESH_ParallelMesh: public SMESH_Mesh @@ -49,20 +52,24 @@ class SMESH_EXPORT SMESH_ParallelMesh: public SMESH_Mesh ~SMESH_ParallelMesh(); // Locking mechanism + #ifndef WIN32 void Lock() override {_my_lock.lock();}; void Unlock() override {_my_lock.unlock();}; // We need to recreate the pool afterthe join void wait() override {_pool->join(); DeletePoolThreads(); InitPoolThreads(); }; + #endif // Thread Pool #ifndef WIN32 void InitPoolThreads() {_pool = new boost::asio::thread_pool(GetPoolNbThreads());}; boost::asio::thread_pool* GetPool() {return _pool;}; + void DeletePoolThreads() {delete _pool;}; #else void InitPoolThreads() {}; void* GetPool() {return NULL;}; + void DeletePoolThreads(){}; #endif - void DeletePoolThreads() {delete _pool;}; + int GetPoolNbThreads(); // Temporary folder @@ -126,7 +133,6 @@ class SMESH_EXPORT SMESH_ParallelMesh: public SMESH_Mesh boost::asio::thread_pool * _pool = nullptr; #endif boost::filesystem::path tmp_folder; - int _method = ParallelismMethod::MultiThread; int _NbThreads = std::thread::hardware_concurrency(); diff --git a/src/SMESH_I/SMESH_SequentialMesh_i.hxx b/src/SMESH_I/SMESH_SequentialMesh_i.hxx index 8f809db89..f3398dcb1 100644 --- a/src/SMESH_I/SMESH_SequentialMesh_i.hxx +++ b/src/SMESH_I/SMESH_SequentialMesh_i.hxx @@ -43,7 +43,7 @@ class SMESH_I_EXPORT SMESH_SequentialMesh_i: SMESH_SequentialMesh_i( PortableServer::POA_ptr thePOA, SMESH_Gen_i* myGen_i ):SMESH_Mesh_i(thePOA, myGen_i){}; - virtual ~SMESH_SequentialMesh_i(); + virtual ~SMESH_SequentialMesh_i(){}; };