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

Method MakeHostIdMapping

library/cpp/par/par_master.cpp:241–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239 }
240
241 TVector<int> TMaster::MakeHostIdMapping(int groupCount) {
242 int hostCount = GetSlaveCount();
243 if (QueryProc.Get() == nullptr)
244 hostCount = groupCount;
245 Y_ABORT_UNLESS(groupCount <= hostCount, "enough hosts to represent all groups");
246 TVector<int> res;
247 res.resize(hostCount);
248 for (int i = 0; i < hostCount; ++i)
249 res[i] = i % groupCount;
250 Shuffle(res.begin(), res.end());
251 return res;
252 }
253
254 int TMaster::GetSlaveCount() {
255 return ContextMaster->GetSlaveCount();

Callers 1

TMasterContextMethod · 0.45

Calls 5

ShuffleFunction · 0.50
GetMethod · 0.45
resizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected