Commit f0dd0465 authored by Robert Ricci's avatar Robert Ricci

Fix a bug that was causing problem when multiplexed nodes were being

combined with non-multiplexed nodes.

Also clear up the sense of the 'is_fixed' parameter to add_node() -
it was being handled correctly, but was confusing because it was non-
intuitive.
parent ddfb2e76
......@@ -325,7 +325,7 @@ void anneal(bool scoring_selftest, double scale_neighborhood,
cout << "Can not have fixed nodes be in a vclass!.\n";
exit(EXIT_UNRETRYABLE);
}
if (add_node(vv,pv,false,false) == 1) {
if (add_node(vv,pv,false,true) == 1) {
cout << "Fixed node: Could not map " << vn->name <<
" to " << pn->name << endl;
exit(EXIT_UNRETRYABLE);
......@@ -372,7 +372,7 @@ void anneal(bool scoring_selftest, double scale_neighborhood,
<< "fixed in place" << endl;
continue;
}
if (add_node(vv,pv,false,true) == 1) {
if (add_node(vv,pv,false,false) == 1) {
cout << "Warning: Hinted node: Could not map " << vn->name <<
" to " << pn->name << endl;
continue;
......@@ -713,7 +713,7 @@ void anneal(bool scoring_selftest, double scale_neighborhood,
// gotten otherwise
double oldscore = get_score();
double tempscore;
if (!add_node(vv,newpos,false,true)) {
if (!add_node(vv,newpos,false,false)) {
tempscore = get_score();
remove_node(vv);
}
......@@ -726,7 +726,7 @@ void anneal(bool scoring_selftest, double scale_neighborhood,
abort();
}
}
if (add_node(vv,newpos,false,true) != 0) {
if (add_node(vv,newpos,false,false) != 0) {
unassigned_nodes.push(vvertex_int_pair(vv,std::random()));
continue;
}
......@@ -848,7 +848,7 @@ void anneal(bool scoring_selftest, double scale_neighborhood,
RDEBUG(cout << "removing: rejected change" << endl;)
remove_node(vv);
if (oldassigned) {
add_node(vv,oldpos,false,true);
add_node(vv,oldpos,false,false);
}
}
......@@ -1072,7 +1072,7 @@ NOTQUITEDONE:
if (vnode->vclass != NULL) {
vnode->type = abstypes[*vvertex_it];
}
assert(!add_node(*vvertex_it,absassignment[*vvertex_it],true,true));
assert(!add_node(*vvertex_it,absassignment[*vvertex_it],true,false));
}
}
}
......
......@@ -496,7 +496,6 @@ void remove_node(vvertex vv)
SSUB(SCORE_PNODE * (powf(1+ ((pnode->current_load+1) * 1.0)/pnode->max_load,2)));
SADD(SCORE_PNODE * (powf(1+ pnode->current_load * 1.0/pnode->max_load,2)));
#endif
pnode->remove_current_type();
if (pnode->total_load == 0) {
// If the pnode is now free, we need to do some cleanup
SDEBUG(cerr << " releasing pnode" << endl);
......@@ -1542,7 +1541,7 @@ UNSCORE_TRIVIAL:
}
double fd_score(tb_vnode *vnode,tb_pnode *pnode,int &fd_violated,
bool include_violations)
bool ignore_violations)
{
double fd_score=0;
fd_violated=0;
......@@ -1570,7 +1569,7 @@ double fd_score(tb_vnode *vnode,tb_pnode *pnode,int &fd_violated,
SDEBUG(cerr << " unmatched" << endl);
value = (*desire_it).second;
fd_score += SCORE_DESIRE*value;
if ((value >= FD_VIOLATION_WEIGHT) && include_violations) {
if ((value >= FD_VIOLATION_WEIGHT) && (!ignore_violations)) {
fd_violated++;
}
} else {
......@@ -1581,7 +1580,7 @@ double fd_score(tb_vnode *vnode,tb_pnode *pnode,int &fd_violated,
value = (*desire_it).second + (*feature_it).second;
SDEBUG(cerr << " additive - total " << value << endl);
fd_score += SCORE_DESIRE*value;
if ((value >= FD_VIOLATION_WEIGHT) && include_violations) {
if ((value >= FD_VIOLATION_WEIGHT) && (!ignore_violations)) {
fd_violated++;
}
}
......@@ -1615,7 +1614,7 @@ double fd_score(tb_vnode *vnode,tb_pnode *pnode,int &fd_violated,
if (global_fd_set[feature_name] > 1) {
SDEBUG(cerr << " but more than one" << endl);
fd_score+=SCORE_FEATURE*value;
if ((value >= FD_VIOLATION_WEIGHT) && include_violations) {
if ((value >= FD_VIOLATION_WEIGHT) && (!ignore_violations)) {
fd_violated++;
}
}
......@@ -1626,7 +1625,7 @@ double fd_score(tb_vnode *vnode,tb_pnode *pnode,int &fd_violated,
if (global_fd_set[feature_name] == 1) {
SDEBUG(cerr << " but only one" << endl);
fd_score+=SCORE_FEATURE*value;
if ((value >= FD_VIOLATION_WEIGHT) && include_violations) {
if ((value >= FD_VIOLATION_WEIGHT) && (!ignore_violations)) {
fd_violated++;
}
}
......@@ -1642,7 +1641,7 @@ double fd_score(tb_vnode *vnode,tb_pnode *pnode,int &fd_violated,
// Unused feature. Add weight
SDEBUG(cerr << " unused" << endl);
fd_score+=SCORE_FEATURE*value;
if ((value >= FD_VIOLATION_WEIGHT) && include_violations) {
if ((value >= FD_VIOLATION_WEIGHT) && (!ignore_violations)) {
fd_violated++;
}
}
......
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