Repository navigation
In progress
Description
Two defects, both only when at least one PE has no array elements (for example more PEs than elements). Found by reading while reviewing #4342; the first was also observed in runs. Neither is changed by #4342.
1. Abort "Intermingling iterations in MetaBalancer" (src/ck-ldb/MetaBalancer.C, the check near line 76).
lbdb_no_obj_callbackmarks a PE as having no objects. It is cleared only whenlb_in_progressis set (near line 1027), and only CentralLB setslb_in_progress(CentralLB.Cnear line 635); TreeLB never does.- After each step an empty PE therefore registers again (near lines 274 and 1016), PE 0 sends it
TriggerAdaptiveReductiontwo or more times per iteration (near lines 559-562), and it contributes to the statistics reduction more often than the other PEs. - Its k-th contribution then carries a different
ITER_NOfrom the others' k-th contribution, and the check aborts. - Observed: with fewer elements than PEs,
tests/charm++/load_balancing/meta_lb_testaborts with this message onrecharmwith and without MetaLB: every PE switches strategy before the balancing step starts #4342. The cause above is from the code and was not confirmed by a traced run. - Likely fix: TreeLB sets and clears the in-progress flag as CentralLB does.
2. An empty PE can start a balancing step alone.
- A PE without elements starts its step from a
CkSyncBarrierkick (cksyncbarrier.Cnear lines 186-187), not fromMetaLBCallLBOnChares. - If it finishes the step, receives migrated elements and resumes them before its own copy of
MetaLBCallLBOnCharesarrives, that broadcast (MetaBalancer.Cnear line 928, throughcklocation.Cnear lines 1770-1773) puts every element at the barrier again and starts a step on that PE only. ItsawaitingLB[0]and the root'sawaitingLB[1]stay true. - Before MetaLB: every PE switches strategy before the balancing step starts #4342 this sequence hangs. With MetaLB: every PE switches strategy before the balancing step starts #4342's guard in
TreeLB::configure, the next balancer switch aborts with a message. - Not reproduced; from the code.
Scope. MetaLB (+MetaLB) with TreeLB-based balancers. The same code is on classic.
Timing. The asynchronous load-balancing work in progress changes how a step starts and completes on each PE; it may be better to fix these after it lands, or as part of it.
Metadata
Metadata
Assignees
Labels
No labels
Activity
meta_lb_test: run period_selection with a PE that has no objects
lvkale commentedon Dec 1, 2026
A third defect, found by @adityapb in his review of #4356 (from the code; not reproduced). (Written with Claude Code.)
A PE with no objects can miss the trigger loop for good.
HandleAdaptiveNoObjsendsRegisterNoObjCallbackto PE 0 and contributes at once (MetaBalancer.C 998-999).ReceiveMinStats(k)before the registration, the loop at 552-553 skips the PE. It never contributes k+1, and reduction k+1 never completes.-anylbrun ofperiod_selectionwould report it as a pass.lb_iter_no != -1holds after the first reduction (onlyResetAdaptiveresets it), so every registration after a step would add a contribution.Proposed direction: the registration carries the iteration the PE contributed, so that PE 0 can tell whether it has already handled that reduction and, if so, trigger the PE for the next one.
#4356 fixes the first defect here (duplicate registration); the second (an empty PE starting a step alone, through
cksyncbarrier.Candcklocation.C) and this one remain.MetaLB: register a PE with no objects once (#4356)
MetaLB: every PE switches strategy before the balancing step starts (#…