ROSS
st-instrumentation.h
Go to the documentation of this file.
1#ifndef INC_st_instrumentation_h
2#define INC_st_instrumentation_h
3
4/*
5 * Header file for all of the ROSS instrumentation
6 */
7
8#include "tw-opts.h"
9#include "ross-types.h"
10
11#define INST_MAX_LENGTH 4096
12
13/* st-stats-buffer.c */
14#define st_buffer_free_space(buf) (buf->size - buf->count)
15#define st_buffer_write_ptr(buf) (buf->buffer + buf->write_pos)
16#define st_buffer_read_ptr(buf) (buf->buffer + buf->read_pos)
17
18typedef struct{
19 char *buffer;
20 int size;
23 int count;
25
27extern int g_st_buffer_size;
30
32void st_buffer_init(int type);
33void st_buffer_push(int type, char *data, int size);
34void st_buffer_write(int end_of_sim, int type);
35void st_buffer_finalize(int type);
36
37/* st-instrumentation.c */
39
48
55
62
70
73extern int g_st_pe_data;
74extern int g_st_kp_data;
75extern int g_st_lp_data;
76extern int g_st_disable_out;
77
78extern int g_st_model_stats;
79extern int g_st_engine_stats;
80
81extern int g_st_gvt_sampling;
82extern int g_st_num_gvt;
83
84extern int g_st_rt_sampling;
87
88extern const tw_optdef *st_inst_opts();
89extern void st_inst_init(void);
90extern void st_inst_dump();
91extern void st_inst_finalize(tw_pe *me);
92
93/*
94 * st-sim-engine.c
95 * Simulation Engine related instrumentation
96 */
97typedef struct st_pe_stats st_pe_stats;
98typedef struct st_kp_stats st_kp_stats;
99typedef struct st_lp_stats st_lp_stats;
100
102 unsigned int peid;
103
104 unsigned int s_nevent_processed;
105 unsigned int s_nevent_abort;
106 unsigned int s_e_rbs;
107 unsigned int s_rb_total;
108 unsigned int s_rb_secondary;
109 unsigned int s_fc_attempts;
110 unsigned int s_pq_qsize;
111 unsigned int s_nsend_network;
112 unsigned int s_nread_network;
113 //unsigned int s_nsend_remote_rb;
114 //unsigned int s_nsend_loc_remote;
115 //unsigned int s_nsend_net_remote;
116 unsigned int s_ngvts;
117 unsigned int s_pe_event_ties;
118 unsigned int all_reduce_count;
120
123 float s_gvt;
127 float s_pq;
130 float s_avl;
131 float s_buddy;
132 float s_lz4;
133};
134
136 unsigned int peid;
137 unsigned int kpid;
138
139 unsigned int s_nevent_processed;
140 unsigned int s_nevent_abort;
141 unsigned int s_e_rbs;
142 unsigned int s_rb_total;
143 unsigned int s_rb_secondary;
144 unsigned int s_nsend_network;
145 unsigned int s_nread_network;
148};
149
151 unsigned int peid;
152 unsigned int kpid;
153 unsigned int lpid;
154
155 unsigned int s_nevent_processed;
156 unsigned int s_nevent_abort;
157 unsigned int s_e_rbs;
158 unsigned int s_nsend_network;
159 unsigned int s_nread_network;
162};
163
164void st_collect_engine_data(tw_pe *me, int col_type);
165void st_collect_engine_data_pes(tw_pe *pe, sample_metadata *sample_md, tw_statistics *s, int col_type);
166void st_collect_engine_data_kps(tw_pe *me, tw_kp *kp, sample_metadata *sample_md, int col_type);
167void st_collect_engine_data_lps(tw_lp *lp, sample_metadata *sample_md, int col_type);
168
169/*
170 * st-event-trace.c
171 */
178
179typedef struct {
180 unsigned int src_lp;
181 unsigned int dest_lp;
182 float send_vts;
183 float recv_vts;
184 float real_ts;
185 unsigned int model_data_sz;
187
188// collect_flag allows for specific events to be turned on/off in tracing
189typedef void (*ev_trace_f) (void *msg, tw_lp *lp, char *buffer, int *collect_flag);
190
191extern int g_st_ev_trace;
192
193void st_collect_event_data(tw_event *cev, double recv_rt);
194
195/*
196 * ross-lps/analysis-lp.c
197 */
198typedef void (*sample_event_f)(void *state, tw_bf *b, tw_lp *lp, void *sample);
199typedef void (*sample_revent_f)(void *state, tw_bf *b, tw_lp *lp, void *sample);
200extern void specialized_lp_setup();
201extern void specialized_lp_init_mapping();
202extern void specialized_lp_run();
203extern const tw_optdef *st_special_lp_opts(void);
204extern int g_st_use_analysis_lps;
206extern double g_st_vt_interval;
207extern double g_st_sampling_end;
209extern int g_st_sample_count;
210
211/*
212 * st-model-data.c
213 */
214// function to be implemented in LP for collection of model level stats
215typedef void (*model_stat_f) (void *sv, tw_lp *lp, char *buffer);
217
218/*
219 * Struct to help ROSS collect model-level data
220 * */
222 ev_trace_f ev_trace; /**< @brief function pointer to collect data about all events for given LP */
223 size_t ev_sz; /**< @brief size of data collected from model for each event */
224 model_stat_f model_stat_fn; /**< @brief function pointer to collect model level data for RT and GVT-based instrumentation */
225 size_t mstat_sz; /**< @brief size of data collected from model at sampling points */
229};
230
238
239typedef struct {
240 unsigned int peid;
241 unsigned int kpid;
242 unsigned int lpid;
243 float gvt;
245 unsigned int model_sz;
247
249
252void st_collect_model_data(tw_pe *pe, double current_rt, int stats_type);
253
254#endif
tw_pe * pe
Definition avl_tree.c:10
uint64_t tw_clock
Definition aarch64.h:6
const tw_optdef * st_special_lp_opts(void)
void st_model_settype(tw_lpid i, st_model_types *model_types)
inst_data_types
@ KP_TYPE
@ LP_TYPE
@ MODEL_TYPE
@ PE_TYPE
void(* sample_event_f)(void *state, tw_bf *b, tw_lp *lp, void *sample)
void st_collect_event_data(tw_event *cev, double recv_rt)
void st_inst_finalize(tw_pe *me)
int g_st_lp_data
void st_inst_init(void)
stats_types_enum
@ GVT_STATS
@ ALL_STATS
#define INST_MAX_LENGTH
tw_clock g_st_rt_samp_start_cycles
int g_st_model_stats
void st_collect_engine_data_kps(tw_pe *me, tw_kp *kp, sample_metadata *sample_md, int col_type)
int g_st_buffer_free_percent
void(* sample_revent_f)(void *state, tw_bf *b, tw_lp *lp, void *sample)
granularity_types
@ GRAN_PE
@ GRAN_KP
@ GRAN_LP
@ GRAN_ALL
void st_inst_dump()
void specialized_lp_setup()
collection_types
@ ANALYSIS_LP
@ EV_TRACE
@ GVT_COL
@ MODEL_COL
@ NUM_COL_TYPES
double g_st_vt_interval
void st_collect_engine_data(tw_pe *me, int col_type)
void st_model_setup_types(tw_lp *lp)
void st_collect_engine_data_lps(tw_lp *lp, sample_metadata *sample_md, int col_type)
void st_buffer_push(int type, char *data, int size)
FILE * seq_analysis
double g_st_sampling_end
int g_st_gvt_sampling
tw_clock g_st_rt_interval
FILE * seq_ev_trace
void(* ev_trace_f)(void *msg, tw_lp *lp, char *buffer, int *collect_flag)
int g_st_kp_data
FILE * seq_model
void st_collect_model_data(tw_pe *pe, double current_rt, int stats_type)
void(* model_stat_f)(void *sv, tw_lp *lp, char *buffer)
void st_buffer_init(int type)
char stats_directory[4096]
void specialized_lp_init_mapping()
int g_st_engine_stats
const tw_optdef * st_inst_opts()
int g_st_ev_trace
int g_st_disable_out
@ COMMIT_TRACE
@ FULL_TRACE
int g_st_buffer_size
int g_st_rt_sampling
char g_st_stats_out[4096]
char g_st_stats_path[4096]
tw_lpid g_st_analysis_nlp
int g_st_num_gvt
int g_st_sample_count
int g_st_pe_data
void st_buffer_allocate()
st_model_types * g_st_model_types
void specialized_lp_run()
void st_collect_engine_data_pes(tw_pe *pe, sample_metadata *sample_md, tw_statistics *s, int col_type)
tw_lpid g_st_total_model_lps
void st_buffer_write(int end_of_sim, int type)
void st_buffer_finalize(int type)
int g_st_use_analysis_lps
double tw_stime
Definition ross-base.h:39
uint64_t tw_lpid
Definition ross-base.h:49
void(* sample_event_f)(void *state, tw_bf *b, tw_lp *lp, void *sample)
void(* sample_revent_f)(void *state, tw_bf *b, tw_lp *lp, void *sample)
void(* ev_trace_f)(void *msg, tw_lp *lp, char *buffer, int *collect_flag)
void(* model_stat_f)(void *sv, tw_lp *lp, char *buffer)
st_model_types model_types[]
Definition phold.main.c:142
unsigned int model_sz
unsigned int src_lp
unsigned int dest_lp
unsigned int model_data_sz
unsigned int s_nsend_network
unsigned int s_rb_secondary
unsigned int s_nevent_processed
unsigned int s_nread_network
unsigned int peid
unsigned int kpid
unsigned int s_e_rbs
unsigned int s_rb_total
unsigned int s_nevent_abort
tw_clock s_process_event
unsigned int s_nread_network
unsigned int lpid
unsigned int s_nevent_processed
unsigned int s_e_rbs
unsigned int peid
unsigned int s_nevent_abort
unsigned int kpid
unsigned int s_nsend_network
size_t ev_sz
size of data collected from model for each event
sample_event_f sample_event_fn
sample_revent_f sample_revent_fn
size_t mstat_sz
size of data collected from model at sampling points
ev_trace_f ev_trace
function pointer to collect data about all events for given LP
model_stat_f model_stat_fn
function pointer to collect model level data for RT and GVT-based instrumentation
unsigned int all_reduce_count
unsigned int s_rb_total
unsigned int s_fc_attempts
unsigned int s_nevent_abort
unsigned int s_nread_network
unsigned int s_nsend_network
unsigned int s_nevent_processed
unsigned int s_pq_qsize
unsigned int s_rb_secondary
unsigned int peid
unsigned int s_e_rbs
unsigned int s_pe_event_ties
unsigned int s_ngvts
Reverse Computation Bitfield.
Definition ross-types.h:188
Event Stucture.
Definition ross-types.h:277
LP State Structure.
Definition ross-types.h:336
Holds the entire PE state.
Definition ross-types.h:416
Statistics tallied over the duration of the simulation.
Definition ross-types.h:117