Itoyori  v0.0.1
prof_events.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "ityr/common/util.hpp"
7 
8 namespace ityr::common {
9 
11  using event::event;
12 
15  topology::rank_t target_rank [[maybe_unused]]) {
16  return t;
17  }
18 
21  topology::rank_t target_rank) {
22  auto ibd = MLOG_BEGIN(&state_.trace_md, 0, t, target_rank);
23  return ibd;
24  }
25 
26  void* trace_decoder(FILE* stream, void* buf0, void* buf1) override {
27  auto t0 = MLOG_READ_ARG(&buf0, wallclock::wallclock_t);
28  auto target_rank = MLOG_READ_ARG(&buf0, topology::rank_t);
29  auto t1 = MLOG_READ_ARG(&buf1, wallclock::wallclock_t);
30 
31  do_acc(t1 - t0);
32 
33  auto rank = topology::my_rank();
34  fprintf(stream, "%d,%lu,%d,%lu,%s,target=%d\n", rank, t0, rank, t1, str().c_str(), target_rank);
35  return buf1;
36  }
37 };
38 
40  using prof_event_target_base::prof_event_target_base;
41  std::string str() const override { return "mpi_rma_get"; }
42 };
43 
45  using prof_event_target_base::prof_event_target_base;
46  std::string str() const override { return "mpi_rma_put"; }
47 };
48 
50  using prof_event_target_base::prof_event_target_base;
51  std::string str() const override { return "mpi_rma_atomic_faa"; }
52 };
53 
55  using prof_event_target_base::prof_event_target_base;
56  std::string str() const override { return "mpi_rma_atomic_cas"; }
57 };
58 
60  using prof_event_target_base::prof_event_target_base;
61  std::string str() const override { return "mpi_rma_atomic_get"; }
62 };
63 
65  using prof_event_target_base::prof_event_target_base;
66  std::string str() const override { return "mpi_rma_atomic_put"; }
67 };
68 
70  using event::event;
71  std::string str() const override { return "mpi_rma_flush"; }
72 };
73 
75  using prof_event_target_base::prof_event_target_base;
76  std::string str() const override { return "rma_get_nb"; }
77 };
78 
80  using prof_event_target_base::prof_event_target_base;
81  std::string str() const override { return "rma_put_nb"; }
82 };
83 
85  using event::event;
86  std::string str() const override { return "rma_flush"; }
87 };
88 
90  using prof_event_target_base::prof_event_target_base;
91  std::string str() const override { return "global_lock_trylock"; }
92 };
93 
95  using prof_event_target_base::prof_event_target_base;
96  std::string str() const override { return "global_lock_priolock"; }
97 };
98 
100  using prof_event_target_base::prof_event_target_base;
101  std::string str() const override { return "global_lock_unlock"; }
102 };
103 
105  using event::event;
106  std::string str() const override { return "allocator_alloc"; }
107 };
108 
110  using event::event;
111  std::string str() const override { return "allocator_free_local"; }
112 };
113 
115  using prof_event_target_base::prof_event_target_base;
116  std::string str() const override { return "allocator_free_remote"; }
117 };
118 
120  using event::event;
121  std::string str() const override { return "allocator_collect"; }
122 };
123 
124 class prof_events {
125 public:
127 
128 private:
146 };
147 
148 }
Definition: prof_events.hpp:124
prof_events()
Definition: prof_events.hpp:126
Definition: profiler.hpp:264
Definition: profiler.hpp:53
virtual std::string str() const
Definition: profiler.hpp:96
profiler_state & state_
Definition: profiler.hpp:168
void do_acc(wallclock::wallclock_t t)
Definition: profiler.hpp:139
#define ITYR_ANON_VAR
Definition: util.hpp:55
int rank_t
Definition: topology.hpp:12
rank_t my_rank()
Definition: topology.hpp:207
uint64_t wallclock_t
Definition: wallclock.hpp:13
Definition: allocator.hpp:16
fprintf(stderr, "\x1b[31m%s\x1b[39m\n", msg)
#define MLOG_BEGIN(...)
Definition: profiler.hpp:17
#define MLOG_READ_ARG(buf, type)
Definition: profiler.hpp:19
Definition: prof_events.hpp:104
std::string str() const override
Definition: prof_events.hpp:106
Definition: prof_events.hpp:119
std::string str() const override
Definition: prof_events.hpp:121
Definition: prof_events.hpp:109
std::string str() const override
Definition: prof_events.hpp:111
Definition: prof_events.hpp:114
std::string str() const override
Definition: prof_events.hpp:116
Definition: prof_events.hpp:94
std::string str() const override
Definition: prof_events.hpp:96
Definition: prof_events.hpp:89
std::string str() const override
Definition: prof_events.hpp:91
Definition: prof_events.hpp:99
std::string str() const override
Definition: prof_events.hpp:101
Definition: prof_events.hpp:54
std::string str() const override
Definition: prof_events.hpp:56
Definition: prof_events.hpp:49
std::string str() const override
Definition: prof_events.hpp:51
Definition: prof_events.hpp:59
std::string str() const override
Definition: prof_events.hpp:61
Definition: prof_events.hpp:64
std::string str() const override
Definition: prof_events.hpp:66
Definition: prof_events.hpp:69
std::string str() const override
Definition: prof_events.hpp:71
Definition: prof_events.hpp:39
std::string str() const override
Definition: prof_events.hpp:41
Definition: prof_events.hpp:44
std::string str() const override
Definition: prof_events.hpp:46
Definition: prof_events.hpp:84
std::string str() const override
Definition: prof_events.hpp:86
Definition: prof_events.hpp:74
std::string str() const override
Definition: prof_events.hpp:76
Definition: prof_events.hpp:79
std::string str() const override
Definition: prof_events.hpp:81
Definition: prof_events.hpp:10
void * trace_decoder(FILE *stream, void *buf0, void *buf1) override
Definition: prof_events.hpp:26
auto interval_begin(profiler::mode_stats, wallclock::wallclock_t t, topology::rank_t target_rank[[maybe_unused]])
Definition: prof_events.hpp:13
auto interval_begin(profiler::mode_trace, wallclock::wallclock_t t, topology::rank_t target_rank)
Definition: prof_events.hpp:19
Definition: profiler.hpp:37
Definition: profiler.hpp:41
mlog_data_t trace_md
Definition: profiler.hpp:50