File tree Expand file tree Collapse file tree
scheduler/LocalSearch/KernighanLin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,6 +97,10 @@ class IBspSchedule {
9797 /* *
9898 * @brief Get the staleness of the schedule.
9999 *
100+ * The staleness determines the minimum number of supersteps that must elapse between the
101+ * assignment of a node to a processor and the assignment of one of its dependent neighbors
102+ * to a different processor. For a standard BSP schedule, the staleness is 1.
103+ *
100104 * @return The staleness of the schedule.
101105 */
102106 virtual unsigned GetStaleness () const { return 1 ; }
Original file line number Diff line number Diff line change @@ -20,6 +20,17 @@ limitations under the License.
2020
2121#include < vector>
2222
23+ /* *
24+ * @brief Efficient sparse tracker for accumulating delta values across processors.
25+ *
26+ * FastDeltaTracker is used in local search algorithms (like Kernighan-Lin) to efficiently
27+ * track incremental changes (deltas) to metrics such as communication costs for each processor.
28+ * Instead of iterating over all processors to find or reset changes, it maintains a dense array
29+ * for O(1) lookups and updates, alongside a sparse list (`dirtyProcs_`) of only the modified
30+ * (non-zero) processors. This allows for fast O(1) additions, removals, and O(|dirty_procs|) clearing.
31+ *
32+ * @tparam CommWeightT The numerical type used for the communication weights/deltas.
33+ */
2334template <typename CommWeightT>
2435struct FastDeltaTracker {
2536 std::vector<CommWeightT> denseVals_; // Size: num_procs
Original file line number Diff line number Diff line change @@ -23,6 +23,21 @@ limitations under the License.
2323
2424namespace osp {
2525
26+ /* *
27+ * @class KlImproverScan
28+ * @brief An exhaustive, scan-based approach for finding the best Kernighan-Lin (KL) moves.
29+ *
30+ * This class implements a move-finding strategy that recomputes the gain for all active nodes
31+ * after each move. Unlike priority queue based approaches that try to incrementally update
32+ * affected nodes, `KlImproverScan` exhaustively scans the entire active set (`affinityTable_`)
33+ * during each move selection phase to find the move(s) with the highest gain.
34+ *
35+ * This approach makes sense and is often preferred for more complex communication cost
36+ * functions like BSP and Max BSP. In these models, a single move can trigger cascading cost
37+ * updates for a very large number of nodes (compared to simpler models like total communication
38+ * cost), making incremental priority queue updates highly inefficient due to the sheer volume
39+ * of affected elements.
40+ */
2641template <typename GraphT,
2742 typename CommCostFunctionT,
2843 typename MemoryConstraintT = NoLocalSearchMemoryConstraint,
You can’t perform that action at this time.
0 commit comments