Commit 5c67bf1f authored by Robert Ricci's avatar Robert Ricci

Added the TRIVIAL_LINK_BW option, which allows, in the ptop file,

specification of how much bandwidth can be used on the node for
trivial links. Clearly, there will be some limit to loopback
transfers, and this makes assign aware of it.

While I was in there, cleaned up and commented some of the code I was
working on.

Also fixed a bug with the type pre-check and emulated links that are
trivial_ok - we can't add these into the total for a vnode, because
they could end up being satisified with trivial links.
parent e8854475
......@@ -1353,7 +1353,16 @@ void print_solution()
}
cout << endl;
} else if (vlink->link_info.type == tb_link_info::LINK_TRIVIAL) {
cout << " trivial" << endl;
// We'll fake a bunch of output here just to make it consistent with
// other (ie. intraswitch) output
vvertex vv = vlink->src;
tb_vnode *vnode = get(vvertex_pmap,vv);
pvertex pv = vnode->assignment;
tb_pnode *pnode = get(pvertex_pmap,pv);
cout << " trivial " << pnode->name << ":loopback" <<
" (" << pnode->name << "/null,(null)) " <<
pnode->name << ":loopback" << " (" << pnode->name <<
"/null,(null)) " << endl;
} else {
cout << " Mapping Failed" << endl;
}
......
......@@ -85,6 +85,7 @@ static float SCORE_DELAY = 10.0; /* multiplier to distance for delay scoring */
#ifdef PENALIZE_UNUSED_INTERFACES
static float SCORE_UNUSED_INTERFACE = 0.04;
#endif
static float SCORE_TRIVIAL_PENALTY = 0.5; /* Cost of over-using a trivial link */
// The following are used to weight possible link resolutions. Higher
// numbers mean a more likely resolution. Trivial resolutions are always
......
......@@ -165,6 +165,8 @@ PENALIZE_BANDWIDTH Penalize based on the bandwidth of links that, for
example, cross interswitch links, not just the number
of links. Will need to be in place when we do gigabit,
but not well tested yet
TRIVIAL_LINK_BW Allow, in the ptop file, specification of how much
bandwidth can be used on the node for trivial links
Bugfixes
--------
......
......@@ -63,9 +63,11 @@ int parse_ptop(tb_pgraph &PG, tb_sgraph &SG, istream& i)
p->max_load = 0;
p->current_load = 0;
p->pnodes_used = 0;
//#ifdef PENALIZE_UNUSED_INTERFACES
p->total_interfaces = 0;
//#endif
#ifdef TRIVIAL_LINK_BW
p->trivial_bw = 0;
p->trivial_bw_used = 0;
#endif
unsigned int i;
for (i = 2;
......@@ -97,7 +99,7 @@ int parse_ptop(tb_pgraph &PG, tb_sgraph &SG, istream& i)
p->types[type] = iload;
}
}
for (i=i+1;i<parsed_line.size();++i) {
for (i=i+1;(i<parsed_line.size()) && (parsed_line[i].compare("-")) ;++i) {
crope feature,cost;
if (split_two(parsed_line[i],':',feature,cost,"0") != 0) {
ptop_error("Bad node line, no cost for feature: " <<
......@@ -110,6 +112,26 @@ int parse_ptop(tb_pgraph &PG, tb_sgraph &SG, istream& i)
}
p->features[feature] = gcost;
}
/*
* Parse any other node optios or flags
*/
for (i=i+1; i < parsed_line.size(); ++i) {
crope flag,value;
split_two(parsed_line[i],':',flag,value,"(null)");
#ifdef TRIVIAL_LINK_BW
if (flag == crope("trivial_bw")) {
int trivial_bw;
if (sscanf(value.c_str(),"%i",&trivial_bw) != 1) {
ptop_error("Bad bandwidth given for trivial_bw: " << value
<< endl);
trivial_bw = 0;
}
p->trivial_bw = trivial_bw;
} else {
ptop_error("Bad flag given: " << flag << ".");
}
#endif
}
pname2vertex[name] = pv;
}
} else if (command.compare("link") == 0) {
......@@ -221,10 +243,10 @@ int parse_ptop(tb_pgraph &PG, tb_sgraph &SG, istream& i)
else if (ISSWITCH(dstnode) &&
! ISSWITCH(srcnode)) {
srcnode->switches.insert(dstv);
srcnode->total_interfaces++;
#ifdef PER_VNODE_TT
srcnode->total_bandwidth += ibw;
#endif
srcnode->total_interfaces++;
}
}
} else {
......
......@@ -210,8 +210,10 @@ int parse_top(tb_vgraph &VG, istream& i)
tb_vnode *vnode1 = get(vvertex_pmap,node1);
tb_vnode *vnode2 = get(vvertex_pmap,node2);
if (l->emulated) {
vnode1->total_bandwidth += l->delay_info.bandwidth;
vnode2->total_bandwidth += l->delay_info.bandwidth;
if (!l->allow_trivial) {
vnode1->total_bandwidth += l->delay_info.bandwidth;
vnode2->total_bandwidth += l->delay_info.bandwidth;
}
} else {
vnode1->num_links++;
vnode2->num_links++;
......
......@@ -123,6 +123,11 @@ public:
#ifdef SMART_UNMAP
tb_vnode_set assigned_nodes;
#endif
#ifdef TRIVIAL_LINK_BW
int trivial_bw;
int trivial_bw_used;
#endif
};
class tb_switch {
......
This diff is collapsed.
......@@ -16,9 +16,7 @@ typedef struct {
int desires;
int vclass;
int delay;
#ifdef FIX_PLINK_ENDPOINTS
int incorrect_endpoints;
#endif
} violated_info;
extern double score;
......
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