Commit 4457f310 authored by Caitlin Ross's avatar Caitlin Ross

adding support for ROSS analysis LP feature

parent e213f4ce
......@@ -2624,7 +2624,7 @@ int modelnet_mpi_replay(MPI_Comm comm, int* argc, char*** argv )
nw_add_lp_type();
model_net_register();
if (g_st_ev_trace || g_st_model_stats)
if (g_st_ev_trace || g_st_model_stats || g_st_use_analysis_lps)
nw_lp_register_model();
net_ids = model_net_configure(&num_nets);
......
......@@ -137,8 +137,11 @@ st_model_types svr_model_types[] = {
(ev_trace_f) svr_event_collect,
sizeof(int),
(model_stat_f) svr_model_stat_collect,
0,
NULL,
NULL,
0},
{NULL, 0, NULL, 0, NULL, 0}
{NULL, 0, NULL, 0, NULL, 0, NULL, NULL, 0}
};
static const st_model_types *svr_get_model_stat_types(void)
......@@ -424,7 +427,7 @@ int main(
model_net_register();
svr_add_lp_type();
if (g_st_ev_trace || g_st_model_stats)
if (g_st_ev_trace || g_st_model_stats || g_st_use_analysis_lps)
svr_register_model_types();
codes_mapping_setup();
......
This diff is collapsed.
......@@ -164,6 +164,16 @@ void mn_model_stat_collect(model_net_base_state *s, tw_lp *lp, char *buffer)
return;
}
void mn_sample_event(model_net_base_state *s, tw_bf * bf, tw_lp * lp, void *sample)
{
(*s->sub_model_type->sample_event_fn)(s->sub_state, bf, lp, sample);
}
void mn_sample_rc_event(model_net_base_state *s, tw_bf * bf, tw_lp * lp, void *sample)
{
(*s->sub_model_type->sample_revent_fn)(s->sub_state, bf, lp, sample);
}
st_model_types mn_model_types[MAX_NETS];
st_model_types mn_model_base_type = {
......@@ -172,6 +182,9 @@ st_model_types mn_model_base_type = {
(ev_trace_f) mn_event_collect,
sizeof(int),
(model_stat_f) mn_model_stat_collect,
0,
(sample_event_f) mn_sample_event,
(sample_revent_f) mn_sample_rc_event,
0
};
......@@ -213,7 +226,7 @@ void model_net_base_register(int *do_config_nets){
&model_net_base_lp);
else
method_array[i]->mn_register(&model_net_base_lp);
if (g_st_ev_trace || g_st_model_stats) // for ROSS event tracing
if (g_st_ev_trace || g_st_model_stats || g_st_use_analysis_lps) // for ROSS event tracing
{
memcpy(&mn_model_types[i], &mn_model_base_type, sizeof(st_model_types));
......@@ -465,10 +478,11 @@ void model_net_base_lp_init(
ns->sub_type = model_net_get_lp_type(ns->net_id);
/* some ROSS instrumentation setup */
if (g_st_ev_trace || g_st_model_stats)
if (g_st_ev_trace || g_st_model_stats || g_st_use_analysis_lps)
{
ns->sub_model_type = model_net_get_model_stat_type(ns->net_id);
mn_model_types[ns->net_id].mstat_sz = ns->sub_model_type->mstat_sz;
mn_model_types[ns->net_id].sample_struct_sz = ns->sub_model_type->sample_struct_sz;
}
// NOTE: some models actually expect LP state to be 0 initialized...
......
......@@ -5,7 +5,7 @@ n is the number of input bgp-log files */
#include <sys/stat.h>
#include <mpi.h>
#include <assert.h>
#define RADIX 16
#define RADIX 8
struct dfly_samples
{
......
......@@ -489,7 +489,7 @@ static void codes_mapping_init(void)
else
/* sorry, const... */
tw_lp_settype(ross_lid, (tw_lptype*) lptype);
if (g_st_ev_trace || g_st_model_stats)
if (g_st_ev_trace || g_st_model_stats || g_st_use_analysis_lps)
{
trace_type = st_model_type_lookup(lp_type_name);
st_model_settype(ross_lid, (st_model_types*) trace_type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment