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

Function LaunchJobRequest

library/cpp/par/par_exec.cpp:122–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120 }
121
122 bool LaunchJobRequest(TJobRequest* jr, TRemoteQueryProcessor* queryProc, IUserContext* userContext, IMRCommandCompleteNotify* mrNotify) {
123 Y_ASSERT(queryProc);
124 Y_ASSERT(!jr->HostId2Computer.empty());
125 int hostIdCount = jr->HostId2Computer.ysize();
126 int localCompId = queryProc->GetCompId();
127
128 THashMap<int, bool> allHostIdSet;
129 bool hasAllHostIds = true;
130 for (int i = 0; i < hostIdCount; ++i) {
131 allHostIdSet[i];
132 hasAllHostIds &= !jr->HostId2Computer[i].empty();
133 }
134
135 if (hasAllHostIds) {
136 // has at least one remote comp for each hostId
137 // try regular execution
138 bool chk = ScheduleJobRequest(jr, queryProc);
139 Y_ABORT_UNLESS(chk);
140
141 TMRCommandExec::Launch(jr, queryProc, localCompId, userContext, mrNotify);
142 } else {
143 // not all hostIds are ready
144 // lets check if we can execute locally
145 if (!userContext->HasHostIds(allHostIdSet)) {
146 // can not execute locally
147 return false;
148 }
149 LaunchLocalJobRequest(jr, localCompId, userContext, mrNotify);
150 }
151 return true;
152 }
153}

Callers 2

LaunchBlockRequestMethod · 0.85
LaunchMethod · 0.85

Calls 6

ScheduleJobRequestFunction · 0.85
LaunchLocalJobRequestFunction · 0.85
GetCompIdMethod · 0.80
emptyMethod · 0.45
ysizeMethod · 0.45
HasHostIdsMethod · 0.45

Tested by

no test coverage detected