mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-30 21:20:33 +05:00
time measurement
This commit is contained in:
parent
4eb3d62127
commit
0d9a33c24b
@ -28,7 +28,6 @@ SMDS_UnstructuredGrid::SMDS_UnstructuredGrid() :
|
|||||||
_downTypes.clear();
|
_downTypes.clear();
|
||||||
_downArray.clear();
|
_downArray.clear();
|
||||||
_mesh = 0;
|
_mesh = 0;
|
||||||
_counters = new counters(100);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SMDS_UnstructuredGrid::~SMDS_UnstructuredGrid()
|
SMDS_UnstructuredGrid::~SMDS_UnstructuredGrid()
|
||||||
@ -664,7 +663,7 @@ void SMDS_UnstructuredGrid::BuildDownwardConnectivity(bool withEdges)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}CHRONOSTOP(24);CHRONOSTOP(2);
|
}CHRONOSTOP(24);CHRONOSTOP(2);
|
||||||
_counters->stats();
|
counters::stats();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Get the neighbors of a cell.
|
/*! Get the neighbors of a cell.
|
||||||
|
@ -59,7 +59,6 @@ protected:
|
|||||||
std::vector<int> _cellIdToDownId; //!< convert vtk Id to downward[vtkType] id, initialized with -1
|
std::vector<int> _cellIdToDownId; //!< convert vtk Id to downward[vtkType] id, initialized with -1
|
||||||
std::vector<unsigned char> _downTypes;
|
std::vector<unsigned char> _downTypes;
|
||||||
std::vector<SMDS_Downward*> _downArray;
|
std::vector<SMDS_Downward*> _downArray;
|
||||||
counters *_counters;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* _SMDS_UNSTRUCTUREDGRID_HXX */
|
#endif /* _SMDS_UNSTRUCTUREDGRID_HXX */
|
||||||
|
@ -23,14 +23,15 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
cntStruct* counters::_ctrs = 0;
|
cntStruct* counters::_ctrs = 0;
|
||||||
|
int counters::_nbChrono = 0;
|
||||||
|
|
||||||
counters::counters(int nb)
|
counters::counters(int nb)
|
||||||
{
|
{
|
||||||
MESSAGE("counters::counters(int nb)");
|
MESSAGE("counters::counters(int nb)");
|
||||||
_nbChrono = nb;
|
_nbChrono = nb;
|
||||||
_ctrs = new cntStruct[_nbChrono];
|
_ctrs = new cntStruct[_nbChrono];
|
||||||
|
|
||||||
for (int i=0; i< _nbChrono; i++)
|
for (int i = 0; i < _nbChrono; i++)
|
||||||
{
|
{
|
||||||
_ctrs[i]._ctrNames = 0;
|
_ctrs[i]._ctrNames = 0;
|
||||||
_ctrs[i]._ctrLines = 0;
|
_ctrs[i]._ctrLines = 0;
|
||||||
@ -49,7 +50,7 @@ counters::~counters()
|
|||||||
void counters::stats()
|
void counters::stats()
|
||||||
{
|
{
|
||||||
MESSAGE("counters::stats()");
|
MESSAGE("counters::stats()");
|
||||||
for (int i=0; i < _nbChrono; i++)
|
for (int i = 0; i < _nbChrono; i++)
|
||||||
if (_ctrs[i]._ctrOccur)
|
if (_ctrs[i]._ctrOccur)
|
||||||
{
|
{
|
||||||
MESSAGE("Compteur[" << i << "]: "<< _ctrs[i]._ctrNames << "[" << _ctrs[i]._ctrLines << "]");
|
MESSAGE("Compteur[" << i << "]: "<< _ctrs[i]._ctrNames << "[" << _ctrs[i]._ctrLines << "]");
|
||||||
@ -58,17 +59,17 @@ void counters::stats()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
chrono::chrono(int i) :
|
||||||
|
_ctr(i), _run(true)
|
||||||
chrono::chrono(int i) : _ctr(i), _run(true)
|
|
||||||
{
|
{
|
||||||
//MESSAGE("chrono::chrono " << _ctr << " " << _run);
|
//MESSAGE("chrono::chrono " << _ctr << " " << _run);
|
||||||
_start = clock();
|
_start = clock();
|
||||||
}
|
}
|
||||||
|
|
||||||
chrono::~chrono()
|
chrono::~chrono()
|
||||||
{
|
{
|
||||||
if (_run) stop();
|
if (_run)
|
||||||
|
stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
void chrono::stop()
|
void chrono::stop()
|
||||||
@ -78,7 +79,7 @@ void chrono::stop()
|
|||||||
{
|
{
|
||||||
_run = false;
|
_run = false;
|
||||||
_end = clock();
|
_end = clock();
|
||||||
double elapse = double(_end - _start)/double(CLOCKS_PER_SEC);
|
double elapse = double(_end - _start) / double(CLOCKS_PER_SEC);
|
||||||
counters::_ctrs[_ctr]._ctrOccur++;
|
counters::_ctrs[_ctr]._ctrOccur++;
|
||||||
counters::_ctrs[_ctr]._ctrCumul += elapse;
|
counters::_ctrs[_ctr]._ctrCumul += elapse;
|
||||||
}
|
}
|
||||||
|
@ -39,9 +39,9 @@ public:
|
|||||||
static cntStruct *_ctrs;
|
static cntStruct *_ctrs;
|
||||||
counters(int nb);
|
counters(int nb);
|
||||||
~counters();
|
~counters();
|
||||||
void stats();
|
static void stats();
|
||||||
protected:
|
protected:
|
||||||
int _nbChrono;
|
static int _nbChrono;
|
||||||
};
|
};
|
||||||
|
|
||||||
class chrono
|
class chrono
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
// Author : Paul RASCLE, EDF
|
// Author : Paul RASCLE, EDF
|
||||||
// Module : SMESH
|
// Module : SMESH
|
||||||
//
|
//
|
||||||
|
#define CHRONODEF
|
||||||
#include "SMESH_Gen.hxx"
|
#include "SMESH_Gen.hxx"
|
||||||
#include "SMESH_subMesh.hxx"
|
#include "SMESH_subMesh.hxx"
|
||||||
#include "SMESH_HypoFilter.hxx"
|
#include "SMESH_HypoFilter.hxx"
|
||||||
@ -60,6 +61,7 @@ SMESH_Gen::SMESH_Gen()
|
|||||||
_segmentation = 10;
|
_segmentation = 10;
|
||||||
SMDS_Mesh::_meshList.clear();
|
SMDS_Mesh::_meshList.clear();
|
||||||
MESSAGE(SMDS_Mesh::_meshList.size());
|
MESSAGE(SMDS_Mesh::_meshList.size());
|
||||||
|
_counters = new counters(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
@ -41,6 +41,8 @@
|
|||||||
#include "SMESH_3D_Algo.hxx"
|
#include "SMESH_3D_Algo.hxx"
|
||||||
#include "SMESH_Mesh.hxx"
|
#include "SMESH_Mesh.hxx"
|
||||||
|
|
||||||
|
#include "chrono.hxx"
|
||||||
|
|
||||||
#include <TopoDS_Shape.hxx>
|
#include <TopoDS_Shape.hxx>
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
@ -159,6 +161,7 @@ private:
|
|||||||
int _segmentation;
|
int _segmentation;
|
||||||
// default of segments
|
// default of segments
|
||||||
int _nbSegments;
|
int _nbSegments;
|
||||||
|
counters *_counters;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
// Created : Mon Apr 12 16:10:22 2004
|
// Created : Mon Apr 12 16:10:22 2004
|
||||||
// Author : Edward AGAPOV (eap)
|
// Author : Edward AGAPOV (eap)
|
||||||
//
|
//
|
||||||
|
#define CHRONODEF
|
||||||
#include "SMESH_MeshEditor.hxx"
|
#include "SMESH_MeshEditor.hxx"
|
||||||
|
|
||||||
#include "SMDS_FaceOfNodes.hxx"
|
#include "SMDS_FaceOfNodes.hxx"
|
||||||
@ -10277,6 +10278,7 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector<TIDSorted
|
|||||||
|
|
||||||
SMESHDS_Mesh *meshDS = this->myMesh->GetMeshDS();
|
SMESHDS_Mesh *meshDS = this->myMesh->GetMeshDS();
|
||||||
meshDS->BuildDownWardConnectivity(false);
|
meshDS->BuildDownWardConnectivity(false);
|
||||||
|
CHRONO(50);
|
||||||
SMDS_UnstructuredGrid *grid = meshDS->getGrid();
|
SMDS_UnstructuredGrid *grid = meshDS->getGrid();
|
||||||
|
|
||||||
// --- build the list of faces shared by 2 domains (group of elements), with their domain and volume indexes
|
// --- build the list of faces shared by 2 domains (group of elements), with their domain and volume indexes
|
||||||
@ -10441,6 +10443,8 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector<TIDSorted
|
|||||||
grid->BuildLinks();
|
grid->BuildLinks();
|
||||||
|
|
||||||
// TODO replace also old nodes by new nodes in faces and edges
|
// TODO replace also old nodes by new nodes in faces and edges
|
||||||
|
CHRONOSTOP(50);
|
||||||
|
counters::stats();
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
Loading…
Reference in New Issue
Block a user