diff --git a/assign/score.cc b/assign/score.cc index 2c3f4fd5d7710f50cf71062b45f940ccc191b1d8..901f22df934d60a9d0036d0badf88e3716571e55 100644 --- a/assign/score.cc +++ b/assign/score.cc @@ -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))); +#endif +#ifdef PACK_TIGHT + // 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))); #endif 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))); #endif +#ifdef PACK_TIGHT + 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))); +#endif // node no longer unassigned SSUB(SCORE_UNASSIGNED);