Commit 45cd61c5 authored by Neil McGlohon's avatar Neil McGlohon
Browse files

Adding Verification methods to DFP

parent 7068b1f5
......@@ -55,8 +55,8 @@ PARAMS
inter-group-connections="../src/network-workloads/conf/dragonfly-plus/dfp-test-inter";
# routing protocol to be used
# routing="minimal";
routing="prog-adaptive";
routing="non-minimal-leaf";
# route scoring protocol to be used - options are 'alpha' or 'beta'
route_scoring_metric="beta";
route_scoring_metric="alpha";
}
......@@ -34,7 +34,7 @@ static char lp_io_dir[256] = {'\0'};
static lp_io_handle io_handle;
static unsigned int lp_io_use_suffix = 0;
static int do_lp_io = 0;
static int num_msgs = 20;
static int num_msgs = 10;
static tw_stime sampling_interval = 800000;
static tw_stime sampling_end_time = 1600000;
......
......@@ -31,7 +31,7 @@
#include <cortex/topology.h>
#endif
#define DUMP_CONNECTIONS 0
#define DUMP_CONNECTIONS 1
#define CREDIT_SIZE 8
#define DFLY_HASH_TABLE_SIZE 4999
#define SHOW_ADAPTIVE_STATS 1
......@@ -816,6 +816,16 @@ static void dragonfly_read_config(const char *anno, dragonfly_plus_param *params
}
}
if (DUMP_CONNECTIONS)
{
if (!myRank) {
for(int i=0; i < connManagerList.size(); i++)
{
connManagerList[i].print_connections();
}
}
}
if (!myRank) {
printf("\n Total nodes %d routers %d groups %d routers per group %d radix %d\n",
p->num_cn * p->num_router_leaf * p->num_groups, p->total_routers, p->num_groups, p->num_routers, p->radix);
......@@ -1717,6 +1727,11 @@ static void packet_arrive(terminal_state *s, tw_bf *bf, terminal_plus_message *m
/* WE do not allow self messages through dragonfly */
assert(lp->gid != msg->src_terminal_id);
// Verify that the router that send the packet to this terminal is the router assigned to this terminal
int dest_router_id = dragonfly_plus_get_assigned_router_id(s->terminal_id, s->params);
int received_from_rel_id = codes_mapping_get_lp_relative_id(msg->intm_lp_id,0,0);
assert(dest_router_id == received_from_rel_id);
uint64_t num_chunks = msg->packet_size / s->params->chunk_size;
if (msg->packet_size < s->params->chunk_size)
num_chunks++;
......@@ -2624,6 +2639,7 @@ static Connection do_dfp_routing(router_state *s,
choose_minimal = true;
else {
if (in_intermediate_group) {
msg->path_type = NON_MINIMAL;
if (s->dfp_router_type == SPINE) { //INTERMEDIATE SPINE
if (routing == NON_MINIMAL_SPINE) {
//from here we follow minimal
......@@ -2655,7 +2671,6 @@ static Connection do_dfp_routing(router_state *s,
theConn = poss_min_next_stops[rand_sel];
}
else {
msg->path_type = NON_MINIMAL;
assert(poss_non_min_next_stops.size() > 0);
int rand_sel = tw_rand_integer(lp->rng, 0, poss_non_min_next_stops.size()-1);
theConn = poss_non_min_next_stops[rand_sel];
......@@ -2705,11 +2720,62 @@ static void router_packet_receive_rc(router_state *s, tw_bf *bf, terminal_plus_m
}
}
static void router_verify_valid_receipt(router_state *s, tw_bf *bf, terminal_plus_message *msg, tw_lp *lp)
{
tw_lpid last_sender_lpid = msg->intm_lp_id;
int rel_id, src_term_rel_id;
bool has_valid_connection = false;
if (msg->last_hop == TERMINAL)
{
tw_lpid src_term_lpgid = msg->src_terminal_id;
src_term_rel_id = codes_mapping_get_lp_relative_id(src_term_lpgid,0,0);
has_valid_connection = s->connMan->is_connected_to_by_type(src_term_rel_id, CONN_TERMINAL);
}
else if (msg->last_hop == LOCAL)
{
// try {
// rel_id = codes_mapping_get_lp_relative_id(last_sender_lpid,0,0);
// }
// catch (...) {
// tw_error(TW_LOC, "\nRouter Receipt Verify: Codes Mapping Get LP Rel ID Failure - Local");
// }
rel_id = codes_mapping_get_lp_relative_id(last_sender_lpid,0,0);
int rel_loc_id = rel_id % s->params->num_routers;
has_valid_connection = s->connMan->is_connected_to_by_type(rel_loc_id, CONN_LOCAL);
}
else if (msg->last_hop == GLOBAL)
{
// try {
// rel_id = codes_mapping_get_lp_relative_id(last_sender_lpid,0,0);
// }
// catch (...) {
// tw_error(TW_LOC, "\nRouter Receipt Verify: Codes Mapping Get LP Rel ID Failure - Global");
// }
rel_id = codes_mapping_get_lp_relative_id(last_sender_lpid,0,0);
has_valid_connection = s->connMan->is_connected_to_by_type(rel_id, CONN_GLOBAL);
}
else
{
tw_error(TW_LOC, "\nDFP Router Verify Valid Receipt: Last Hop invalidly defined");
}
if (!has_valid_connection){
if (msg->last_hop == TERMINAL)
printf("ERROR: Router ID %d has no connection to Terminal %d but received a message from it!",s->router_id, src_term_rel_id);
else
printf("ERROR: Router ID %d has no connection to Router %d but received a message from it!",s->router_id, rel_id);
}
assert(has_valid_connection);
}
/* MM: This will need changes for the port selection and routing part. The
* progressive adaptive routing would need modification as well. */
/* Packet arrives at the router and a credit is sent back to the sending terminal/router */
static void router_packet_receive(router_state *s, tw_bf *bf, terminal_plus_message *msg, tw_lp *lp)
{
router_verify_valid_receipt(s, bf, msg, lp);
router_ecount++;
tw_stime ts;
......
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