...
 
Commits (9)
......@@ -89,6 +89,6 @@ LDADD += ${DUMPI_LIBS}
endif
if USE_RDAMARIS
AM_CPPFLAGS += ${ROSS_Damaris_CFLAGS} -DUSE_RDAMARIS=1
LDADD += ${ROSS_Damaris_LIBS}
AM_CPPFLAGS += ${RISA_CFLAGS} -DUSE_RDAMARIS=1
LDADD += ${RISA_LIBS}
endif
......@@ -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
......@@ -89,15 +89,17 @@ AC_TRY_COMPILE([#include <mpi.h>], [int ret = MPI_Init(0, (void*)0)],
PKG_CHECK_MODULES_STATIC([ROSS], [ross], [],
[AC_MSG_ERROR([Could not find working ross installation via pkg-config])])
#check for Damaris
AC_ARG_WITH([damaris],[AS_HELP_STRING([--with-damaris],
[build with ROSS-Damaris in situ analysis support])],
[use_rdamaris=yes],[use_rdamaris=no])
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])])
#check for RISA
AC_ARG_WITH([risa],[AS_HELP_STRING([--with-risa],
[build with RISA (ROSS in situ analysis) support])],
[use_risa=yes],[use_risa=no])
if test "x${use_risa}" = xyes ; then
PKG_CHECK_MODULES_STATIC([RISA], [risa], [],
[AC_MSG_ERROR([Could not find working RISA installation via pkg-config])])
# PKG_CHECK_MODULES([RISA_PLUGINS], [risa], [],
# [AC_MSG_ERROR([Could not find the RISAplugins library from RISA via pkg-config])])
fi
AM_CONDITIONAL(USE_RDAMARIS, [test "x${use_rdamaris}" = xyes])
AM_CONDITIONAL(USE_RDAMARIS, [test "x${use_risa}" = xyes])
# check for enable-g
AC_ARG_ENABLE([g],[AS_HELP_STRING([--enable-g],
......
......@@ -1894,6 +1894,7 @@ YY_BUFFER_STATE CodesIOKernel__scan_bytes (yyconst char * yybytes, int _yybyte
static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
{
(void) yyscanner;
(void) fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
......@@ -2238,11 +2239,13 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
void *CodesIOKernel_alloc (yy_size_t size , yyscan_t yyscanner)
{
(void) yyscanner;
return (void *) malloc( size );
}
void *CodesIOKernel_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
{
(void) yyscanner;
/* The cast to (char *) in the following accommodates both
* implementations that use char* generic pointers, and those
* that use void* generic pointers. It works with the latter
......@@ -2255,6 +2258,7 @@ void *CodesIOKernel_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
void CodesIOKernel_free (void * ptr , yyscan_t yyscanner)
{
(void) yyscanner;
free( (char *) ptr ); /* see CodesIOKernel_realloc() for (char *) cast */
}
......
......@@ -365,7 +365,7 @@ void nw_test_finalize(nw_state* s, tw_lp* lp)
total_delays += s->num_delays;
total_collectives += s->num_cols;
printf("\n LP %llu total sends %ld receives %ld wait_alls %ld waits %ld ", lp->gid, s->num_sends,s->num_recvs, s->num_waitall, s->num_wait);
printf("\n LP %lu total sends %ld receives %ld wait_alls %ld waits %ld ", lp->gid, s->num_sends,s->num_recvs, s->num_waitall, s->num_wait);
avg_time += s->total_time;
avg_compute_time += s->compute_time;
avg_comm_time += (s->total_time - s->compute_time);
......
......@@ -55,8 +55,8 @@ static int num_net_traces = 0;
static int num_dumpi_traces = 0;
static int64_t EAGER_THRESHOLD = 8192;
static long num_ops = 0;
static int upper_threshold = 1048576;
//static long num_ops = 0;
//static int upper_threshold = 1048576;
static int alloc_spec = 0;
static tw_stime self_overhead = 10.0;
static tw_stime mean_interval = 100000;
......@@ -801,7 +801,7 @@ void arrive_syn_tr(nw_state * s, tw_bf * bf, nw_message * m, tw_lp * lp)
// printf("\n Data arrived %d total data %ld ", m->fwd.num_bytes, s->syn_data);
if(s->local_rank == 0)
{
printf("\n Data arrived %lld rank %llu total data %ld ", m->fwd.num_bytes, s->nw_id, s->syn_data);
printf("\n Data arrived %ld rank %lu total data %ld ", m->fwd.num_bytes, s->nw_id, s->syn_data);
/* if(s->syn_data > upper_threshold)
if(s->local_rank == 0)
{
......@@ -836,6 +836,7 @@ static void print_msgs_queue(struct qlist_head * head, int is_send)
struct qlist_head * ent = NULL;
mpi_msgs_queue * current = NULL;
(void)current;
qlist_for_each(ent, head)
{
current = qlist_entry(ent, mpi_msgs_queue, ql);
......@@ -2652,9 +2653,41 @@ static void nw_add_lp_type()
lp_type_register("nw-lp", nw_get_lp_type());
}
/* setup for the ROSS event tracing
*/
void nw_lp_event_collect(nw_message *m, tw_lp *lp, char *buffer, int *collect_flag)
/***** ROSS model instrumentation *****/
void nw_lp_vt_sample_fn(nw_state *s, tw_bf *bf, tw_lp *lp);
void nw_lp_vt_sample_rc_fn(nw_state *s, tw_bf *bf, tw_lp *lp);
void nw_lp_rt_sample_fn(nw_state *s, tw_lp *lp);
void nw_lp_event_trace(nw_message *m, tw_lp *lp, char *buffer, int *collect_flag);
char nw_lp_name[] = "nw_server\0";
st_model_types nw_lp_model_types[] = {
{nw_lp_name,
NULL,
0,
(vts_event_f) nw_lp_vt_sample_fn,
(vts_revent_f) nw_lp_vt_sample_rc_fn,
(rt_event_f) nw_lp_rt_sample_fn,
(ev_trace_f) nw_lp_event_trace,
sizeof(int)},
{0}
};
void nw_lp_vt_sample_fn(nw_state *s, tw_bf *bf, tw_lp *lp)
{
(void)s;
(void)bf;
(void)lp;
}
void nw_lp_vt_sample_rc_fn(nw_state *s, tw_bf *bf, tw_lp *lp)
{
(void)s;
(void)bf;
(void)lp;
}
void nw_lp_event_trace(nw_message *m, tw_lp *lp, char *buffer, int *collect_flag)
{
(void)lp;
(void)collect_flag;
......@@ -2663,30 +2696,12 @@ void nw_lp_event_collect(nw_message *m, tw_lp *lp, char *buffer, int *collect_fl
memcpy(buffer, &type, sizeof(type));
}
/* can add in any model level data to be collected along with simulation engine data
* in the ROSS instrumentation. Will need to update the last field in
* nw_lp_model_types[0] for the size of the data to save in each function call
*/
void nw_lp_model_stat_collect(nw_state *s, tw_lp *lp, char *buffer)
void nw_lp_rt_sample_fn(nw_state *s, tw_lp *lp)
{
(void)s;
(void)lp;
(void)buffer;
return;
}
st_model_types nw_lp_model_types[] = {
{(ev_trace_f) nw_lp_event_collect,
sizeof(int),
(model_stat_f) nw_lp_model_stat_collect,
0,
NULL,
NULL,
0},
{NULL, 0, NULL, 0, NULL, NULL, 0}
};
static const st_model_types *nw_lp_get_model_stat_types(void)
{
return(&nw_lp_model_types[0]);
......@@ -2696,7 +2711,7 @@ void nw_lp_register_model()
{
st_model_type_register("nw-lp", nw_lp_get_model_stat_types());
}
/* end of ROSS event tracing setup */
/***** End of ROSS Instrumentation *****/
static int msg_size_hash_compare(
void *key, struct qhash_head *link)
......
......@@ -111,38 +111,53 @@ tw_lptype svr_lp = {
sizeof(svr_state),
};
/* setup for the ROSS event tracing
*/
void custom_svr_event_collect(svr_msg *m, tw_lp *lp, char *buffer, int *collect_flag)
/***** ROSS model instrumentation *****/
void custom_svr_vt_sample_fn(svr_state *s, tw_bf *bf, tw_lp *lp);
void custom_svr_vt_sample_rc_fn(svr_state *s, tw_bf *bf, tw_lp *lp);
void custom_svr_rt_sample_fn(svr_state *s, tw_lp *lp);
void custom_svr_event_trace(svr_msg *m, tw_lp *lp, char *buffer, int *collect_flag);
char custom_svr_name[] = "dfly_custom_server\0";
st_model_types custom_svr_model_types[] = {
{custom_svr_name,
NULL,
0,
(vts_event_f) custom_svr_vt_sample_fn,
(vts_revent_f) custom_svr_vt_sample_rc_fn,
(rt_event_f) custom_svr_rt_sample_fn,
(ev_trace_f) custom_svr_event_trace,
sizeof(int)},
{0}
};
void custom_svr_vt_sample_fn(svr_state *s, tw_bf *bf, tw_lp *lp)
{
(void)s;
(void)bf;
(void)lp;
(void)collect_flag;
int type = (int) m->svr_event_type;
memcpy(buffer, &type, sizeof(type));
}
/* can add in any model level data to be collected along with simulation engine data
* in the ROSS instrumentation. Will need to update the last field in
* svr_model_types[0] for the size of the data to save in each function call
*/
void custom_svr_model_stat_collect(svr_state *s, tw_lp *lp, char *buffer)
void custom_svr_vt_sample_rc_fn(svr_state *s, tw_bf *bf, tw_lp *lp)
{
(void)s;
(void)bf;
(void)lp;
(void)buffer;
return;
}
st_model_types custom_svr_model_types[] = {
{(ev_trace_f) custom_svr_event_collect,
sizeof(int),
(model_stat_f) custom_svr_model_stat_collect,
0,
NULL,
NULL,
0},
{NULL, 0, NULL, 0, NULL, NULL, 0}
};
void custom_svr_rt_sample_fn(svr_state *s, tw_lp *lp)
{
(void)s;
(void)lp;
}
void custom_svr_event_trace(svr_msg *m, tw_lp *lp, char *buffer, int *collect_flag)
{
(void)lp;
(void)collect_flag;
int type = (int) m->svr_event_type;
memcpy(buffer, &type, sizeof(type));
}
static const st_model_types *custom_svr_get_model_stat_types(void)
{
......@@ -154,6 +169,8 @@ void custom_svr_register_model_types()
st_model_type_register("nw-lp", custom_svr_get_model_stat_types());
}
/***** End of ROSS Instrumentation *****/
const tw_optdef app_opt [] =
{
TWOPT_GROUP("Model net synthetic traffic " ),
......@@ -311,7 +328,7 @@ static void handle_kickoff_event(
int rand_node_intra_id = tw_rand_integer(lp->rng, 0, num_nodes_per_grp-1);
local_dest = (rand_group * num_nodes_per_grp) + rand_node_intra_id;
printf("\n LP %ld sending to %ld num nodes %d ", local_id, local_dest, num_nodes);
printf("\n LP %d sending to %ld num nodes %llu ", local_id, local_dest, num_nodes);
}
assert(local_dest < num_nodes);
......
......@@ -110,6 +110,65 @@ tw_lptype svr_lp = {
sizeof(svr_state),
};
/***** ROSS model instrumentation *****/
void svr_vt_sample_fn(svr_state *s, tw_bf *bf, tw_lp *lp);
void svr_vt_sample_rc_fn(svr_state *s, tw_bf *bf, tw_lp *lp);
void svr_rt_sample_fn(svr_state *s, tw_lp *lp);
void svr_event_trace(svr_msg *m, tw_lp *lp, char *buffer, int *collect_flag);
char svr_name[] = "dfly_plus_server\0";
st_model_types svr_model_types[] = {
{svr_name,
NULL,
0,
(vts_event_f) svr_vt_sample_fn,
(vts_revent_f) svr_vt_sample_rc_fn,
(rt_event_f) svr_rt_sample_fn,
(ev_trace_f) svr_event_trace,
sizeof(int)},
{0}
};
void svr_vt_sample_fn(svr_state *s, tw_bf *bf, tw_lp *lp)
{
(void)s;
(void)bf;
(void)lp;
}
void svr_vt_sample_rc_fn(svr_state *s, tw_bf *bf, tw_lp *lp)
{
(void)s;
(void)bf;
(void)lp;
}
void svr_rt_sample_fn(svr_state *s, tw_lp *lp)
{
(void)s;
(void)lp;
}
void svr_event_trace(svr_msg *m, tw_lp *lp, char *buffer, int *collect_flag)
{
(void)lp;
(void)collect_flag;
int type = (int) m->svr_event_type;
memcpy(buffer, &type, sizeof(type));
}
static const st_model_types *svr_get_model_stat_types(void)
{
return(&svr_model_types[0]);
}
void svr_register_model_types()
{
st_model_type_register("server", svr_get_model_stat_types());
}
/***** End of ROSS Instrumentation *****/
const tw_optdef app_opt [] =
{
TWOPT_GROUP("Model net synthetic traffic " ),
......@@ -437,6 +496,9 @@ int main(
model_net_register();
svr_add_lp_type();
if (g_st_ev_trace || g_st_model_stats || g_st_use_analysis_lps)
svr_register_model_types();
codes_mapping_setup();
net_ids = model_net_configure(&num_nets);
......
......@@ -122,42 +122,56 @@ tw_lptype svr_lp = {
sizeof(svr_state),
};
/* setup for the ROSS event tracing
*/
void ft_svr_event_collect(svr_msg *m, tw_lp *lp, char *buffer, int *collect_flag)
/***** ROSS model instrumentation *****/
void ft_svr_vt_sample_fn(svr_state *s, tw_bf *bf, tw_lp *lp);
void ft_svr_vt_sample_rc_fn(svr_state *s, tw_bf *bf, tw_lp *lp);
void ft_svr_rt_sample_fn(svr_state *s, tw_lp *lp);
void ft_svr_event_trace(svr_msg *m, tw_lp *lp, char *buffer, int *collect_flag);
char ft_svr_name[] = "ft_server\0";
st_model_types ft_svr_model_types[] = {
{ft_svr_name,
NULL,
0,
(vts_event_f) ft_svr_vt_sample_fn,
(vts_revent_f) ft_svr_vt_sample_rc_fn,
(rt_event_f) ft_svr_rt_sample_fn,
(ev_trace_f) ft_svr_event_trace,
sizeof(int)},
{0}
};
void ft_svr_vt_sample_fn(svr_state *s, tw_bf *bf, tw_lp *lp)
{
(void)s;
(void)bf;
(void)lp;
(void)buffer;
(void)collect_flag;
}
int type = (int) m->svr_event_type;
memcpy(buffer, &type, sizeof(type));
void ft_svr_vt_sample_rc_fn(svr_state *s, tw_bf *bf, tw_lp *lp)
{
(void)s;
(void)bf;
(void)lp;
}
/* can add in any model level data to be collected along with simulation engine data
* in the ROSS instrumentation. Will need to update the last field in
* ft_svr_model_types[0] for the size of the data to save in each function call
*/
void ft_svr_model_stat_collect(svr_state *s, tw_lp *lp, char *buffer)
void ft_svr_rt_sample_fn(svr_state *s, tw_lp *lp)
{
(void)s;
(void)lp;
}
void ft_svr_event_trace(svr_msg *m, tw_lp *lp, char *buffer, int *collect_flag)
{
(void)lp;
(void)buffer;
(void)collect_flag;
return;
int type = (int) m->svr_event_type;
memcpy(buffer, &type, sizeof(type));
}
st_model_types ft_svr_model_types[] = {
{(ev_trace_f) ft_svr_event_collect,
sizeof(int),
(model_stat_f) ft_svr_model_stat_collect,
0,
NULL,
NULL,
0},
{NULL, 0, NULL, 0, NULL, NULL, 0}
};
static const st_model_types *ft_svr_get_model_stat_types(void)
{
return(&ft_svr_model_types[0]);
......@@ -168,6 +182,8 @@ void ft_svr_register_model_stats()
st_model_type_register("server", ft_svr_get_model_stat_types());
}
/***** End of ROSS Instrumentation *****/
const tw_optdef app_opt [] =
{
TWOPT_GROUP("Model net synthetic traffic " ),
......@@ -561,7 +577,7 @@ int main(
int idx = 0;
int gvt_computations;
long long total_events, rollbacks, net_events;
float running_time, efficiency, event_rate;
float running_time = 0, efficiency = 0, event_rate = 0;
while (pch != NULL)
{
pch = strtok (NULL, ",");
......
......@@ -120,38 +120,53 @@ tw_lptype svr_lp = {
sizeof(svr_state),
};
/* setup for the ROSS event tracing
*/
void svr_event_collect(svr_msg *m, tw_lp *lp, char *buffer, int *collect_flag)
/***** ROSS model instrumentation *****/
void svr_vt_sample_fn(svr_state *s, tw_bf *bf, tw_lp *lp);
void svr_vt_sample_rc_fn(svr_state *s, tw_bf *bf, tw_lp *lp);
void svr_rt_sample_fn(svr_state *s, tw_lp *lp);
void svr_event_trace(svr_msg *m, tw_lp *lp, char *buffer, int *collect_flag);
char svr_name[] = "sfly_server\0";
st_model_types svr_model_types[] = {
{svr_name,
NULL,
0,
(vts_event_f) svr_vt_sample_fn,
(vts_revent_f) svr_vt_sample_rc_fn,
(rt_event_f) svr_rt_sample_fn,
(ev_trace_f) svr_event_trace,
sizeof(int)},
{0}
};
void svr_vt_sample_fn(svr_state *s, tw_bf *bf, tw_lp *lp)
{
(void)s;
(void)bf;
(void)lp;
(void)collect_flag;
int type = (int) m->svr_event_type;
memcpy(buffer, &type, sizeof(type));
}
/* can add in any model level data to be collected along with simulation engine data
* in the ROSS instrumentation. Will need to update the last field in
* svr_model_types[0] for the size of the data to save in each function call
*/
void svr_model_stat_collect(svr_state *s, tw_lp *lp, char *buffer)
void svr_vt_sample_rc_fn(svr_state *s, tw_bf *bf, tw_lp *lp)
{
(void)s;
(void)bf;
(void)lp;
(void)buffer;
return;
}
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, NULL, 0}
};
void svr_rt_sample_fn(svr_state *s, tw_lp *lp)
{
(void)s;
(void)lp;
}
void svr_event_trace(svr_msg *m, tw_lp *lp, char *buffer, int *collect_flag)
{
(void)lp;
(void)collect_flag;
int type = (int) m->svr_event_type;
memcpy(buffer, &type, sizeof(type));
}
static const st_model_types *svr_get_model_stat_types(void)
{
......@@ -163,6 +178,8 @@ void svr_register_model_types()
st_model_type_register("server", svr_get_model_stat_types());
}
/***** End of ROSS Instrumentation *****/
const tw_optdef app_opt [] =
{
TWOPT_GROUP("Model net synthetic traffic " ),
......@@ -616,7 +633,7 @@ int main(
int idx = 0;
int gvt_computations;
long long total_events, rollbacks, net_events;
float running_time, efficiency, event_rate;
float running_time = 0, efficiency = 0, event_rate = 0;
while (pch != NULL)
{
pch = strtok (NULL, ",");
......
......@@ -107,38 +107,53 @@ tw_lptype svr_lp = {
sizeof(svr_state),
};
/* setup for the ROSS event tracing
*/
void svr_event_collect(svr_msg *m, tw_lp *lp, char *buffer, int *collect_flag)
/***** ROSS model instrumentation *****/
void svr_vt_sample_fn(svr_state *s, tw_bf *bf, tw_lp *lp);
void svr_vt_sample_rc_fn(svr_state *s, tw_bf *bf, tw_lp *lp);
void svr_rt_sample_fn(svr_state *s, tw_lp *lp);
void svr_event_trace(svr_msg *m, tw_lp *lp, char *buffer, int *collect_flag);
char svr_name[] = "dfly_server\0";
st_model_types svr_model_types[] = {
{svr_name,
NULL,
0,
(vts_event_f) svr_vt_sample_fn,
(vts_revent_f) svr_vt_sample_rc_fn,
(rt_event_f) svr_rt_sample_fn,
(ev_trace_f) svr_event_trace,
sizeof(int)},
{0}
};
void svr_vt_sample_fn(svr_state *s, tw_bf *bf, tw_lp *lp)
{
(void)s;
(void)bf;
(void)lp;
(void)collect_flag;
int type = (int) m->svr_event_type;
memcpy(buffer, &type, sizeof(type));
}
/* can add in any model level data to be collected along with simulation engine data
* in the ROSS instrumentation. Will need to update the last field in
* svr_model_types[0] for the size of the data to save in each function call
*/
void svr_model_stat_collect(svr_state *s, tw_lp *lp, char *buffer)
void svr_vt_sample_rc_fn(svr_state *s, tw_bf *bf, tw_lp *lp)
{
(void)s;
(void)bf;
(void)lp;
(void)buffer;
return;
}
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, NULL, 0}
};
void svr_rt_sample_fn(svr_state *s, tw_lp *lp)
{
(void)s;
(void)lp;
}
void svr_event_trace(svr_msg *m, tw_lp *lp, char *buffer, int *collect_flag)
{
(void)lp;
(void)collect_flag;
int type = (int) m->svr_event_type;
memcpy(buffer, &type, sizeof(type));
}
static const st_model_types *svr_get_model_stat_types(void)
{
......@@ -150,6 +165,8 @@ void svr_register_model_types()
st_model_type_register("server", svr_get_model_stat_types());
}
/***** End of ROSS Instrumentation *****/
const tw_optdef app_opt [] =
{
TWOPT_GROUP("Model net synthetic traffic " ),
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -1437,7 +1437,7 @@ terminal_final( terminal_state * s, tw_lp * lp )
if(!s->terminal_id)
written = sprintf(s->output_buf, "# Format <LP id> <Terminal ID> <Total Data Size> <Avg packet latency> <# Flits/Packets finished> <Avg hops> <Busy Time>");
written += sprintf(s->output_buf + written, "\n %llu %u %llu %lf %ld %lf %lf",
written += sprintf(s->output_buf + written, "\n %llu %u %lu %lf %ld %lf %lf",
LLU(lp->gid), s->terminal_id, s->total_msg_size, s->total_time,
s->finished_packets, (double)s->total_hops/s->finished_chunks,
s->busy_time);
......
......@@ -296,12 +296,12 @@ struct switch_state
int *lft;
};
/* ROSS Instrumentation Support */
/***** ROSS model instrumentation *****/
struct fattree_cn_sample
{
tw_lpid terminal_id;
tw_stime end_time;
int vc_occupancy;
int vc_occupancy;
};
struct fattree_switch_sample
......@@ -311,31 +311,162 @@ struct fattree_switch_sample
tw_stime end_time;
};
void fattree_event_collect(fattree_message *m, tw_lp *lp, char *buffer, int *collect_flag);
void fattree_model_stat_collect(ft_terminal_state *s, tw_lp *lp, char *buffer);
static void ross_fattree_sample_fn(ft_terminal_state * s, tw_bf * bf, tw_lp * lp, struct fattree_cn_sample *sample);
static void ross_fattree_sample_rc_fn(ft_terminal_state * s, tw_bf * bf, tw_lp * lp, struct fattree_cn_sample *sample);
static void ross_fattree_ssample_fn(switch_state * s, tw_bf * bf, tw_lp * lp, struct fattree_switch_sample *sample);
static void ross_fattree_ssample_rc_fn(switch_state * s, tw_bf * bf, tw_lp * lp, struct fattree_switch_sample *sample);
void fattree_event_trace(fattree_message *m, tw_lp *lp, char *buffer, int *collect_flag);
void fattree_rt_sample_fn(ft_terminal_state *s, tw_lp *lp);
void fattree_switch_rt_sample_fn(switch_state *s, tw_lp *lp);
static void fattree_vt_sample_fn(ft_terminal_state * s, tw_bf * bf, tw_lp * lp);
static void fattree_vt_sample_rc_fn(ft_terminal_state * s, tw_bf * bf, tw_lp * lp);
static void fattree_vt_ssample_fn(switch_state * s, tw_bf * bf, tw_lp * lp);
static void fattree_vt_ssample_rc_fn(switch_state * s, tw_bf * bf, tw_lp * lp);
char ftree_switch_lp_name[] = "ftree_switch\0";
char ftree_terminal_lp_name[] = "ftree_terminal\0";
char* ftree_svar_names[] = {
"switch_id\0",
"vc_occupancy\0"
};
char* ftree_tvar_names[] = {
"terminal_id\0",
"vc_occupancy\0"
};
st_model_var ftree_switch_vars[] = {
{"",
MODEL_INT,
1},
{"",
MODEL_INT,
0}
};
st_model_var ftree_terminal_vars[] = {
{"",
MODEL_INT,
1},
{"",
MODEL_INT,
1}
};
#define ftree_num_tvars 2
#define ftree_num_svars 2
st_model_types fattree_model_types[] = {
{(ev_trace_f) fattree_event_collect,
sizeof(int),
(model_stat_f) fattree_model_stat_collect,
0, // update when changing fattree_model_stat_collect
(sample_event_f) ross_fattree_sample_fn,
(sample_revent_f) ross_fattree_sample_rc_fn,
sizeof(struct fattree_cn_sample) } ,
{(ev_trace_f) fattree_event_collect,
sizeof(int),
(model_stat_f) fattree_model_stat_collect,
0, // update when changing fattree_model_stat_collect
(sample_event_f) ross_fattree_ssample_fn,
(sample_revent_f) ross_fattree_ssample_rc_fn,
0 } , // updated in switch_init()
{NULL, 0, NULL, 0, NULL, NULL, 0}
{ftree_terminal_lp_name,
ftree_terminal_vars,
ftree_num_tvars,
(vts_event_f) fattree_vt_sample_fn,
(vts_revent_f) fattree_vt_sample_rc_fn,
(rt_event_f) fattree_rt_sample_fn,
(ev_trace_f) fattree_event_trace,
sizeof(int)},
{ftree_switch_lp_name,
ftree_switch_vars,
ftree_num_svars,
(vts_event_f) fattree_vt_ssample_fn,
(vts_revent_f) fattree_vt_ssample_rc_fn,
(rt_event_f) fattree_switch_rt_sample_fn,
(ev_trace_f) fattree_event_trace,
sizeof(int)},
{0}
};
/* End of ROSS model stats collection */
void ftree_terminal_init_model_vars()
{
int i;
for (i = 0; i < ftree_num_tvars; i++)
{
ftree_terminal_vars[i].var_name = ftree_tvar_names[i];
}
}
void ftree_switch_init_model_vars(int radix)
{
int i;
for (i = 0; i < ftree_num_svars; i++)
{
ftree_switch_vars[i].var_name = ftree_svar_names[i];
if (i > 0)
ftree_switch_vars[i].num_elems = radix;
}
}
void fattree_event_trace(fattree_message *m, tw_lp *lp, char *buffer, int* collect_flag)
{
(void)lp;
(void)collect_flag;
int type = (int) m->type;
memcpy(buffer, &type, sizeof(type));
}
void fattree_rt_sample_fn(ft_terminal_state *s, tw_lp *lp)
{
(void)lp;
int terminal_id = (int)s->terminal_id;
st_save_model_variable(lp, ftree_tvar_names[0], &terminal_id);
st_save_model_variable(lp, ftree_tvar_names[1], &s->vc_occupancy[0]);
}
void fattree_switch_rt_sample_fn(switch_state *s, tw_lp *lp)
{
(void)lp;
int switch_id = (int)s->switch_id;
st_save_model_variable(lp, ftree_svar_names[0], &switch_id);
st_save_model_variable(lp, ftree_svar_names[1], &s->vc_occupancy[0]);
}
static void fattree_vt_sample_fn(ft_terminal_state * s, tw_bf * bf, tw_lp * lp)
{
(void)bf;
(void)lp;
(void)s;
int terminal_id = (int)s->terminal_id;
st_save_model_variable(lp, ftree_tvar_names[0], &terminal_id);
st_save_model_variable(lp, ftree_tvar_names[1], &s->vc_occupancy[0]);
}
static void fattree_vt_sample_rc_fn(ft_terminal_state * s, tw_bf * bf, tw_lp * lp)
{
(void)lp;
(void)bf;
(void)s;
// state doesn't change in forward handler so nothing to do here
}
static void fattree_vt_ssample_fn(switch_state * s, tw_bf * bf, tw_lp * lp)
{
(void)lp;
(void)bf;
int switch_id = (int)s->switch_id;
st_save_model_variable(lp, ftree_svar_names[0], &switch_id);
st_save_model_variable(lp, ftree_svar_names[1], &s->vc_occupancy[0]);
}
static void fattree_vt_ssample_rc_fn(switch_state * s, tw_bf * bf, tw_lp * lp)
{
(void)lp;
(void)bf;
(void)s;
// state doesn't change in forward handler so nothing to do here
}
static const st_model_types *fattree_get_cn_model_stat_types(void)
{
return(&fattree_model_types[0]);
}
static void fattree_register_model_stats(st_model_types *base_type)
{
st_model_type_register(LP_CONFIG_NM, base_type);
st_model_type_register("fattree_switch", &fattree_model_types[1]);
}
/***** End of ROSS Instrumentation *****/
static tw_stime fattree_total_time = 0;
static tw_stime fattree_max_latency = 0;
......@@ -1080,6 +1211,9 @@ void ft_terminal_init( ft_terminal_state * s, tw_lp * lp )
s->total_time = 0.0;
s->total_msg_size = 0;
// for ROSS Instrumentation
ftree_terminal_init_model_vars();
#if FATTREE_DEBUG
printf("I am terminal %d (%llu), connected to switch %d in rail id %d\n", s->terminal_id,
LLU(lp->gid), s->switch_id, s->rail_id);
......@@ -1134,6 +1268,8 @@ void switch_init(switch_state * r, tw_lp * lp)
fattree_param *p = r->params;
if(mapping_rep_id >= p->num_switches[mapping_offset % p->num_levels]) {
r->unused = 1;
// for ROSS instrumentation, only necessary in fat tree because some switches are unused
lp->model_types = NULL;
return;
}
......@@ -1174,8 +1310,7 @@ void switch_init(switch_state * r, tw_lp * lp)
r->busy_time_sample = (tw_stime*)malloc(r->radix * sizeof(tw_stime));
// ROSS Instrumentation
if (g_st_use_analysis_lps && g_st_model_stats)
lp->model_types->sample_struct_sz = sizeof(struct fattree_switch_sample) + sizeof(int) * r->radix;
ftree_switch_init_model_vars(r->radix);
rc_stack_create(&r->st);
......@@ -1943,6 +2078,7 @@ void switch_packet_receive( switch_state * s, tw_bf * bf,
int max_vc_size = s->params->vc_size;
int to_terminal = 0;
(void) to_terminal;
//If going to terminal, use a different max
if(s->switch_level == 0 && output_port < s->num_lcons) {
......@@ -2793,7 +2929,7 @@ void fattree_terminal_final( ft_terminal_state * s, tw_lp * lp )
if(!s->terminal_id && !s->rail_id)
written = sprintf(s->output_buf, "# Format <LP id> <Terminal ID> <Rail ID> <Total Data Size> <Avg packet latency> <# Flits/Packets finished> <Avg hops> <Busy Time>\n");
written += sprintf(s->output_buf + written, "%llu %u %u %llu %lf %ld %lf %lf\n",
written += sprintf(s->output_buf + written, "%llu %u %u %lu %lf %ld %lf %lf\n",
LLU(lp->gid), s->terminal_id, s->rail_id, s->total_msg_size, s->total_time,
s->finished_packets, (double)s->total_hops/s->finished_chunks,
s->busy_time[0]);
......@@ -3030,82 +3166,6 @@ static void fattree_register(tw_lptype *base_type) {
lp_type_register("fattree_switch", &fattree_lps[1]);
}
/* For ROSS Instrumentation */
void fattree_event_collect(fattree_message *m, tw_lp *lp, char *buffer, int *collect_flag)
{
(void)lp;
(void)collect_flag;
int type = (int) m->type;
memcpy(buffer, &type, sizeof(type));
}
void fattree_model_stat_collect(ft_terminal_state *s, tw_lp *lp, char *buffer)
{
(void)lp;
(void)s;
(void)buffer;
return;
}
static void ross_fattree_sample_fn(ft_terminal_state * s, tw_bf * bf, tw_lp * lp, struct fattree_cn_sample *sample)
{
(void)bf;
sample->terminal_id = s->terminal_id;
sample->end_time = tw_now(lp);
sample->vc_occupancy = s->vc_occupancy[0];
return;
}
static void ross_fattree_sample_rc_fn(ft_terminal_state * s, tw_bf * bf, tw_lp * lp, struct fattree_cn_sample *sample)
{
(void)lp;
(void)bf;
(void)s;
(void)sample;
return;
}
static void ross_fattree_ssample_fn(switch_state * s, tw_bf * bf, tw_lp * lp, struct fattree_switch_sample *sample)
{
(void)bf;
int i;
sample->switch_id = s->switch_id;
sample->end_time = tw_now(lp);
sample->vc_occupancy = (int*)((&sample->end_time) + 1);
for (i = 0; i < s->radix; i++)
sample->vc_occupancy[i] = s->vc_occupancy[i];
return;
}
static void ross_fattree_ssample_rc_fn(switch_state * s, tw_bf * bf, tw_lp * lp, struct fattree_switch_sample *sample)
{
(void)lp;
(void)bf;
(void)s;
(void)sample;
return;
}
static const st_model_types *fattree_get_cn_model_stat_types(void)
{
return(&fattree_model_types[0]);
}
static void fattree_register_model_stats(st_model_types *base_type)
{
st_model_type_register(LP_CONFIG_NM, base_type);
st_model_type_register("fattree_switch", &fattree_model_types[1]);
}
/*** END of ROSS event tracing additions */
struct model_net_method fattree_method =
{
......
......@@ -121,8 +121,7 @@ tw_lptype model_net_base_lp = {
sizeof(model_net_base_state),
};
/* setup for the ROSS event tracing
*/
/* setup for the ROSS Instrumentation */
void mn_event_collect(model_net_wrap_msg *m, tw_lp *lp, char *buffer, int *collect_flag)
{
// assigning large numbers to message types to make it easier to
......@@ -150,42 +149,45 @@ void mn_event_collect(model_net_wrap_msg *m, tw_lp *lp, char *buffer, int *colle
(((model_net_base_state*)lp->cur_state)->sub_model_type->ev_trace)(sub_msg, lp, buffer, collect_flag);
}
break;
default: // this shouldn't happen, but can help detect an issue
type = 9004;
default: // this shouldn't happen
tw_error(TW_LOC, "error in event type received at model net base LP (for instrumentation)");
break;
}
}
void mn_model_stat_collect(model_net_base_state *s, tw_lp *lp, char *buffer)
void mn_model_stat_collect(model_net_base_state *s, tw_lp *lp)
{
// need to call the model level stats collection fn
if (s->sub_model_type)
(*s->sub_model_type->model_stat_fn)(s->sub_state, lp, buffer);
(*s->sub_model_type->rt_event_fn)(s->sub_state, lp);
return;
}
void mn_sample_event(model_net_base_state *s, tw_bf * bf, tw_lp * lp, void *sample)
void mn_sample_event(model_net_base_state *s, tw_bf * bf, tw_lp * lp)
{
if (s->sub_model_type)
(*s->sub_model_type->sample_event_fn)(s->sub_state, bf, lp, sample);
(*s->sub_model_type->vts_event_fn)(s->sub_state, bf, lp);
}
void mn_sample_rc_event(model_net_base_state *s, tw_bf * bf, tw_lp * lp, void *sample)
void mn_sample_rc_event(model_net_base_state *s, tw_bf * bf, tw_lp * lp)
{
if (s->sub_model_type)
(*s->sub_model_type->sample_revent_fn)(s->sub_state, bf, lp, sample);
(*s->sub_model_type->vts_revent_fn)(s->sub_state, bf, lp);
}
st_model_types mn_model_types[MAX_NETS];
static const char mn_base_name[] = "model_net_base\0";
st_model_types mn_model_base_type = {
(ev_trace_f) mn_event_collect,
sizeof(int),
(model_stat_f) mn_model_stat_collect,
mn_base_name,
NULL,
0,
(sample_event_f) mn_sample_event,
(sample_revent_f) mn_sample_rc_event,
0
(vts_event_f) mn_sample_event,
(vts_revent_f) mn_sample_rc_event,
(rt_event_f) mn_model_stat_collect,
(ev_trace_f) mn_event_collect,
sizeof(int)
};
/**** END LP, EVENT PROCESSING FUNCTION DECLS ****/
......@@ -488,8 +490,9 @@ void model_net_base_lp_init(
ns->sub_model_type = model_net_get_model_stat_type(ns->net_id);
if (ns->sub_model_type)
{
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;
mn_model_types[ns->net_id].lp_name = ns->sub_model_type->lp_name;
mn_model_types[ns->net_id].model_vars = ns->sub_model_type->model_vars;
mn_model_types[ns->net_id].num_vars = ns->sub_model_type->num_vars;
}
}
......@@ -532,7 +535,7 @@ void model_net_base_event(
tw_lp * lp){
if(m->h.magic != model_net_base_magic)
printf("\n LP ID mismatched %llu ", lp->gid);
printf("\n LP ID mismatched %lu ", lp->gid);
assert(m->h.magic == model_net_base_magic);
......
This diff is collapsed.
......@@ -102,7 +102,7 @@ int lp_io_write(tw_lpid gid, char* identifier, int size, void* buffer)
}
int lp_io_write_rev(tw_lpid gid, char* identifier){
struct identifier* id, *id_prev;
struct identifier* id, *id_prev = NULL;
struct io_buffer *buf, *buf_prev;
/* find given identifier */
......
......@@ -15,7 +15,7 @@ static char type[128] = {'\0'};
static darshan_params d_params = {"", 0};
static iolang_params i_params = {0, 0, "", ""};
static recorder_params r_params = {"", 0};
static dumpi_trace_params du_params = {"", 0};
static dumpi_trace_params du_params = {"", 0, 0};
static online_comm_params oc_params = {"", "", 0};
static checkpoint_wrkld_params c_params = {0, 0, 0, 0, 0};
static iomock_params im_params = {0, 0, 1, 0, 0, 0};
......
......@@ -420,7 +420,7 @@ void codes_workload_print_op(
case CODES_WK_SEND:
fprintf(f, "op: app:%d rank:%d type:send "
"src:%d dst:%d bytes:%"PRIu64" type:%d count:%d tag:%d "
"src:%d dst:%d bytes:%d type:%d count:%d tag:%d "
//"src:%d dst:%d bytes:%d type:%d count:%d tag:%d "
"start:%.5e end:%.5e\n",
app_id, rank,
op->u.send.source_rank, op->u.send.dest_rank,
......