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
msg += cmd + "\n";
throw SALOME_Exception(msg);
}
+#endif
}
//=============================================================================
#include <windows.h>
#endif
-#ifndef WIN32
#include <boost/filesystem.hpp>
namespace fs=boost::filesystem;
-#endif
#ifndef WIN32
#include <boost/asio.hpp>
//=============================================================================
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
}
//
//=============================================================================
//=============================================================================
void SMESH_ParallelMesh::DeleteTmpFolder()
{
-#ifndef WIN32
MESSAGE("Deleting temporary folder" << tmp_folder.string());
fs::remove_all(tmp_folder);
-#endif
}
//=============================================================================
#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
~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
boost::asio::thread_pool * _pool = nullptr;
#endif
boost::filesystem::path tmp_folder;
-
int _method = ParallelismMethod::MultiThread;
int _NbThreads = std::thread::hardware_concurrency();
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(){};
};