From: Paul RASCLE Date: Fri, 15 Apr 2016 15:51:36 +0000 (+0200) Subject: tests on memory measurements X-Git-Tag: V7_8_0a2~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=05cbd0eed80fc47431066455b03bc1e3b493e767;p=modules%2Fsmesh.git tests on memory measurements --- diff --git a/src/SMESH/memoire.h b/src/SMESH/memoire.h index fe08e6124..0b8a44b6e 100644 --- a/src/SMESH/memoire.h +++ b/src/SMESH/memoire.h @@ -30,14 +30,14 @@ void memostat(const char* f, int l) #ifdef WIN32 //rnv: TODO: find alternative of the malloc_stats() on windows platform #else - /* struct mallinfo mem = mallinfo(); */ - /* std::cerr << f << ":"<< l << " " << mem.arena << " " << mem.ordblks << " " << mem.hblks << " " << mem.hblkhd << " " << mem.uordblks << " " << mem.fordblks << " " << mem.keepcost << std::endl; */ + struct mallinfo mem = mallinfo(); + std::cerr << f << ":"<< l << " " << mem.arena << " " << mem.ordblks << " " << mem.hblks << " " << mem.hblkhd << " " << mem.uordblks << " " << mem.fordblks << " " << mem.keepcost << std::endl; std::cerr << f << ":" << l << " --------------------------" << std::endl; malloc_stats(); std::cerr << f << ":" << l << " --------------------------" << std::endl; #endif } -#define MEMOSTAT //memostat( __FILE__, __LINE__ ) +#define MEMOSTAT memostat( __FILE__, __LINE__ ) #endif diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx index 413a92494..e5c4d8eb2 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx @@ -184,6 +184,7 @@ bool StdMeshers_Regular_1D::CheckHypothesis( SMESH_Mesh& aMesh, else if (hypName == "NumberOfSegments") { + MESSAGE("CheckHypothesis: NumberOfSegments"); const StdMeshers_NumberOfSegments * hyp = dynamic_cast (theHyp); ASSERT(hyp); @@ -591,6 +592,7 @@ void StdMeshers_Regular_1D::redistributeNearVertices (SMESH_Mesh & theM } if ( _hypType == NB_SEGMENTS ) { + MESSAGE("redistributeNearVertices NB_SEGMENTS"); compensateError(0, vertexLength, f, l, theLength, theC3d, theParameters, true ); } else if ( nPar <= 3 ) @@ -665,6 +667,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, const bool theReverse, bool theConsiderPropagation) { + MESSAGE("computeInternalParameters"); theParams.clear(); double f = theFirstU, l = theLastU; @@ -686,7 +689,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, if ( ! SMESH_Algo::GetSortedNodesOnEdge( theMesh.GetMeshDS(), mainEdge, _quadraticMesh, mainEdgeParamsOfNodes, SMDSAbs_Edge )) return error("Bad node parameters on the source edge of Propagation Of Distribution"); - + MESSAGE("mainEdgeParamsOfNodes.size(): " << mainEdgeParamsOfNodes.size()); vector< double > segLen( mainEdgeParamsOfNodes.size() - 1 ); double totalLen = 0; BRepAdaptor_Curve mainEdgeCurve( mainEdge ); @@ -715,7 +718,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, ++nbParams; } if ( nbParams != segLen.size()-1 ) - return error( SMESH_Comment("Can't divide into ") << segLen.size() << " segements"); + return error( SMESH_Comment("Can't divide into ") << segLen.size() << " segments"); compensateError( segLen[ theReverse ? segLen.size()-1 : 0 ], segLen[ theReverse ? 0 : segLen.size()-1 ], @@ -729,7 +732,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, case LOCAL_LENGTH: case MAX_LENGTH: case NB_SEGMENTS: { - + MESSAGE("computeInternalParameters: LOCAL_LENGTH MAX_LENGTH NB_SEGMENTS"); double eltSize = 1; int nbSegments; if ( _hypType == MAX_LENGTH ) @@ -762,6 +765,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, if (computed) { SMESHDS_SubMesh* smds = sm->GetSubMeshDS(); int nb_segments = smds->NbElements(); + MESSAGE("nb_segments: "<AddNode(P.X(), P.Y(), P.Z()); + MESSAGE("meshDS->AddNode parameter " << param << " coords=" << "("<< P.X() <<", " << P.Y() << ", " << P.Z() << ")"); meshDS->SetNodeOnEdge(node, shapeID, param); if(_quadraticMesh) {