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.
| 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. |
| 839 | void 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 |
no test coverage detected