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

Method DeleteContextRawData

library/cpp/par/par_context.cpp:360–392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358 };
359
360 void TContextDistributor::DeleteContextRawData(int envId, int hostId, bool keepContextOnMaster) {
361 CHROMIUM_TRACE_FUNCTION();
362 WaitAllDistributionActivity(); // can wait more fine grained, but delay should not be much higher
363
364 Y_ASSERT(EnvId2Info.find(envId) != EnvId2Info.end());
365 TFullCtxInfo& dst = EnvId2Info[envId];
366
367 // free mem on slaves
368 if (QueryProc.Get()) {
369 TVector<char> cmd;
370 {
371 TContextFreeCmd freeCmd;
372 freeCmd.EnvId = envId;
373 SerializeToMem(&cmd, freeCmd);
374 }
375
376 const TVector<int>& compList = dst.HostId2Computer[hostId];
377 TIntrusivePtr<TFreeMemWait> fmw = new TFreeMemWait(compList.ysize());
378 for (int i = 0; i < compList.ysize(); ++i) {
379 int compId = compList[i];
380 TVector<char> tmp = cmd;
381 QueryProc->SendQuery(compId, "ctx_free", &tmp, fmw.Get(), i);
382 }
383 fmw->Wait();
384 }
385
386 // free mem on master
387 TCtxDataPart& part = dst.Data[hostId];
388 TVector<TVector<char>>().swap(part.BinData);
389 if (!keepContextOnMaster) {
390 part.Info = nullptr;
391 }
392 }
393
394 void TContextDistributor::GetVersions(int envId, int* hostIdCount, THashMap<int, int>* envId2version) {
395 CHROMIUM_TRACE_FUNCTION();

Callers 1

Calls 8

SerializeToMemFunction · 0.85
SendQueryMethod · 0.80
findMethod · 0.45
endMethod · 0.45
GetMethod · 0.45
ysizeMethod · 0.45
WaitMethod · 0.45
swapMethod · 0.45

Tested by

no test coverage detected