From 3e01cac7075dc55876796768df17bfc43b3ceb21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Sch=C3=B6berl?= Date: Mon, 30 Sep 2019 19:39:22 +0200 Subject: [PATCH] remove small timers --- libsrc/meshing/delaunay.cpp | 30 +++++++----------------------- libsrc/meshing/smoothing2.cpp | 11 +---------- 2 files changed, 8 insertions(+), 33 deletions(-) diff --git a/libsrc/meshing/delaunay.cpp b/libsrc/meshing/delaunay.cpp index 4ae55439..2de53c43 100644 --- a/libsrc/meshing/delaunay.cpp +++ b/libsrc/meshing/delaunay.cpp @@ -90,8 +90,8 @@ namespace netgen void GetFirstIntersecting (const Point & pmin, const Point & pmax, TFunc func=[](auto pi){return false;}) const { - static Timer timer("BTree::GetIntersecting"); RegionTimer rt(timer); - static Timer timer1("BTree::GetIntersecting-LinearSearch"); + // static Timer timer("BTree::GetIntersecting"); RegionTimer rt(timer); + // static Timer timer1("BTree::GetIntersecting-LinearSearch"); static Array stack(1000); static Array dir_stack(1000); @@ -494,14 +494,9 @@ namespace netgen IndexSet & insphere, IndexSet & closesphere) { static Timer t("Meshing3::AddDelaunayPoint"); RegionTimer reg(t); - static Timer tsearch("addpoint, search"); - static Timer tinsert("addpoint, insert"); + // static Timer tsearch("addpoint, search"); + // static Timer tinsert("addpoint, insert"); - static Timer t0("addpoint, 0"); - static Timer t1("addpoint, 1"); - static Timer t2a("addpoint, 2a"); - static Timer t2b("addpoint, 2b"); - static Timer t3("addpoint, 3"); /* find any sphere, such that newp is contained in */ @@ -540,7 +535,7 @@ namespace netgen } */ - tsearch.Start(); + // tsearch.Start(); double minquot{1e20}; tettree.GetFirstIntersecting (newp, newp, [&](const auto pi) @@ -563,7 +558,7 @@ namespace netgen } return false; } ); - tsearch.Stop(); + // tsearch.Stop(); if (cfelind == -1) { @@ -589,7 +584,6 @@ namespace netgen bool changed = true; int nstarti = 1, starti; - t0.Start(); while (changed) { changed = false; @@ -663,8 +657,6 @@ namespace netgen } } // while (changed) - t0.Stop(); - t1.Start(); // NgArray newels; static NgArray newels; newels.SetSize(0); @@ -715,8 +707,6 @@ namespace netgen } } - t1.Stop(); - t2a.Start(); meshnb.ResetFaceHT (10*insphere.GetArray().Size()+1); for (auto celind : insphere.GetArray()) @@ -731,10 +721,6 @@ namespace netgen freelist.Append (celind); } - t2a.Stop(); - t2b.Start(); - - bool hasclose = false; for (int ind : closesphere.GetArray()) { @@ -742,8 +728,7 @@ namespace netgen fabs (Dist2 (centers.Get (ind), newp) - radi2.Get(ind)) < 1e-8 ) hasclose = true; } - t2b.Stop(); - t3.Start(); + /* for (int j = 1; j <= newels.Size(); j++) { @@ -832,7 +817,6 @@ namespace netgen tettree.Insert (tpmin, tpmax, nelind); // tinsert.Stop(); } - t3.Stop(); } diff --git a/libsrc/meshing/smoothing2.cpp b/libsrc/meshing/smoothing2.cpp index a61848d9..cc56497c 100644 --- a/libsrc/meshing/smoothing2.cpp +++ b/libsrc/meshing/smoothing2.cpp @@ -926,9 +926,6 @@ namespace netgen */ static Timer tloop("MeshSmooting 2D - loop"); - static Timer tloop1("MeshSmooting 2D - loop 1"); - static Timer tloop2("MeshSmooting 2D - loop 2"); - static Timer tloop3("MeshSmooting 2D - loop 3"); tloop.Start(); for (int hi = 0; hi < icompress.Size(); hi++) { @@ -947,8 +944,6 @@ namespace netgen // if (elementsonpoint[pi].Size() == 0) continue; if (elementsonpoint[hi].Size() == 0) continue; - - tloop1.Start(); ld.sp1 = mesh[pi]; @@ -972,8 +967,6 @@ namespace netgen ld.loc_pnts2.SetSize (0); ld.loc_pnts3.SetSize (0); - tloop1.Stop(); - tloop2.Start(); for (int j = 0; j < elementsonpoint[hi].Size(); j++) { SurfaceElementIndex sei = elementsonpoint[hi][j]; @@ -998,7 +991,6 @@ namespace netgen } } - tloop2.Stop(); GetNormalVector (ld.surfi, ld.sp1, ld.gi1, ld.normal); ld.t1 = ld.normal.GetNormal (); @@ -1028,7 +1020,6 @@ namespace netgen // NgProfiler::StartTimer (timer2); - tloop3.Start(); if (mixed) { BFGS (x, surfminfj, par, 1e-6); @@ -1037,7 +1028,7 @@ namespace netgen { BFGS (x, surfminf, par, 1e-6); } - tloop3.Stop(); + // NgProfiler::StopTimer (timer2); Point3d origp = mesh[pi];