MCPcopy
hub / github.com/dmlc/dgl / send_request

Function send_request

python/dgl/distributed/rpc.py:641–677  ·  view source on GitHub ↗

Send one request to the target server. Serialize the given request object to an :class:`RPCMessage` and send it out. The operation is non-blocking -- it does not guarantee the payloads have reached the target or even have left the sender process. However, all the payloads (i.e.

(target, request)

Source from the content-addressed store, hash-verified

639
640
641def send_request(target, request):
642 """Send one request to the target server.
643
644 Serialize the given request object to an :class:`RPCMessage` and send it
645 out.
646
647 The operation is non-blocking -- it does not guarantee the payloads have
648 reached the target or even have left the sender process. However,
649 all the payloads (i.e., data and arrays) can be safely freed after this
650 function returns.
651
652 Parameters
653 ----------
654 target : int
655 ID of target server.
656 request : Request
657 The request to send.
658
659 Raises
660 ------
661 ConnectionError if there is any problem with the connection.
662 """
663 service_id = request.service_id
664 msg_seq = incr_msg_seq()
665 client_id = get_rank()
666 server_id = target
667 data, tensors = serialize_to_payload(request)
668 msg = RPCMessage(
669 service_id,
670 msg_seq,
671 client_id,
672 server_id,
673 data,
674 tensors,
675 group_id=get_group_id(),
676 )
677 send_rpc_message(msg, server_id)
678
679
680def send_request_to_machine(target, request):

Callers 1

client_barrierFunction · 0.85

Calls 6

incr_msg_seqFunction · 0.85
serialize_to_payloadFunction · 0.85
RPCMessageClass · 0.85
get_group_idFunction · 0.85
send_rpc_messageFunction · 0.85
get_rankFunction · 0.70

Tested by

no test coverage detected