#include "MEDCouplingMemArray.hxx"
-#include "ctpl.h"
-
#include <map>
#include <list>
#include <vector>
#include <ostream>
+#include <boost/filesystem.hpp>
+#include <boost/asio/thread_pool.hpp>
+#include <boost/thread.hpp>
+
#ifdef WIN32
#pragma warning(disable:4251) // Warning DLL Interface ...
#pragma warning(disable:4290) // Warning Exception ...
std::ostream& Dump(std::ostream & save);
+ // Parallel computation functions
+
void Lock() {_my_lock.lock();};
void Unlock() {_my_lock.unlock();};
+ int GetNbThreads(){return _NbThreads;};
+ void SetNbThreads(int nbThreads){_NbThreads=nbThreads;};
+
+ void InitPoolThreads(){_pool = new boost::asio::thread_pool(_NbThreads);};
+ void DeletePoolThreads(){delete _pool;};
+
+ void wait(){_pool->join(); DeletePoolThreads(); InitPoolThreads(); }
+
+ bool IsParallel(){return _NbThreads > 0;}
+
+ // Temporary folder used during parallel Computation
+ boost::filesystem::path tmp_folder;
+ boost::asio::thread_pool * _pool = nullptr; //thread pool for computation
+
+
private:
void exportMEDCommmon(DriverMED_W_SMESHDS_Mesh& myWriter,
TCallUp* _callUp;
// Mutex for multhitreading write in SMESH_Mesh
- std::mutex _my_lock;
+ boost::mutex _my_lock;
+ int _NbThreads=0;
protected:
SMESH_Mesh();
SMESH_Mesh(const SMESH_Mesh&) {};
};
-
#endif