...
 
Commits (5)
......@@ -7,7 +7,7 @@ LT_INIT
#WRAP SOME OPTION AROUND THIS - IT'S NOT REQUIRED FOR 99% OF CODES
AX_BOOST_BASE([1.66])
#AX_BOOST_BASE([1.66])
AC_CANONICAL_TARGET
AC_CANONICAL_SYSTEM
......@@ -96,6 +96,8 @@ AC_ARG_WITH([damaris],[AS_HELP_STRING([--with-damaris],
if test "x${use_rdamaris}" = xyes ; then
PKG_CHECK_MODULES_STATIC([ROSS_Damaris], [ross-damaris], [],
[AC_MSG_ERROR([Could not find working ROSS-Damaris installation via pkg-config])])
PKG_CHECK_MODULES([rdplugins], [ross-damaris], [],
[AC_MSG_ERROR([Could not find the rdplugins library from ROSS-Damaris via pkg-config])])
fi
AM_CONDITIONAL(USE_RDAMARIS, [test "x${use_rdamaris}" = xyes])
......
......@@ -1060,9 +1060,11 @@ void router_custom_setup(router_state * r, tw_lp * lp)
r->link_traffic_ross_sample = (int64_t*)calloc(p->radix, sizeof(int64_t));
r->busy_time_ross_sample = (tw_stime*)calloc(p->radix, sizeof(tw_stime));
if (g_st_model_stats)
{
lp->model_types->mstat_sz = sizeof(tw_lpid) + (sizeof(int64_t) + sizeof(tw_stime)) * p->radix;
if (g_st_use_analysis_lps && g_st_model_stats)
//if (g_st_use_analysis_lps && g_st_model_stats)
lp->model_types->sample_struct_sz = sizeof(struct dfly_router_sample) + (sizeof(tw_stime) + sizeof(int64_t)) * p->radix;
}
r->ross_rsample.busy_time = (tw_stime*)calloc(p->radix, sizeof(tw_stime));
r->ross_rsample.link_traffic_sample = (int64_t*)calloc(p->radix, sizeof(int64_t));
......@@ -1904,6 +1906,27 @@ static void ross_custom_dragonfly_rsample_fn(router_state * s, tw_bf * bf, tw_lp
const dragonfly_param * p = s->params;
int i = 0;
#ifdef USE_RDAMARIS
if (g_st_damaris_enabled)
{
// when using damaris, the bit field and sample are both null
// need to use one of the st_damaris_save_model_variable_* calls for each variable that needs to be tracked
//void st_damaris_save_model_variable_int(int lpid, const char* lp_type, const char* var_name, int *data, size_t num_elements)
st_damaris_save_model_variable_double(lp->gid, "dfly_custom_router", "busy_time", s->ross_rsample.busy_time, p->radix);
st_damaris_save_model_variable_long(lp->gid, "dfly_custom_router", "link_traffic", s->ross_rsample.link_traffic_sample, p->radix);
/* clear up the current router stats */
for( i = 0; i < p->radix; i++)
{
s->ross_rsample.busy_time[i] = 0;
s->ross_rsample.link_traffic_sample[i] = 0;
}
//memset(&s->ross_rsample, 0, sizeof(s->ross_rsample));
return;
}
#endif
sample->router_id = s->router_id;
sample->end_time = tw_now(lp);
sample->fwd_events = s->ross_rsample.fwd_events;
......@@ -1913,8 +1936,8 @@ static void ross_custom_dragonfly_rsample_fn(router_state * s, tw_bf * bf, tw_lp
for(; i < p->radix; i++)
{
sample->busy_time[i] = s->ross_rsample.busy_time[i];
sample->link_traffic_sample[i] = s->ross_rsample.link_traffic_sample[i];
sample->busy_time[i] = s->ross_rsample.busy_time[i];
sample->link_traffic_sample[i] = s->ross_rsample.link_traffic_sample[i];
}
/* clear up the current router stats */
......@@ -1932,10 +1955,22 @@ static void ross_custom_dragonfly_rsample_rc_fn(router_state * s, tw_bf * bf, tw
{
(void)lp;
(void)bf;
const dragonfly_param * p = s->params;
int i =0;
#ifdef USE_RDAMARIS
if (g_st_damaris_enabled)
{
size_t num_elements;
const double *rc_busy_time = st_damaris_get_model_variable_double(lp->gid, "dfly_custom_router", "busy_time", &num_elements);
memcpy(s->ross_rsample.busy_time, rc_busy_time, num_elements * sizeof(double));
const long *rc_link_traffic = st_damaris_get_model_variable_long(lp->gid, "dfly_custom_router", "link_traffic", &num_elements);
memcpy(s->ross_rsample.link_traffic_sample, rc_link_traffic, num_elements * sizeof(long));
return;
}
#endif
for(; i < p->radix; i++)
{
s->ross_rsample.busy_time[i] = sample->busy_time[i];
......@@ -1950,7 +1985,25 @@ static void ross_custom_dragonfly_sample_fn(terminal_state * s, tw_bf * bf, tw_l
{
(void)lp;
(void)bf;
#ifdef USE_RDAMARIS
if (g_st_damaris_enabled)
{
// when using damaris, the bit field and sample are both null
// need to use one of the st_damaris_save_model_variable_* calls for each variable that needs to be tracked
//void st_damaris_save_model_variable_int(int lpid, const char* lp_type, const char* var_name, int *data, size_t num_elements)
st_damaris_save_model_variable_long(lp->gid, "dfly_custom_terminal", "fin_chunks", &s->ross_sample.fin_chunks_sample, 1);
st_damaris_save_model_variable_long(lp->gid, "dfly_custom_terminal", "data_size", &s->ross_sample.data_size_sample, 1);
st_damaris_save_model_variable_double(lp->gid, "dfly_custom_terminal", "fin_hops", &s->ross_sample.fin_hops_sample, 1);
st_damaris_save_model_variable_double(lp->gid, "dfly_custom_terminal", "fin_chunks_time", &s->ross_sample.fin_chunks_time, 1);
st_damaris_save_model_variable_double(lp->gid, "dfly_custom_terminal", "busy_time", &s->ross_sample.busy_time_sample, 1);
memset(&s->ross_sample, 0, sizeof(s->ross_sample));
return;
}
#endif
sample->terminal_id = s->terminal_id;
sample->fin_chunks_sample = s->ross_sample.fin_chunks_sample;
sample->data_size_sample = s->ross_sample.data_size_sample;
......@@ -1974,6 +2027,24 @@ static void ross_custom_dragonfly_sample_rc_fn(terminal_state * s, tw_bf * bf, t
{
(void)lp;
(void)bf;
#ifdef USE_RDAMARIS
if (g_st_damaris_enabled)
{
size_t num_elements;
const long* fin_chunks = st_damaris_get_model_variable_long(lp->gid, "dfly_custom_terminal", "fin_chunks", &num_elements);
memcpy(&(s->ross_sample.fin_chunks_sample), fin_chunks, num_elements * sizeof(long));
const long* data_size = st_damaris_get_model_variable_long(lp->gid, "dfly_custom_terminal", "data_size", &num_elements);
memcpy(&(s->ross_sample.data_size_sample), data_size, num_elements * sizeof(long));
const double* fin_hops = st_damaris_get_model_variable_double(lp->gid, "dfly_custom_terminal", "fin_hops", &num_elements);
memcpy(&(s->ross_sample.fin_hops_sample), fin_hops, num_elements * sizeof(double));
const double* fin_chunks_time = st_damaris_get_model_variable_double(lp->gid, "dfly_custom_terminal", "fin_chunks_time", &num_elements);
memcpy(&(s->ross_sample.fin_chunks_time), fin_chunks_time, num_elements * sizeof(double));
const double* busy_time = st_damaris_get_model_variable_double(lp->gid, "dfly_custom_terminal", "busy_time", &num_elements);
memcpy(&(s->ross_sample.busy_time_sample), busy_time, num_elements * sizeof(double));
return;
}
#endif
s->ross_sample.busy_time_sample = sample->busy_time_sample;
s->ross_sample.fin_chunks_time = sample->fin_chunks_time;
......