theDocument)
{
MESSAGE("SMESH_ParallelMesh::SMESH_ParallelMesh(int localId)");
-#ifndef WIN32
- _NbThreads = std::thread::hardware_concurrency();
-#else
- _NbThreads = 0;
-#endif
CreateTmpFolder();
};
#endif
}
+//=============================================================================
+/*!
+ * \brief Get the number of Threads to be used for the pool of Threads
+ */
+//=============================================================================
+int SMESH_ParallelMesh::GetPoolNbThreads()
+{
+ int nbThreads = -1;
+
+ if(_method == ParallelismMethod::MultiThread){
+ nbThreads = _NbThreads;
+ }else if( _method == ParallelismMethod::MultiNode){
+ //TODO: Check of that is the right way
+ nbThreads = std::max(_nbProc, _nbNode*_nbProcPerNode);
+ } else {
+ throw SALOME_Exception("Unknown method "+std::to_string(_method));
+ }
+
+ return nbThreads;
+}
+
+//=============================================================================
+/*!
+ * \brief Set Number of thread for multithread run
+ */
+//=============================================================================
+void SMESH_ParallelMesh::SetNbThreads(long nbThreads)
+{
+ if(nbThreads < 1)
+ throw SALOME_Exception("Number of threads should be higher than 1");
+ _NbThreads=nbThreads;
+};
+
bool SMESH_ParallelMesh::ComputeSubMeshes(
SMESH_Gen* gen,
SMESH_Mesh & aMesh,