If autoregroup is on, the submitters are also appended to the root's list of submitter ads. -Then the code walks the tree, bottom up, and subtracts the sum of the child quota from each -interior node on the way up. Essentially, this is syntatic sugar to all the admin to specify -total values of quota for intermediate nodes instead of marginal values. +After (weighted) slot quotas are assigned to all the group entries, surplus sharing is computed for all groups in the hierarchy configured to accept surplus. Following surplus sharing, when slot weighting is not enabled, any fractional quota allocations are consolidated and distributed in a round robin fashion. + +{subsubsection: Surplus Sharing} +The basic principle for surplus sharing is: surplus quota is distributed among sibling groups in proportion to assigned quota. For example, if group A has twice the quota of group B, group A will be awarded twice the surplus. Some additional points: +*: available surplus consists of any surplus shared from the level above in the hierarchy, plus any surplus coming up from sibling sub-trees +*: any groups with surplus sharing not enabled do not participate in surplus distribution +*: if a group does not need all of its potential surplus, any it does not use will be shared among remaining participating groups +*: the parent group of siblings participates in sharing, effectively as another sibling +*: any surplus unused after sharing among siblings (and parent) is sent up the hierarchy to be shared at the level above + +{subsubsection: Fractional Quota Consolidation} +When slot weighting is not enabled, fractional quota values for groups are consolidated and distributed in round robin fashion to ensure that all quotas are integer values. +*: available remainder for consolidation consists of remainder coming from upper level in hierarchy, combined with any remainder coming up from sibling subtrees +*: remainders are not accepted by groups not accepting surplus +*: siblings having received remainder least recently are favored in round robin - siblings are ordered by time of last receipt of a remainder +*: remainder unused at a level is sent up to parent The following steps are iterated GROUP_QUOTA_MAX_ALLOCATION_ROUNDS time, default of 3: