Commit d83c4ff2 authored by Jonathan Jenkins's avatar Jonathan Jenkins

*_find_local_device functions now annotation-aware

parent 351a5de3
......@@ -31,7 +31,10 @@ struct model_net_method
const tw_lptype* (*mn_get_lp_type)();
int (*mn_get_msg_sz)();
void (*mn_report_stats)();
tw_lpid (*model_net_method_find_local_device)(tw_lp *sender);
tw_lpid (*model_net_method_find_local_device)(
const char * annotation,
int ignore_annotations,
tw_lp * sender);
void (*mn_collective_call)(char* category, int message_size, int remote_event_size, const void* remote_event, tw_lp* sender);
void (*mn_collective_call_rc)(int message_size, tw_lp* sender);
};
......
......@@ -173,7 +173,11 @@ void model_net_event(
*
* returns the LP id of the network card attached to the calling LP
*/
tw_lpid model_net_find_local_device(int net_id, tw_lp *sender);
tw_lpid model_net_find_local_device(
int net_id,
const char * annotation,
int ignore_annotations,
tw_lp * sender);
int model_net_get_msg_sz(int net_id);
......
......@@ -1799,15 +1799,18 @@ static const tw_lptype* dragonfly_get_router_lp_type(void)
return(&dragonfly_lps[1]);
}
static tw_lpid dragonfly_find_local_device(tw_lp *sender)
static tw_lpid dragonfly_find_local_device(
const char * annotation,
int ignore_annotations,
tw_lp * sender)
{
int mapping_grp_id, mapping_rep_id, mapping_type_id, mapping_offset;
tw_lpid dest_id;
codes_mapping_get_lp_info(sender->gid, lp_group_name, &mapping_grp_id,
NULL, &mapping_type_id, NULL, &mapping_rep_id, &mapping_offset);
codes_mapping_get_lp_id(lp_group_name, LP_CONFIG_NM, NULL, 1,
mapping_rep_id, mapping_offset, &dest_id);
codes_mapping_get_lp_id(lp_group_name, LP_CONFIG_NM, annotation,
ignore_annotations, mapping_rep_id, mapping_offset, &dest_id);
return(dest_id);
}
......
......@@ -115,7 +115,10 @@ static void loggp_packet_event_rc(tw_lp *sender);
static void loggp_report_stats();
static tw_lpid loggp_find_local_device(tw_lp *sender);
static tw_lpid loggp_find_local_device(
const char * annotation,
int ignore_annotations,
tw_lp * sender);
static const struct param_table_entry* find_params(
uint64_t msg_size,
......@@ -695,7 +698,10 @@ static const struct param_table_entry* find_params(
return(&params->table[i]);
}
static tw_lpid loggp_find_local_device(tw_lp *sender)
static tw_lpid loggp_find_local_device(
const char * annotation,
int ignore_annotations,
tw_lp * sender)
{
char lp_group_name[MAX_NAME_LENGTH];
int mapping_grp_id, mapping_rep_id, mapping_type_id, mapping_offset;
......@@ -704,8 +710,8 @@ static tw_lpid loggp_find_local_device(tw_lp *sender)
//TODO: be annotation-aware
codes_mapping_get_lp_info(sender->gid, lp_group_name, &mapping_grp_id,
NULL, &mapping_type_id, NULL, &mapping_rep_id, &mapping_offset);
codes_mapping_get_lp_id(lp_group_name, LP_CONFIG_NM, NULL, 1,
mapping_rep_id, mapping_offset, &dest_id);
codes_mapping_get_lp_id(lp_group_name, LP_CONFIG_NM, annotation,
ignore_annotations, mapping_rep_id, mapping_offset, &dest_id);
return(dest_id);
}
......
......@@ -235,7 +235,7 @@ static void model_net_event_impl_base(
return;
}
tw_lpid mn_lp = model_net_find_local_device(net_id, sender);
tw_lpid mn_lp = model_net_find_local_device(net_id, NULL, 1, sender);
tw_stime poffset = codes_local_latency(sender);
if (in_sequence){
tw_stime tmp = mn_msg_offset;
......@@ -399,9 +399,14 @@ void model_net_report_stats(int net_id)
return;
}
tw_lpid model_net_find_local_device(int net_id, tw_lp *sender)
tw_lpid model_net_find_local_device(
int net_id,
const char * annotation,
int ignore_annotations,
tw_lp * sender)
{
return(method_array[net_id]->model_net_method_find_local_device(sender));
return(method_array[net_id]->model_net_method_find_local_device(annotation,
ignore_annotations, sender));
}
/*
......
......@@ -111,7 +111,10 @@ static void simplenet_packet_event_rc(tw_lp *sender);
static void sn_report_stats();
static tw_lpid sn_find_local_device(tw_lp *sender);
static tw_lpid sn_find_local_device(
const char * annotation,
int ignore_annotations,
tw_lp * sender);
/* data structure for model-net statistics */
struct model_net_method simplenet_method =
......@@ -618,7 +621,10 @@ static void simplenet_packet_event_rc(tw_lp *sender)
return;
}
static tw_lpid sn_find_local_device(tw_lp *sender)
static tw_lpid sn_find_local_device(
const char * annotation,
int ignore_annotations,
tw_lp * sender)
{
char lp_group_name[MAX_NAME_LENGTH];
int mapping_rep_id, mapping_offset, dummy;
......@@ -627,8 +633,8 @@ static tw_lpid sn_find_local_device(tw_lp *sender)
// TODO: don't ignore annotations
codes_mapping_get_lp_info(sender->gid, lp_group_name, &dummy, NULL,
&dummy, NULL, &mapping_rep_id, &mapping_offset);
codes_mapping_get_lp_id(lp_group_name, LP_CONFIG_NM, NULL, 1,
mapping_rep_id, mapping_offset, &dest_id);
codes_mapping_get_lp_id(lp_group_name, LP_CONFIG_NM, annotation,
ignore_annotations, mapping_rep_id, mapping_offset, &dest_id);
return(dest_id);
}
......
......@@ -141,7 +141,10 @@ static void simplewan_packet_event_rc(tw_lp *sender);
static void sw_report_stats();
static tw_lpid sw_find_local_device(tw_lp *sender);
static tw_lpid sw_find_local_device(
const char * annotation,
int ignore_annotations,
tw_lp *sender);
/* data structure for model-net statistics */
struct model_net_method simplewan_method =
......@@ -910,7 +913,10 @@ static void simplewan_packet_event_rc(tw_lp *sender)
return;
}
static tw_lpid sw_find_local_device(tw_lp *sender)
static tw_lpid sw_find_local_device(
const char * annotation,
int ignore_annotations,
tw_lp *sender)
{
char lp_group_name[MAX_NAME_LENGTH];
int mapping_rep_id, mapping_offset, dummy;
......@@ -918,7 +924,8 @@ static tw_lpid sw_find_local_device(tw_lp *sender)
// TODO: don't ignore annotation
codes_mapping_get_lp_info(sender->gid, lp_group_name, &dummy, NULL, &dummy, NULL, &mapping_rep_id, &mapping_offset);
codes_mapping_get_lp_id(lp_group_name, LP_CONFIG_NM, NULL, 1, mapping_rep_id, mapping_offset, &dest_id);
codes_mapping_get_lp_id(lp_group_name, LP_CONFIG_NM, annotation,
ignore_annotations, mapping_rep_id, mapping_offset, &dest_id);
return(dest_id);
}
......
......@@ -1306,15 +1306,18 @@ static const tw_lptype* torus_get_lp_type(void)
return(&torus_lp);
}
static tw_lpid torus_find_local_device(tw_lp *sender)
static tw_lpid torus_find_local_device(
const char * annotation,
int ignore_annotations,
tw_lp *sender)
{
tw_lpid dest_id;
//TODO: be annotation-aware
codes_mapping_get_lp_info(sender->gid, grp_name, &mapping_grp_id, NULL,
&mapping_type_id, NULL, &mapping_rep_id, &mapping_offset);
codes_mapping_get_lp_id(grp_name, LP_CONFIG_NM, NULL, 1, mapping_rep_id,
mapping_offset, &dest_id);
codes_mapping_get_lp_id(grp_name, LP_CONFIG_NM, annotation,
ignore_annotations, mapping_rep_id, mapping_offset, &dest_id);
return(dest_id);
}
......
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