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

Method Close

tensorflow/core/distributed_runtime/master_session.cc:2314–2338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2312}
2313
2314Status MasterSession::Close() {
2315 {
2316 mutex_lock l(mu_);
2317 closed_ = true; // All subsequent calls to Run() or Extend() will fail.
2318 }
2319 cancellation_manager_.StartCancel();
2320 std::vector<ReffedClientGraph*> to_unref;
2321 {
2322 mutex_lock l(mu_);
2323 while (num_running_ != 0) {
2324 num_running_is_zero_.wait(l);
2325 }
2326 ClearRunsTable(&to_unref, &run_graphs_);
2327 ClearRunsTable(&to_unref, &partial_run_graphs_);
2328 ClearRunsTable(&to_unref, &callables_);
2329 }
2330 for (ReffedClientGraph* rcg : to_unref) rcg->Unref();
2331 if (should_delete_worker_sessions_) {
2332 Status s = DeleteWorkerSessions();
2333 if (!s.ok()) {
2334 LOG(WARNING) << s;
2335 }
2336 }
2337 return Status::OK();
2338}
2339
2340void MasterSession::GarbageCollect() {
2341 {

Callers 7

TEST_FFunction · 0.45
DumpEventProtoToFileMethod · 0.45
TEST_FFunction · 0.45
CreateSessionMethod · 0.45
CloseSessionMethod · 0.45
ResetMethod · 0.45
BM_HelperFunction · 0.45

Calls 4

StartCancelMethod · 0.45
waitMethod · 0.45
UnrefMethod · 0.45
okMethod · 0.45

Tested by 3

TEST_FFunction · 0.36
TEST_FFunction · 0.36
BM_HelperFunction · 0.36