MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / PostRunCleanup

Method PostRunCleanup

tensorflow/core/distributed_runtime/master_session.cc:2113–2154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2111}
2112
2113Status MasterSession::PostRunCleanup(MasterSession::ReffedClientGraph* rcg,
2114 uint64 step_id,
2115 const RunOptions& run_options,
2116 PerStepState* pss,
2117 const std::unique_ptr<ProfileHandler>& ph,
2118 const Status& run_status,
2119 RunMetadata* out_run_metadata) {
2120 Status s = run_status;
2121 if (s.ok()) {
2122 pss->end_micros = Env::Default()->NowMicros();
2123 if (rcg->collective_graph_key() !=
2124 BuildGraphOptions::kNoCollectiveGraphKey) {
2125 env_->collective_executor_mgr->RetireStepId(rcg->collective_graph_key(),
2126 step_id);
2127 }
2128 // Schedule post-processing and cleanup to be done asynchronously.
2129 rcg->ProcessStats(step_id, pss, ph.get(), run_options, out_run_metadata);
2130 } else if (errors::IsCancelled(s)) {
2131 mutex_lock l(mu_);
2132 if (closed_) {
2133 if (garbage_collected_) {
2134 s = errors::Cancelled(
2135 "Step was cancelled because the session was garbage collected due "
2136 "to inactivity.");
2137 } else {
2138 s = errors::Cancelled(
2139 "Step was cancelled by an explicit call to `Session::Close()`.");
2140 }
2141 }
2142 }
2143 Ref();
2144 rcg->Ref();
2145 rcg->CleanupPartitionsAsync(step_id, [this, rcg](const Status& s) {
2146 if (!s.ok()) {
2147 LOG(ERROR) << "Cleanup partition error: " << s;
2148 }
2149 rcg->Unref();
2150 MarkRunCompletion();
2151 Unref();
2152 });
2153 return s;
2154}
2155
2156Status MasterSession::DoRunWithLocalExecution(
2157 CallOptions* opts, const RunStepRequestWrapper& req,

Callers

nothing calls this directly

Calls 11

DefaultFunction · 0.85
CancelledFunction · 0.85
collective_graph_keyMethod · 0.80
ProcessStatsMethod · 0.80
okMethod · 0.45
NowMicrosMethod · 0.45
RetireStepIdMethod · 0.45
getMethod · 0.45
RefMethod · 0.45
UnrefMethod · 0.45

Tested by

no test coverage detected