Commit b25e8d10 authored by Misbah Mubarak's avatar Misbah Mubarak

Resolving issues with model net magic number initialization

parent 6f947dfc
216 /path/to/AMG/df_AMG_n216_dumpi/dumpi-2014.03.03.14.55.23- 216 synthetic
125 /path/to/Multigrid/MultiGrid_C_n125_dumpi/dumpi-2014.03.06.23.48.13- 125 /Users/mmubarak/Documents/software_development/df_traces/Multigrid/MultiGrid_C_n125_dumpi/dumpi-2014.03.06.23.48.13-
100 /path/to/Crystal_Router/100/dumpi--2014.04.23.12.12.05-
...@@ -492,6 +492,14 @@ static terminal_custom_message_list* return_tail( ...@@ -492,6 +492,14 @@ static terminal_custom_message_list* return_tail(
} }
static void dragonfly_read_config(const char * anno, dragonfly_param *params){ static void dragonfly_read_config(const char * anno, dragonfly_param *params){
/*Adding init for router magic number*/
uint32_t h1 = 0, h2 = 0;
bj_hashlittle2(LP_METHOD_NM_ROUT, strlen(LP_METHOD_NM_ROUT), &h1, &h2);
router_magic_num = h1 + h2;
bj_hashlittle2(LP_METHOD_NM_TERM, strlen(LP_METHOD_NM_TERM), &h1, &h2);
terminal_magic_num = h1 + h2;
// shorthand // shorthand
dragonfly_param *p = params; dragonfly_param *p = params;
int myRank; int myRank;
...@@ -822,10 +830,6 @@ terminal_custom_init( terminal_state * s, ...@@ -822,10 +830,6 @@ terminal_custom_init( terminal_state * s,
s->packet_gen = 0; s->packet_gen = 0;
s->packet_fin = 0; s->packet_fin = 0;
uint32_t h1 = 0, h2 = 0;
bj_hashlittle2(LP_METHOD_NM_TERM, strlen(LP_METHOD_NM_TERM), &h1, &h2);
terminal_magic_num = h1 + h2;
int i; int i;
char anno[MAX_NAME_LENGTH]; char anno[MAX_NAME_LENGTH];
...@@ -893,9 +897,6 @@ terminal_custom_init( terminal_state * s, ...@@ -893,9 +897,6 @@ terminal_custom_init( terminal_state * s,
* local channels, compute node channels */ * local channels, compute node channels */
void router_custom_setup(router_state * r, tw_lp * lp) void router_custom_setup(router_state * r, tw_lp * lp)
{ {
uint32_t h1 = 0, h2 = 0;
bj_hashlittle2(LP_METHOD_NM_ROUT, strlen(LP_METHOD_NM_ROUT), &h1, &h2);
router_magic_num = h1 + h2;
char anno[MAX_NAME_LENGTH]; char anno[MAX_NAME_LENGTH];
codes_mapping_get_lp_info(lp->gid, lp_group_name, &mapping_grp_id, NULL, codes_mapping_get_lp_info(lp->gid, lp_group_name, &mapping_grp_id, NULL,
......
...@@ -525,6 +525,12 @@ static terminal_message_list* return_tail( ...@@ -525,6 +525,12 @@ static terminal_message_list* return_tail(
} }
static void dragonfly_read_config(const char * anno, dragonfly_param *params){ static void dragonfly_read_config(const char * anno, dragonfly_param *params){
uint32_t h1 = 0, h2 = 0;
bj_hashlittle2(LP_METHOD_NM_TERM, strlen(LP_METHOD_NM_TERM), &h1, &h2);
terminal_magic_num = h1 + h2;
bj_hashlittle2(LP_METHOD_NM_ROUT, strlen(LP_METHOD_NM_ROUT), &h1, &h2);
router_magic_num = h1 + h2;
// shorthand // shorthand
dragonfly_param *p = params; dragonfly_param *p = params;
...@@ -752,9 +758,6 @@ terminal_init( terminal_state * s, ...@@ -752,9 +758,6 @@ terminal_init( terminal_state * s,
s->packet_gen = 0; s->packet_gen = 0;
s->packet_fin = 0; s->packet_fin = 0;
uint32_t h1 = 0, h2 = 0;
bj_hashlittle2(LP_METHOD_NM_TERM, strlen(LP_METHOD_NM_TERM), &h1, &h2);
terminal_magic_num = h1 + h2;
int i; int i;
char anno[MAX_NAME_LENGTH]; char anno[MAX_NAME_LENGTH];
...@@ -830,9 +833,6 @@ terminal_init( terminal_state * s, ...@@ -830,9 +833,6 @@ terminal_init( terminal_state * s,
* local channels, compute node channels */ * local channels, compute node channels */
static void router_setup(router_state * r, tw_lp * lp) static void router_setup(router_state * r, tw_lp * lp)
{ {
uint32_t h1 = 0, h2 = 0;
bj_hashlittle2(LP_METHOD_NM_ROUT, strlen(LP_METHOD_NM_ROUT), &h1, &h2);
router_magic_num = h1 + h2;
char anno[MAX_NAME_LENGTH]; char anno[MAX_NAME_LENGTH];
codes_mapping_get_lp_info(lp->gid, lp_group_name, &mapping_grp_id, NULL, codes_mapping_get_lp_info(lp->gid, lp_group_name, &mapping_grp_id, NULL,
......
...@@ -666,6 +666,13 @@ void post_switch_init(switch_state *s, tw_lp *lp) ...@@ -666,6 +666,13 @@ void post_switch_init(switch_state *s, tw_lp *lp)
static void fattree_read_config(const char * anno, fattree_param *p){ static void fattree_read_config(const char * anno, fattree_param *p){
uint32_t h1 = 0, h2 = 0;
bj_hashlittle2(LP_METHOD_NM, strlen(LP_METHOD_NM), &h1, &h2);
switch_magic_num = h1 + h2;
bj_hashlittle2(LP_METHOD_NM, strlen(LP_METHOD_NM), &h1, &h2);
fattree_terminal_magic_num = h1 + h2;
int i; int i;
p->ft_type = 1; p->ft_type = 1;
...@@ -897,10 +904,6 @@ void ft_terminal_init( ft_terminal_state * s, tw_lp * lp ) ...@@ -897,10 +904,6 @@ void ft_terminal_init( ft_terminal_state * s, tw_lp * lp )
s->packet_gen = 0; s->packet_gen = 0;
s->packet_fin = 0; s->packet_fin = 0;
uint32_t h1 = 0, h2 = 0;
bj_hashlittle2(LP_METHOD_NM, strlen(LP_METHOD_NM), &h1, &h2);
fattree_terminal_magic_num = h1 + h2;
char anno[MAX_NAME_LENGTH]; char anno[MAX_NAME_LENGTH];
if(def_gname_set == 0) { if(def_gname_set == 0) {
...@@ -987,9 +990,6 @@ void ft_terminal_init( ft_terminal_state * s, tw_lp * lp ) ...@@ -987,9 +990,6 @@ void ft_terminal_init( ft_terminal_state * s, tw_lp * lp )
/* sets up the switch */ /* sets up the switch */
void switch_init(switch_state * r, tw_lp * lp) void switch_init(switch_state * r, tw_lp * lp)
{ {
uint32_t h1 = 0, h2 = 0;
bj_hashlittle2(LP_METHOD_NM, strlen(LP_METHOD_NM), &h1, &h2);
switch_magic_num = h1 + h2;
char anno[MAX_NAME_LENGTH]; char anno[MAX_NAME_LENGTH];
int num_terminals = -1; int num_terminals = -1;
...@@ -2660,7 +2660,7 @@ int ft_get_output_port( switch_state * s, tw_bf * bf, fattree_message * msg, ...@@ -2660,7 +2660,7 @@ int ft_get_output_port( switch_state * s, tw_bf * bf, fattree_message * msg,
} }
/* Currently incomplete. */ /* Currently incomplete. */
int get_base_port(switch_state *s, int from_term, int index) { /*int get_base_port(switch_state *s, int from_term, int index) {
int return_port; int return_port;
if(s->switch_level == 2) { if(s->switch_level == 2) {
} else if(from_term || index < (int)s->switch_id) { } else if(from_term || index < (int)s->switch_id) {
...@@ -2670,7 +2670,7 @@ int get_base_port(switch_state *s, int from_term, int index) { ...@@ -2670,7 +2670,7 @@ int get_base_port(switch_state *s, int from_term, int index) {
return_port += ((index - s->start_uneigh) * s->con_per_uneigh); return_port += ((index - s->start_uneigh) * s->con_per_uneigh);
} }
return return_port; return return_port;
} }*/
void ft_terminal_event( ft_terminal_state * s, tw_bf * bf, fattree_message * msg, void ft_terminal_event( ft_terminal_state * s, tw_bf * bf, fattree_message * msg,
tw_lp * lp ) { tw_lp * lp ) {
......
...@@ -413,6 +413,11 @@ static slim_terminal_message_list* return_tail( ...@@ -413,6 +413,11 @@ static slim_terminal_message_list* return_tail(
} }
static void slimfly_read_config(const char * anno, slimfly_param *params){ static void slimfly_read_config(const char * anno, slimfly_param *params){
uint32_t h1 = 0, h2 = 0;
bj_hashlittle2(LP_METHOD_NM, strlen(LP_METHOD_NM), &h1, &h2);
slim_terminal_magic_num = h1 + h2;
bj_hashlittle2(LP_METHOD_NM, strlen(LP_METHOD_NM), &h1, &h2);
slim_router_magic_num = h1 + h2;
// shorthand // shorthand
slimfly_param *p = params; slimfly_param *p = params;
...@@ -749,9 +754,6 @@ static void slimfly_report_stats() ...@@ -749,9 +754,6 @@ static void slimfly_report_stats()
void slim_terminal_init( terminal_state * s, void slim_terminal_init( terminal_state * s,
tw_lp * lp ) tw_lp * lp )
{ {
uint32_t h1 = 0, h2 = 0;
bj_hashlittle2(LP_METHOD_NM, strlen(LP_METHOD_NM), &h1, &h2);
slim_terminal_magic_num = h1 + h2;
int i; int i;
char anno[MAX_NAME_LENGTH]; char anno[MAX_NAME_LENGTH];
...@@ -819,10 +821,6 @@ void slim_terminal_init( terminal_state * s, ...@@ -819,10 +821,6 @@ void slim_terminal_init( terminal_state * s,
* local channels, compute node channels */ * local channels, compute node channels */
void slim_router_setup(router_state * r, tw_lp * lp) void slim_router_setup(router_state * r, tw_lp * lp)
{ {
uint32_t h1 = 0, h2 = 0;
bj_hashlittle2(LP_METHOD_NM, strlen(LP_METHOD_NM), &h1, &h2);
slim_router_magic_num = h1 + h2;
char anno[MAX_NAME_LENGTH]; char anno[MAX_NAME_LENGTH];
codes_mapping_get_lp_info(lp->gid, lp_group_name, &mapping_grp_id, NULL, codes_mapping_get_lp_info(lp->gid, lp_group_name, &mapping_grp_id, NULL,
&mapping_type_id, anno, &mapping_rep_id, &mapping_offset); &mapping_type_id, anno, &mapping_rep_id, &mapping_offset);
......
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