Commit 4c25a593 authored by Robert Ricci's avatar Robert Ricci

Two changes:

First, don't select a plink for an emulated link that would cause us
to go over bandwidth.

Second, make FIX_PLINK_ENDPOINTS the default, and add a #define that
makes it the default (instead of having to specify it on each plink
line.)
parent 6a449d22
......@@ -44,6 +44,9 @@ CXXFLAGS += -DFIND_PNODE_SEARCH -DNO_REVERT
# This should be enabled, for better mapping, but has to be disabled
# for now because it breaks vclasses
#CXXFLAGS += -DPER_VNODE_TT -DSMART_UNMAP
# Make sure that all emulated links that are assigned to a plink have the same
# endpoints
CXXFLAGS += -DFIX_PLINK_ENDPOINTS -DFIX_PLINKS_DEFAULT
# If you're looking to turn on or off USE_OPTIMAL, its now a cmdline
# option. Use OP={0,1} on the command line at run time... :)
......
......@@ -131,7 +131,12 @@ int parse_ptop(tb_pgraph &PG, tb_sgraph &SG, istream& i)
#endif
#ifdef FIX_PLINK_ENDPOINTS
bool fixends = false;
bool fixends;
#ifdef FIX_PLINKS_DEFAULT
fixends = true;
#else
fixends = false;
#endif
if (parsed_line.size() == 9) {
if (parsed_line[8].compare("fixends") == 0) {
fixends = true;
......
......@@ -897,12 +897,19 @@ bool find_link_to_switch(pvertex pv,pvertex switch_pv,tb_vlink *vlink,
double distance = vlink->delay_info.distance(physical_delay);
int users;
// For sticking emulated links in emulated links we only care
// about the distance.
// For sticking emulated links in emulated links we care about the
// distance, and whether or not we've gone over bandwidth
users = plink->nonemulated;
if (! vlink->emulated) {
users += plink->emulated;
} else {
if (vlink->delay_info.bandwidth >
(plink->delay_info.bandwidth - plink->bw_used)) {
// Silly hack to make sure that this link doesn't get chosen
users = best_users + 1;
}
}
if (distance == -1) {
// -1 == infinity
distance = DBL_MAX;
......
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