Commit c59e6d4a authored by Robert Ricci's avatar Robert Ricci
Browse files

Experimental PACK_TIGHT compile time option

When set, the goal is to pack vnodes as tightly as possible - that is,
to penalize wasted slots in assignments.

One downside is that this will tend to make really lopsided mappings:
eg. if you have 50 slots per pnode, and 51 vodes, you will end up
mapping 50 to one and 1 to the other.

The other downside is that I have not yet thought about how to balance
this with link weights.
parent 467f38f4
......@@ -1066,6 +1066,11 @@ void remove_node(vvertex vv)
// we prefer to equally fill the minimum number of pnodes
SSUB(SCORE_PNODE * (powf(1+ ((tr->get_current_load()+1) * 1.0)/tr->get_max_load(),2)));
SADD(SCORE_PNODE * (powf(1+ tr->get_current_load() * 1.0/tr->get_max_load(),2)));
// Inverse of LOAD_BALANCE
SSUB(SCORE_PNODE * (powf(((tr->get_max_load() - (tr->get_current_load()+1)) * 1.0)/tr->get_max_load(),0.5)));
SADD(SCORE_PNODE * (powf((tr->get_max_load() - tr->get_current_load()) * 1.0/tr->get_max_load(),0.5)));
if (pnode->total_load == 0) {
// If the pnode is now free, we need to do some cleanup
......@@ -1466,6 +1471,10 @@ int add_node(vvertex vv,pvertex pv, bool deterministic, bool is_fixed, bool skip
SSUB(SCORE_PNODE * (powf(1 + ((tr->get_current_load()-1) * 1.0)/tr->get_max_load(),2)));
SADD(SCORE_PNODE * (powf(1 + ((tr->get_current_load()) * 1.0)/tr->get_max_load(),2)));
SSUB(SCORE_PNODE * (powf(((tr->get_max_load() - (tr->get_current_load()-1)) * 1.0)/tr->get_max_load(),0.5)));
SADD(SCORE_PNODE * (powf(((tr->get_max_load() - tr->get_current_load()) * 1.0)/tr->get_max_load(),0.5)));
// node no longer unassigned
Supports Markdown
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