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

Method RecvAsync

tensorflow/core/distributed_runtime/base_rendezvous_mgr.cc:448–490  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

446}
447
448void BaseRemoteRendezvous::RecvAsync(const ParsedKey& parsed,
449 const Rendezvous::Args& recv_args,
450 DoneCallback done) {
451 VLOG(1) << "RemoteRendezvous Recv " << this << " " << parsed.FullKey();
452 Status s = ValidateDevices(parsed, false /*!is_src*/);
453 if (s.ok() && !is_initialized()) {
454 s.Update(errors::Internal(
455 "RecvAsync called when uninitialized (key:", parsed.FullKey(), ")."));
456 }
457 if (!s.ok()) {
458 done(s, Args(), recv_args, Tensor(), false);
459 return;
460 }
461
462 // Are src and dst in the same worker?
463 if (IsSameWorker(parsed.src, parsed.dst)) {
464 // Recv the tensor from local_.
465 local_->RecvAsync(
466 parsed, recv_args,
467 [this, parsed, done](
468 const Status& status, const Rendezvous::Args& send_args,
469 const Rendezvous::Args& recv_args, const Tensor& in, bool is_dead) {
470 VLOG(2) << "RemoteRendezvous Finished Recv " << this << " "
471 << parsed.FullKey();
472 Tensor* out = new Tensor;
473 StatusCallback final_callback = [done, send_args, recv_args, out,
474 is_dead](const Status& s) {
475 done(s, send_args, recv_args, *out, is_dead);
476 delete out;
477 };
478
479 if (status.ok()) {
480 SameWorkerRecvDone(parsed, send_args, recv_args, in, out,
481 std::move(final_callback));
482 } else {
483 final_callback(status);
484 }
485 });
486 return;
487 } else {
488 RecvFromRemoteAsync(parsed, recv_args, std::move(done));
489 }
490}
491
492void BaseRemoteRendezvous::FlowControlRecvAsync(const StringPiece& tag,
493 const ParsedKey& parsed,

Callers 5

FlowControlRecvAsyncMethod · 0.45
FuseRecvLocalSyncMethod · 0.45

Calls 6

InternalFunction · 0.85
FullKeyMethod · 0.80
ArgsClass · 0.50
TensorClass · 0.50
okMethod · 0.45
UpdateMethod · 0.45

Tested by

no test coverage detected