Salome HOME
Clean up of cout replaced by MESSAGE + minor corrections
[modules/smesh.git] / src / SMESH / SMESH_Gen.cxx
index e2d908f1f109356d65406034fa7ae8ed842aad13..f61acd5f9e6d57b4c3932e43f34f66cd1af43744 100644 (file)
@@ -48,7 +48,6 @@
 #include <TopoDS_Iterator.hxx>
 
 #include "memoire.h"
-#include <chrono>
 #include <functional>
 
 #ifdef WIN32
@@ -191,7 +190,6 @@ const std::function<void(int,
     sm->SetAllowedSubShapes( nullptr );
   }
 
-  // TODO: Check if this is necessary
   if ( aShapesId )
     aShapesId->insert( sm->GetId() );
 
@@ -250,8 +248,7 @@ bool SMESH_Gen::Compute(SMESH_Mesh &                aMesh,
 
     TopAbs_ShapeEnum previousShapeType = TopAbs_VERTEX;
     int nbThreads = aMesh.GetNbThreads();
-    auto begin = std::chrono::high_resolution_clock::now();
-    std::cout << "Running mesh with threads: " << nbThreads << " mesher: " << aMesh.GetMesherNbThreads() << std::endl;
+    MESSAGE("Running mesh with threads: " << nbThreads << " mesher: " << aMesh.GetMesherNbThreads());
 
 
     smIt = shapeSM->getDependsOnIterator(includeSelf, !complexShapeFirst);
@@ -268,7 +265,6 @@ bool SMESH_Gen::Compute(SMESH_Mesh &                aMesh,
         aMesh.SetNbThreads(0);
       else
         aMesh.SetNbThreads(nbThreads);
-      //DEBUG std::cout << "Shape Type" << shapeType << " previous" << previousShapeType << std::endl;
       if ((aMesh.IsParallel()||nbThreads!=0) && shapeType != previousShapeType) {
         // Waiting for all threads for the previous type to end
         aMesh.wait();
@@ -292,8 +288,7 @@ bool SMESH_Gen::Compute(SMESH_Mesh &                aMesh,
         if(file_name != "")
         {
           fs::path mesh_file = fs::path(aMesh.tmp_folder) / fs::path(file_name);
-          // TODO: change mesh name
-          exportMesh(mesh_file.string(), aMesh, "Maillage_1");
+          exportMesh(mesh_file.string(), aMesh, "MESH");
 
         }
         //Resetting threaded pool info
@@ -314,8 +309,6 @@ bool SMESH_Gen::Compute(SMESH_Mesh &                aMesh,
                           shapeSM, aShapeOnly, allowedSubShapes,
                           aShapesId));
       } else {
-        auto begin2 = std::chrono::high_resolution_clock::now();
-
         compute_function(1 ,smToCompute, computeEvent,
                          shapeSM, aShapeOnly, allowedSubShapes,
                          aShapesId);
@@ -335,13 +328,6 @@ bool SMESH_Gen::Compute(SMESH_Mesh &                aMesh,
     }
 
     aMesh.GetMeshDS()->Modified();
-    auto end = std::chrono::high_resolution_clock::now();
-    auto elapsed = std::chrono::duration_cast<std::chrono::nanoseconds>(end - begin);
-    std::cout << "Time for All: " << elapsed.count()*1e-9 << std::endl;
-
-    // Pool of thread for computation
-    if(aMesh.IsParallel())
-      aMesh.DeletePoolThreads();
 
     return ret;
   }
@@ -353,7 +339,6 @@ bool SMESH_Gen::Compute(SMESH_Mesh &                aMesh,
     // the most complex shapes and collect sub-meshes with algos that
     // DO support sub-meshes
     // ================================================================
-    auto begin = std::chrono::high_resolution_clock::now();
     list< SMESH_subMesh* > smWithAlgoSupportingSubmeshes[4]; // for each dim
 
     // map to sort sm with same dim algos according to dim of
@@ -549,11 +534,7 @@ bool SMESH_Gen::Compute(SMESH_Mesh &                aMesh,
             continue;
           sm->SetAllowedSubShapes( fillAllowed( shapeSM, aShapeOnly, allowedSubShapes ));
           setCurrentSubMesh( sm );
-          auto begin = std::chrono::high_resolution_clock::now();
           sm->ComputeStateEngine( computeEvent );
-          auto end = std::chrono::high_resolution_clock::now();
-          auto elapsed = std::chrono::duration_cast<std::chrono::nanoseconds>(end - begin);
-          std::cout << "Time for seq:alldim:compute: " << elapsed.count()*1e-9 << std::endl;
 
           setCurrentSubMesh( NULL );
           sm->SetAllowedSubShapes( nullptr );
@@ -567,9 +548,6 @@ bool SMESH_Gen::Compute(SMESH_Mesh &                aMesh,
     // mesh the rest sub-shapes starting from vertices
     // -----------------------------------------------
     ret = Compute( aMesh, aShape, aFlags | UPWARD, aDim, aShapesId, allowedSubShapes );
-    auto end = std::chrono::high_resolution_clock::now();
-    auto elapsed = std::chrono::duration_cast<std::chrono::nanoseconds>(end - begin);
-    std::cout << "Time for All: " << elapsed.count()*1e-9 << std::endl;
 
   }