]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Moving variables into parallel meshw
authorYoann Audouin <yoann.audouin@edf.fr>
Thu, 12 Jan 2023 06:59:46 +0000 (07:59 +0100)
committerYoann Audouin <yoann.audouin@edf.fr>
Thu, 12 Jan 2023 06:59:46 +0000 (07:59 +0100)
src/SMESH/SMESH_Gen.cxx
src/SMESH/SMESH_Mesh.hxx
src/SMESH/SMESH_ParallelMesh.hxx

index 48be3b2d72fe6bf601dabe8fd61819003be00147..04514d6768fa40aba477d5e9440adefde9ee1f1a 100644 (file)
@@ -360,7 +360,7 @@ bool SMESH_Gen::parallelComputeSubMeshes(
       }
       if(file_name != "")
       {
-        fs::path mesh_file = fs::path(aMesh.tmp_folder) / fs::path(file_name);
+        fs::path mesh_file = fs::path(aMesh.GetTmpFolder()) / fs::path(file_name);
              SMESH_DriverMesh::exportMesh(mesh_file.string(), aMesh, "MESH");
       }
       //Resetting threaded pool info
@@ -375,7 +375,7 @@ bool SMESH_Gen::parallelComputeSubMeshes(
       smToCompute->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
       continue;
     }
-    boost::asio::post(*(aMesh._pool), std::bind(compute_function, smToCompute, computeEvent,
+    boost::asio::post(*(aMesh.GetPool()), std::bind(compute_function, smToCompute, computeEvent,
                       shapeSM, aShapeOnly, allowedSubShapes,
                       aShapesId));
   }
index 50f6210a172cea514f013b021b620d67e0f1a411..85204536f2c2bd7032312a11eef5e48c6a4ade9d 100644 (file)
@@ -404,6 +404,9 @@ class SMESH_EXPORT SMESH_Mesh
 
   virtual bool IsParallel(){std::cout << "Should not pass here" << std::endl;return false;};
 
+  virtual boost::filesystem::path GetTmpFolder() {return "";};
+  virtual boost::asio::thread_pool* GetPool() {return NULL;};
+
   virtual bool ComputeSubMeshes(
             SMESH_Gen* gen,
             SMESH_Mesh & aMesh,
@@ -416,9 +419,6 @@ class SMESH_EXPORT SMESH_Mesh
             const bool complexShapeFirst,
             const bool   aShapeOnly){(void) gen;(void) aMesh;(void) aShape;(void) aDim;(void) aShapesId;(void) allowedSubShapes;(void) computeEvent;(void) includeSelf;(void) complexShapeFirst;(void) aShapeOnly;std::cout << "Should not pass here" << std::endl;return false;};
 
-  // TODO: Remove from SMESH_Mesh
-  boost::filesystem::path tmp_folder;
-  boost::asio::thread_pool *     _pool = nullptr; //thread pool for computation
 private:
 
   void exportMEDCommmon(DriverMED_W_SMESHDS_Mesh& myWriter,
index bb56599cb80bcb0a5dc16853fe7d3cf6b7359ea8..8b5db833533a5622ea534fa051b613017578a025 100644 (file)
@@ -58,6 +58,9 @@ class SMESH_EXPORT SMESH_ParallelMesh: public SMESH_Mesh
   void CreateTmpFolder();
   void DeleteTmpFolder();
 
+  boost::filesystem::path GetTmpFolder() override {return tmp_folder;};
+  boost::asio::thread_pool* GetPool() override {return _pool;};
+
   bool ComputeSubMeshes(
             SMESH_Gen* gen,
             SMESH_Mesh & aMesh,
@@ -69,5 +72,9 @@ class SMESH_EXPORT SMESH_ParallelMesh: public SMESH_Mesh
             const bool includeSelf,
             const bool complexShapeFirst,
             const bool   aShapeOnly) override;
+
+ private:
+  boost::filesystem::path tmp_folder;
+  boost::asio::thread_pool *     _pool = nullptr; //thread pool for computation
 };
 #endif