]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
bos #37471: fix compilation on Windows operating system. Note that SMESH_Gen::send_m... bos/37471 yan/multinode
authorNabil Ghodbane <nabil.ghodbane@cea.fr>
Wed, 20 Sep 2023 13:48:33 +0000 (15:48 +0200)
committerNabil Ghodbane <nabil.ghodbane@cea.fr>
Wed, 20 Sep 2023 13:48:33 +0000 (15:48 +0200)
src/SMESH/SMESH_Gen.cxx
src/SMESH/SMESH_ParallelMesh.cxx
src/SMESH/SMESH_ParallelMesh.hxx
src/SMESH_I/SMESH_SequentialMesh_i.hxx

index deab14abc804e34be0d308bb6d4588e83265c4e1..48fc0da2f3b82d0872514fe1b43e612ad418d3b1 100644 (file)
@@ -301,6 +301,7 @@ const std::function<void(SMESH_subMesh*,
 
 void SMESH_Gen::send_mesh(SMESH_Mesh& aMesh, std::string file_name)
 {
+#ifndef WIN32
   SMESH_ParallelMesh& aParMesh = dynamic_cast<SMESH_ParallelMesh&>(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
 }
 
 //=============================================================================
index 237dad6be6132d6a5f1b6878aafb4b4681e27631..2bce451f3bd50ca67746b48fce689dc9f3c079a6 100644 (file)
   #include <windows.h>
 #endif
 
-#ifndef WIN32
 #include <boost/filesystem.hpp>
 namespace fs=boost::filesystem;
-#endif
 
 #ifndef WIN32
 #include <boost/asio.hpp>
@@ -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
 }
 
 //=============================================================================
index a531bdb8549a3926826f2d80d1e92b68b2dc818c..4a418a49f31a4fde82847f1f0e90027e54a50e84 100644 (file)
 
 #include "SMESH_Gen.hxx"
 #include "SMESH_subMesh.hxx"
-
+#ifdef WIN32
+#include <thread>
+#include <boost/filesystem.hpp>
+#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();
index 8f809db890d88700a91166c9a178ca5c7209dc27..f3398dcb1016622def9b285f8583e581491499f9 100644 (file)
@@ -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(){};
 
 };