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

Method Run

library/cpp/par/par_wb.cpp:48–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46 Ready.Signal();
47 }
48 void Run(TLocalDataBuffer* writeBuffer, TRemoteQueryProcessor* queryProc,
49 TVector<TVector<char>>* result) {
50 CHROMIUM_TRACE_FUNCTION();
51 Ready.Reset();
52
53 int localCompId = queryProc ? queryProc->GetCompId() : -1;
54 AtomicAdd(ReqCount, 1);
55 for (THashMap<int, TWBCopyCompInfo>::iterator i = RequestHash.begin(); i != RequestHash.end(); ++i) {
56 TWBCopyCompInfo& info = i->second;
57 int compId = i->first;
58 if (compId == localCompId) {
59 for (int j = 0; j < info.Data.ysize(); ++j) {
60 writeBuffer->GetData(info.Data[j], &Result[info.OriginalPlace[j]], TLocalDataBuffer::DO_COPY);
61 }
62 } else {
63 TVector<char> buf;
64 SerializeToMem(&buf, info.Data);
65 AtomicAdd(ReqCount, 1);
66 queryProc->SendQuery(compId, "wb_copy", &buf, this, compId);
67 }
68 }
69 if (AtomicAdd(ReqCount, -1) == 0)
70 Ready.Signal();
71 Ready.Wait();
72
73 result->swap(Result);
74 }
75 };
76
77 void CollectData(const TVector<TDataLocation>& data, TVector<TVector<char>>* res,

Callers 1

CollectDataFunction · 0.45

Calls 12

SerializeToMemFunction · 0.85
GetCompIdMethod · 0.80
SendQueryMethod · 0.80
AtomicAddFunction · 0.50
ResetMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
ysizeMethod · 0.45
GetDataMethod · 0.45
SignalMethod · 0.45
WaitMethod · 0.45
swapMethod · 0.45

Tested by

no test coverage detected