From 9f0edf17413d7f954d16288db4de15da2dfc1e59 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Fri, 4 Oct 2019 17:05:40 +0200 Subject: [PATCH] Use new timers --- libsrc/core/taskmanager.hpp | 2 ++ libsrc/meshing/improve2.cpp | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/libsrc/core/taskmanager.hpp b/libsrc/core/taskmanager.hpp index e5a7313b..6710ee11 100644 --- a/libsrc/core/taskmanager.hpp +++ b/libsrc/core/taskmanager.hpp @@ -15,6 +15,7 @@ #include "array.hpp" #include "paje_trace.hpp" +#include "profiler.hpp" namespace ngcore { @@ -1059,6 +1060,7 @@ public: template int ComputeColoring( FlatArray colors, size_t ndofs, Tmask const & getDofs) { + static Timer timer("ComputeColoring - "+Demangle(typeid(Tmask).name())); RegionTimer rt(timer); static_assert(sizeof(unsigned int)==4, "Adapt type of mask array"); auto n = colors.Size(); diff --git a/libsrc/meshing/improve2.cpp b/libsrc/meshing/improve2.cpp index 71f652a9..759fc09a 100644 --- a/libsrc/meshing/improve2.cpp +++ b/libsrc/meshing/improve2.cpp @@ -177,8 +177,8 @@ namespace netgen else PrintMessage (3, "Edgeswapping, topological"); - static int timerstart = NgProfiler::CreateTimer ("EdgeSwapping 2D start"); - NgProfiler::StartTimer (timerstart); + static Timer timerstart("EdgeSwapping 2D start"); + timerstart.Start(); Array seia; bool mixed = false; @@ -310,7 +310,7 @@ namespace netgen for (SurfaceElementIndex sei : seia) swapped[sei] = false; - NgProfiler::StopTimer (timerstart); + timerstart.Stop(); @@ -377,15 +377,15 @@ namespace netgen } - static int timer = NgProfiler::CreateTimer ("Combineimprove 2D"); - NgProfiler::RegionTimer reg (timer); + static Timer timer ("Combineimprove 2D"); + RegionTimer reg (timer); - static int timerstart = NgProfiler::CreateTimer ("Combineimprove 2D start"); - NgProfiler::StartTimer (timerstart); + static Timer timerstart ("Combineimprove 2D start"); + timerstart.Start(); - static int timerstart1 = NgProfiler::CreateTimer ("Combineimprove 2D start1"); - NgProfiler::StartTimer (timerstart1); + static Timer timerstart1 ("Combineimprove 2D start1"); + timerstart1.Start(); Array seia; @@ -416,7 +416,7 @@ namespace netgen Array fixed(np); fixed = false; - NgProfiler::StopTimer (timerstart1); + timerstart1.Stop(); /* for (SegmentIndex si = 0; si < mesh.GetNSeg(); si++) @@ -468,7 +468,7 @@ namespace netgen } } - NgProfiler::StopTimer (timerstart); + timerstart.Stop(); for (int i = 0; i < seia.Size(); i++) {