17 #ifndef STXXL_PARALLEL_TIMING_HEADER
18 #define STXXL_PARALLEL_TIMING_HEADER
38 template <
typename tag,
typename must_be_
int =
int>
46 template <
typename must_be_
int>
50 static const int max_points_in_time = 100;
55 const char* tags[max_points_in_time];
75 inline void tic(
const char* tag = NULL)
77 points_in_time[pos] = omp_get_wtime();
87 assert(last_start == -1.0);
88 last_start = omp_get_wtime();
96 assert(last_start != -1.0);
97 active += (omp_get_wtime() - last_start);
117 return (points_in_time[pos - 1] - points_in_time[0]) * 1000.0;
129 str =
new char[pos * 200];
133 sprintf(str,
"t %2d T[ms]", omp_get_thread_num());
136 for (
int i = 0; i < pos; )
143 sprintf(tmp,
"%2d: ", i - 1);
145 sprintf(tmp,
"%20s: ", tags[i]);
148 sprintf(tmp,
"%7.2f ", (points_in_time[i] - last) * 1000.0);
168 printf(
"%s\n", c_str());
172 #endif // STXXL_PARALLEL
177 template <
typename must_be_
int>
184 inline void tic(
const char* = NULL) { }
190 inline const char *
c_str() {
return empty_string; }
194 template <
typename must_be_
int>
195 const char* Timing<inactive_tag, must_be_int>::empty_string =
"";
201 #endif // !STXXL_PARALLEL_TIMING_HEADER
point_in_time active_time()
void tic(const char *=NULL)
#define STXXL_BEGIN_NAMESPACE
point_in_time total_time()
static const char * empty_string
#define STXXL_END_NAMESPACE