| 1809 | } |
| 1810 | |
| 1811 | Status MasterSession::PartialRunSetup(const PartialRunSetupRequest* req, |
| 1812 | PartialRunSetupResponse* resp) { |
| 1813 | std::vector<string> inputs, outputs, targets; |
| 1814 | for (const auto& feed : req->feed()) { |
| 1815 | inputs.push_back(feed); |
| 1816 | } |
| 1817 | for (const auto& fetch : req->fetch()) { |
| 1818 | outputs.push_back(fetch); |
| 1819 | } |
| 1820 | for (const auto& target : req->target()) { |
| 1821 | targets.push_back(target); |
| 1822 | } |
| 1823 | |
| 1824 | string handle = std::to_string(partial_run_handle_counter_.fetch_add(1)); |
| 1825 | |
| 1826 | ReffedClientGraph* rcg = nullptr; |
| 1827 | |
| 1828 | // Prepare. |
| 1829 | BuildGraphOptions opts; |
| 1830 | BuildBuildGraphOptions(*req, &opts); |
| 1831 | int64 count = 0; |
| 1832 | TF_RETURN_IF_ERROR(StartStep(opts, true, &rcg, &count)); |
| 1833 | |
| 1834 | rcg->Ref(); |
| 1835 | RunState* run_state = |
| 1836 | new RunState(inputs, outputs, rcg, |
| 1837 | NewStepId(BuildGraphOptions::kNoCollectiveGraphKey), count); |
| 1838 | { |
| 1839 | mutex_lock l(mu_); |
| 1840 | partial_runs_.emplace( |
| 1841 | std::make_pair(handle, std::unique_ptr<RunState>(run_state))); |
| 1842 | } |
| 1843 | |
| 1844 | TF_RETURN_IF_ERROR(BuildAndRegisterPartitions(rcg)); |
| 1845 | |
| 1846 | resp->set_partial_run_handle(handle); |
| 1847 | return Status::OK(); |
| 1848 | } |
| 1849 | |
| 1850 | Status MasterSession::Run(CallOptions* opts, const RunStepRequestWrapper& req, |
| 1851 | MutableRunStepResponseWrapper* resp) { |
nothing calls this directly
no test coverage detected