From 7b30c11b2c05a8bcd58ccefea175c11b3417d6ca Mon Sep 17 00:00:00 2001 From: Neil McGlohon Date: Mon, 21 May 2018 12:23:01 -0400 Subject: [PATCH] Dragonfly Plus Model: Implemented Adaptive Threshold functionality back in --- src/networks/model-net/dragonfly-plus.C | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/networks/model-net/dragonfly-plus.C b/src/networks/model-net/dragonfly-plus.C index 159b73e..1627ea5 100644 --- a/src/networks/model-net/dragonfly-plus.C +++ b/src/networks/model-net/dragonfly-plus.C @@ -2867,15 +2867,23 @@ static Connection do_dfp_prog_adaptive_routing(router_state *s, tw_bf *bf, termi else { if (msg->path_type == MINIMAL) { //we need to evaluate whether to stay on the minimal path or deviate if (scoring_preference == LOWER) { - if (min_score <= intm_score) { + if (min_score <= adaptive_threshold) { + // printf("CHOOSE MIN: Min Score=%d\tNonmin Score=%d (Adaptive Threshold =%d)\n",min_score, intm_score,adaptive_threshold); + route_to_fdest = true; + } + else if (min_score <= intm_score) { + // printf("CHOOSE MIN: Min Score=%d\tNonmin Score=%d\n",min_score, intm_score); route_to_fdest = true; } else { //Changing to a nonminimal path! + // printf("CHOOSE NONMIN: Min Score=%d\tNonmin Score=%d\n",min_score, intm_score); msg->path_type = NON_MINIMAL; } } else { //HIGHER is better + if (adaptive_threshold > 0) + tw_error(TW_LOC, "Adaptive threshold not compatible with HIGHER score preference yet\n"); //TODO fix this if (min_score >= intm_score) { route_to_fdest = true; } -- 2.22.0