MCPcopy Create free account
hub / github.com/catboost/catboost / CreatePow2Merge

Function CreatePow2Merge

library/cpp/netliba/v6/ib_collective.cpp:146–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144 }
145
146 static void CreatePow2Merge(TMergePlan* plan, int colSize) {
147 // finally everybody has full range [0;ColSize)
148 // construct plan recursively, on each iteration split some range
149 plan->Init(colSize);
150
151 THashMap<int, TVector<TSRTransfer>> allTransfers;
152 int maxIter = SplitRange(&allTransfers, 0, 0, colSize);
153
154 for (int iter = 0; iter < maxIter; ++iter) {
155 const TVector<TSRTransfer>& arr = allTransfers[maxIter - iter - 1]; // reverse order
156 for (int i = 0; i < arr.ysize(); ++i) {
157 const TSRTransfer& sr = arr[i];
158 plan->Transfer(iter, sr.SrcRank, sr.DstRank, 0, sr.RangeBeg, sr.RangeFin);
159 }
160 }
161 }
162
163 struct TCoverInterval {
164 int Beg, Fin; // [Beg;Fin)

Callers 1

AllToAllFunction · 0.70

Calls 4

SplitRangeFunction · 0.70
InitMethod · 0.45
ysizeMethod · 0.45
TransferMethod · 0.45

Tested by

no test coverage detected