COMBINATORIAL_BLAS
1.6
sort_profiler.cpp
Go to the documentation of this file.
1
#include "sort_profiler.h"
2
3
#ifdef HAVE_PAPI
4
#include <papi.h>
5
#endif
6
7
#include <omp.h>
8
9
sort_profiler_t
total_sort
;
10
11
sort_profiler_t
sample_get_splitters
;
12
sort_profiler_t
sample_sort_splitters
;
13
sort_profiler_t
sample_prepare_scatter
;
14
sort_profiler_t
sample_do_all2all
;
15
16
sort_profiler_t
hyper_compute_splitters
;
17
sort_profiler_t
hyper_communicate
;
18
sort_profiler_t
hyper_merge
;
19
sort_profiler_t
hyper_comm_split
;
20
21
sort_profiler_t
seq_sort
;
22
sort_profiler_t
sort_partitionw
;
23
24
long
total_bytes
;
25
26
sort_profiler_t::sort_profiler_t
() {
27
seconds
= 0.0;
// openmp wall time
28
p_flpops
= 0;
// papi floating point operations
29
30
_pri_seconds
= 0.0;
31
_pri_p_flpops
= 0;
32
}
33
34
sort_profiler_t::~sort_profiler_t
() {
35
36
}
37
38
void
39
sort_profiler_t::start
() {
40
_pri_seconds
= omp_get_wtime();
41
flops_papi();
42
}
43
44
void
45
sort_profiler_t::stop
() {
46
seconds
-=
_pri_seconds
;
47
p_flpops
-=
_pri_p_flpops
;
48
49
_pri_seconds
= omp_get_wtime();
50
flops_papi();
51
52
seconds
+=
_pri_seconds
;
53
p_flpops
+=
_pri_p_flpops
;
54
}
55
56
void
57
sort_profiler_t::clear
() {
58
seconds
= 0.0;
59
p_flpops
= 0;
60
61
_pri_seconds
= 0.0;
62
_pri_p_flpops
= 0;
63
}
64
65
void
66
sort_profiler_t::flops_papi() {
67
#ifdef HAVE_PAPI
68
int
retval;
69
float
rtime, ptime, mflops;
70
retval = PAPI_flops(&rtime, &ptime, &
_pri_p_flpops
, &mflops);
71
// assert (retval == PAPI_OK);
72
#else
73
_pri_p_flpops
= 0;
74
#endif
75
}
sort_profiler_t::sort_profiler_t
sort_profiler_t()
Definition:
sort_profiler.cpp:26
sample_prepare_scatter
sort_profiler_t sample_prepare_scatter
Definition:
sort_profiler.cpp:13
sort_profiler_t::clear
void clear()
Definition:
sort_profiler.cpp:57
sort_profiler_t::start
void start()
Definition:
sort_profiler.cpp:39
total_bytes
long total_bytes
Definition:
sort_profiler.cpp:24
hyper_communicate
sort_profiler_t hyper_communicate
Definition:
sort_profiler.cpp:17
sort_profiler_t
Definition:
sort_profiler.h:4
sample_do_all2all
sort_profiler_t sample_do_all2all
Definition:
sort_profiler.cpp:14
hyper_merge
sort_profiler_t hyper_merge
Definition:
sort_profiler.cpp:18
sort_profiler_t::stop
void stop()
Definition:
sort_profiler.cpp:45
sort_profiler_t::_pri_seconds
double _pri_seconds
Definition:
sort_profiler.h:22
total_sort
sort_profiler_t total_sort
Definition:
sort_profiler.cpp:9
sort_partitionw
sort_profiler_t sort_partitionw
Definition:
sort_profiler.cpp:22
sort_profiler_t::seconds
double seconds
Definition:
sort_profiler.h:15
sort_profiler_t::~sort_profiler_t
virtual ~sort_profiler_t()
Definition:
sort_profiler.cpp:34
seq_sort
sort_profiler_t seq_sort
Definition:
sort_profiler.cpp:21
sample_sort_splitters
sort_profiler_t sample_sort_splitters
Definition:
sort_profiler.cpp:12
hyper_compute_splitters
sort_profiler_t hyper_compute_splitters
Definition:
sort_profiler.cpp:16
sample_get_splitters
sort_profiler_t sample_get_splitters
Definition:
sort_profiler.cpp:11
sort_profiler_t::_pri_p_flpops
long long _pri_p_flpops
Definition:
sort_profiler.h:23
hyper_comm_split
sort_profiler_t hyper_comm_split
Definition:
sort_profiler.cpp:19
sort_profiler_t::p_flpops
long long p_flpops
Definition:
sort_profiler.h:16
usort
src
sort_profiler.cpp
Generated by
1.8.17