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

Method Start

tensorflow/core/distributed_runtime/rpc/grpc_server_lib.cc:360–385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358}
359
360Status GrpcServer::Start() {
361 mutex_lock l(mu_);
362 switch (state_) {
363 case NEW: {
364 master_thread_.reset(
365 env_->StartThread(ThreadOptions(), "TF_master_service",
366 [this] { master_service_->HandleRPCsLoop(); }));
367 worker_thread_.reset(
368 env_->StartThread(ThreadOptions(), "TF_worker_service",
369 [this] { worker_service_->HandleRPCsLoop(); }));
370 eager_thread_.reset(
371 env_->StartThread(ThreadOptions(), "TF_eager_service",
372 [this] { eager_service_->HandleRPCsLoop(); }));
373 state_ = STARTED;
374 LOG(INFO) << "Started server with target: " << target();
375 return Status::OK();
376 }
377 case STARTED:
378 LOG(INFO) << "Server already started (target: " << target() << ")";
379 return Status::OK();
380 case STOPPED:
381 return errors::FailedPrecondition("Server has stopped.");
382 default:
383 LOG(FATAL);
384 }
385}
386
387Status GrpcServer::AddMasterEagerContextToEagerService(
388 const tensorflow::uint64 context_id, tensorflow::EagerContext* context) {

Callers 3

mainFunction · 0.45
MakeTestClusterMethod · 0.45
mainFunction · 0.45

Calls 5

ThreadOptionsClass · 0.85
FailedPreconditionFunction · 0.85
resetMethod · 0.45
StartThreadMethod · 0.45
HandleRPCsLoopMethod · 0.45

Tested by 2

MakeTestClusterMethod · 0.36
mainFunction · 0.36