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

Function EnqueueTensorCollective

tensorflow/contrib/mpi_collectives/mpi_ops.cc:839–852  ·  view source on GitHub ↗

This function (called from the callback set up in MPIAll*Op::ComputeAsync) only adds the op's record into the local op queue (to track the op's progress), and sends a message to the coordinator indicating that this rank is ready to begin. The MPI background thread will handle the MPI message.

Source from the content-addressed store, hash-verified

837// progress), and sends a message to the coordinator indicating that this rank
838// is ready to begin. The MPI background thread will handle the MPI message.
839void EnqueueTensorCollective(CollectiveOpRecord record,
840 MPIRequest::RequestType rtype) {
841 const Tensor* input_tensor = record.in_t;
842 MPIRequest message;
843 message.set_request_rank(record.rank);
844 message.set_tensor_name(record.name);
845 message.set_tensor_type(record.dtype);
846 message.set_request_type(rtype);
847 input_tensor->shape().AsProto(message.mutable_tensor_shape());
848
849 mutex_lock guard(mpi_global.mu);
850 mpi_global.tensor_table.emplace(record.name, record);
851 mpi_global.message_queue.push(message);
852}
853
854} // namespace
855

Callers 2

ComputeAsyncMethod · 0.70
ComputeAsyncMethod · 0.70

Calls 4

AsProtoMethod · 0.45
shapeMethod · 0.45
emplaceMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected