Skip to content

Commit

Permalink
[XrdCms] reformat weighed random load balancing calculation
Browse files Browse the repository at this point in the history
reformatted selCap and weighed array to improve legibility

Co-authored-by: Guilherme Amadio <amadio@cern.ch>
  • Loading branch information
Jo-stfc and amadio authored Apr 23, 2024
1 parent fe34a6c commit 8b9d26c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/XrdCms/XrdCmsCluster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1811,12 +1811,9 @@ XrdCmsNode *XrdCmsCluster::SelbyLoad(SMask_t mask, XrdCmsSelector &selR)
else{
if (weighed){
//add 1 to the inverse load, this is to allow some selection in case reported loads hit 100
weighed[i] = selCap + static_cast<int>(101 - np->myLoad +
std::pow(101 - np->myLoad,
scalingFactor)/2);
selCap += static_cast<int>(101 - np->myLoad +
std::pow(101 - np->myLoad,
scalingFactor)/2);
int nload = 101 - np->myLoad;
selCap += static_cast<int>(nload + std::pow(nload, scalingFactor)/2);
weighed[i] = selCap;
}
else{if (selR.needSpace)
{if (abs(sp->myMass - np->myMass) <= Config.P_fuzz)
Expand Down

0 comments on commit 8b9d26c

Please sign in to comment.