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

Method ListDevices

tensorflow/core/distributed_runtime/master.cc:591–620  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

589}
590
591void Master::ListDevices(const ListDevicesRequest* req,
592 ListDevicesResponse* resp, MyClosure done) {
593 SchedClosure([this, req, resp, done]() {
594 if (!req->session_handle().empty()) {
595 auto session = FindMasterSession(req->session_handle());
596 if (session == nullptr) {
597 done(errors::InvalidArgument(
598 "Session ", req->session_handle(),
599 " is not found. Possibly, this master has restarted."));
600 return;
601 }
602 core::ScopedUnref ref(session);
603 Status s = session->ListDevices(resp);
604 done(s);
605 return;
606 }
607 std::vector<std::unique_ptr<Device>> remote_devices;
608 Status s = DeviceFinder::GetRemoteDevices({}, env_, env_->worker_cache,
609 &remote_devices);
610 if (s.ok()) {
611 for (Device* dev : env_->local_devices) {
612 *(resp->add_local_device()) = dev->attributes();
613 }
614 for (auto&& dev : remote_devices) {
615 *(resp->add_remote_device()) = dev->attributes();
616 }
617 }
618 done(s);
619 });
620}
621
622void Master::CleanupWorkers(const ResetRequest& reset) {
623 std::vector<string> worker_names;

Callers 7

DefineWorkerMethod · 0.45
MakeGRPCClusterFunction · 0.45
SessionMgrTestMethod · 0.45
TEST_FFunction · 0.45
DefineWorkerMethod · 0.45
DefineWorkerMethod · 0.45
TEST_FFunction · 0.45

Calls 5

SchedClosureFunction · 0.85
InvalidArgumentFunction · 0.85
session_handleMethod · 0.80
emptyMethod · 0.45
okMethod · 0.45

Tested by 7

DefineWorkerMethod · 0.36
MakeGRPCClusterFunction · 0.36
SessionMgrTestMethod · 0.36
TEST_FFunction · 0.36
DefineWorkerMethod · 0.36
DefineWorkerMethod · 0.36
TEST_FFunction · 0.36