NetDEM v1.0
Loading...
Searching...
No Matches
dem_profiler.hpp
Go to the documentation of this file.
1#pragma once
2
3#ifdef _WIN32
4#include <windows.h>
5#else
6#include <sys/time.h>
7#endif
8
9namespace netdem {
10
23
24#if defined(_WIN32) && !defined(CYGWIN)
25 typedef __int64 int64t;
26#else
27 typedef long long int64t;
28#endif // _WIN32
29
30public:
43
47
50
52 int num_walls{0};
53
55 int num_neighs{0};
56
59
62
65
75 static int64t GetTimeMicros();
76
87 void StartTimer(TimerType t_type);
88
99 void EndTimer(TimerType t_type);
100
102 void Clear();
103
105 void Print();
106
107private:
110 int64t t_start[TimerType::num_timers];
111
113 bool timer_started[TimerType::num_timers];
114
125 inline int64t GetTotalTime();
126};
127
128} // namespace netdem
A profiler class for measuring performance metrics in a DEM simulation.
Definition dem_profiler.hpp:22
int num_walls
Definition dem_profiler.hpp:52
void Print()
Definition dem_profiler.cpp:51
int64t timer_list[TimerType::num_timers]
Definition dem_profiler.hpp:46
static int64t GetTimeMicros()
Get the current time in microseconds.
Definition dem_profiler.cpp:6
int num_neigh_builds
Definition dem_profiler.hpp:58
DEMProfiler()
Definition dem_profiler.cpp:25
int num_neighs
Definition dem_profiler.hpp:55
double num_neighs_per_p
Definition dem_profiler.hpp:61
void Clear()
Definition dem_profiler.cpp:40
int num_particles
Definition dem_profiler.hpp:49
TimerType
Definition dem_profiler.hpp:31
@ contacts
Definition dem_profiler.hpp:33
@ linked_list
Definition dem_profiler.hpp:32
@ pre_modifiers
Definition dem_profiler.hpp:36
@ mid_modifiers
Definition dem_profiler.hpp:37
@ custom
Definition dem_profiler.hpp:40
@ post_modifiers
Definition dem_profiler.hpp:38
@ mpi_communication
Definition dem_profiler.hpp:39
@ walls
Definition dem_profiler.hpp:35
@ num_timers
Definition dem_profiler.hpp:41
@ particles
Definition dem_profiler.hpp:34
void EndTimer(TimerType t_type)
End a timer for measuring elapsed time.
Definition dem_profiler.cpp:32
void StartTimer(TimerType t_type)
Start a timer for measuring elapsed time.
Definition dem_profiler.cpp:27
Definition bond_entry.hpp:7