This is the nmad SendRecv interface, the main interface to send and receive packets. More...
Files | |
| file | nm_sendrecv_interface.h |
| enum | nm_sr_event_t { NM_SR_EVENT_NONE = 0 , NM_SR_EVENT_RECV_UNEXPECTED , NM_SR_EVENT_RECV_COMPLETED , NM_SR_EVENT_SEND_COMPLETED , NM_SR_EVENT_RECV_DATA , NM_SR_EVENT_RECV_CANCELLED , NM_SR_EVENT_FINALIZED } |
| events for nm_sr_monitor() More... | |
| typedef struct nm_sr_request_s | nm_sr_request_t |
| a sendrecv request object. | |
| typedef void(* | nm_sr_event_notifier_t) (nm_sr_event_t event, const nm_sr_event_info_t *event_info, void *ref) |
| notification function for sendrecv events. | |
| int | nm_sr_request_monitor (nm_session_t p_session, nm_sr_request_t *p_request, nm_sr_event_t mask, nm_sr_event_notifier_t notifier) |
| Set a notification function called upon request completion. | |
| int | nm_sr_request_set_completion_queue (nm_session_t p_session, nm_sr_request_t *p_request) |
| Ask to enqueue the request in the completion queue upon completion. | |
| int | nm_sr_request_unset_completion_queue (nm_session_t p_session, nm_sr_request_t *p_request) |
| Ask to not enqueue the request in the completion queue upon completion. | |
| static int | nm_sr_request_isnull (nm_sr_request_t *p_request) |
| tests whether a request is NULL | |
| static int | nm_sr_request_set_ref (nm_sr_request_t *p_request, void *ref) |
| Add a user reference to a request. | |
| static void * | nm_sr_request_get_ref (nm_sr_request_t *p_request) |
| Retrieve the 'ref' from a sendrecv request. | |
| static nm_tag_t | nm_sr_request_get_tag (nm_sr_request_t *p_request) |
| Retrieve the tag from a sendrecv request. | |
| static int | nm_sr_request_get_size (nm_sr_request_t *request, nm_len_t *size) |
| Returns the actual received or sent size of the message with the specified request. | |
| static int | nm_sr_request_get_expected_size (nm_sr_request_t *request, nm_len_t *size) |
| Returns the expected size (to be received or to be sent) of the message with the specified request. | |
| static nm_gate_t | nm_sr_request_get_gate (nm_sr_request_t *p_request) |
| static nm_session_t | nm_sr_request_get_session (nm_sr_request_t *p_request) |
| Returns the session this request belongs to. | |
| int | nm_sr_request_wait (nm_sr_request_t *p_request) |
| Wait for request completion (or cancelation) | |
| static void | nm_sr_request_wait_all (nm_sr_request_t **p_requests, int n) |
| wait for completion of an array of requests | |
| static int | nm_sr_request_test (nm_sr_request_t *p_request, nm_status_t status) |
| Tests whether the given status bits are set in request. | |
| static int | nm_sr_request_get_error (nm_sr_request_t *p_request) |
| Get the error status of the request. | |
| int | nm_sr_flush (struct nm_session_s *p_session) |
| Flush all pending requests (force submission to the core) and all pending events. | |
| static void | nm_sr_send_init (nm_session_t p_session, nm_sr_request_t *p_request) |
| Init a send request. | |
| static void | nm_sr_send_pack_contiguous (nm_session_t p_session, nm_sr_request_t *p_request, const void *, nm_len_t len) |
| Pack contiguous data into the given request. | |
| static void | nm_sr_send_pack_iov (nm_session_t p_session, nm_sr_request_t *p_request, const struct iovec *iov, int num_entries) |
| Pack data described through iovec into the given request. | |
| static void | nm_sr_send_pack_data (nm_session_t p_session, nm_sr_request_t *p_request, const struct nm_data_s *p_data) |
| Pack data described through an iterator into the given request. | |
| static int | nm_sr_send_isend (nm_session_t p_session, nm_sr_request_t *p_request, nm_gate_t p_gate, nm_tag_t tag) |
| send a built request to given gate & tag | |
| static int | nm_sr_send_issend (nm_session_t p_session, nm_sr_request_t *p_request, nm_gate_t p_gate, nm_tag_t tag) |
| send a built request in synchronous mode | |
| static int | nm_sr_send_rsend (nm_session_t p_session, nm_sr_request_t *p_request, nm_gate_t p_gate, nm_tag_t tag) |
| send a built request in ready mode | |
| static int | nm_sr_send_dest (nm_session_t p_session, nm_sr_request_t *p_request, nm_gate_t p_gate, nm_tag_t tag) |
| set destination to a request, but do not send it immediately | |
| static int | nm_sr_send_header (nm_session_t p_session, nm_sr_request_t *p_request, nm_len_t hlen) |
| static int | nm_sr_send_submit (nm_session_t p_session, nm_sr_request_t *p_request) |
| submit the request once it is built | |
| static int | nm_sr_send_submit_chunks (nm_session_t p_session, nm_sr_request_t *p_request, int n, const struct nm_chunk_s *p_chunks) |
| submit partial chunks of a request. | |
| static void | nm_sr_send_set_priority (nm_session_t p_session, nm_sr_request_t *p_request, nm_prio_t priority) |
| attach the given priority to the request. | |
Detailed Description
This is the nmad SendRecv interface, the main interface to send and receive packets.
Typedef Documentation
◆ nm_sr_event_notifier_t
| typedef void(* nm_sr_event_notifier_t) (nm_sr_event_t event, const nm_sr_event_info_t *event_info, void *ref) |
notification function for sendrecv events.
Received ref comes from monitor->ref in case of session monitor, and request->ref in case of request monitor
Definition at line 79 of file nm_sendrecv_interface.h.
◆ nm_sr_request_t
| typedef struct nm_sr_request_s nm_sr_request_t |
a sendrecv request object.
Supposedly opaque for applications.
Definition at line 58 of file nm_sendrecv_interface.h.
Enumeration Type Documentation
◆ nm_sr_event_t
| enum nm_sr_event_t |
events for nm_sr_monitor()
Definition at line 39 of file nm_sendrecv_interface.h.
Function Documentation
◆ nm_sr_flush()
|
extern |
Flush all pending requests (force submission to the core) and all pending events.
- Note
- does not guarantee that packets are actually sent, only that lists with deferred work are empty
◆ nm_sr_request_get_error()
|
inlinestatic |
Get the error status of the request.
◆ nm_sr_request_get_expected_size()
|
inlinestatic |
Returns the expected size (to be received or to be sent) of the message with the specified request.
◆ nm_sr_request_get_gate()
|
inlinestatic |
Referenced by nm_rpc_get_source().
◆ nm_sr_request_get_ref()
|
inlinestatic |
Retrieve the 'ref' from a sendrecv request.
◆ nm_sr_request_get_session()
|
inlinestatic |
Returns the session this request belongs to.
◆ nm_sr_request_get_size()
|
inlinestatic |
Returns the actual received or sent size of the message with the specified request.
◆ nm_sr_request_get_tag()
|
inlinestatic |
Retrieve the tag from a sendrecv request.
Referenced by nm_rpc_get_tag().
◆ nm_sr_request_isnull()
|
inlinestatic |
tests whether a request is NULL
◆ nm_sr_request_monitor()
|
extern |
Set a notification function called upon request completion.
- Examples
- nm_bench_req_monitor.c.
Referenced by nm_coll_tree_set_notifier().
◆ nm_sr_request_set_completion_queue()
|
extern |
Ask to enqueue the request in the completion queue upon completion.
◆ nm_sr_request_set_ref()
|
inlinestatic |
Add a user reference to a request.
- Examples
- nm_bench_req_monitor.c.
Referenced by nm_coll_tree_set_notifier(), nm_sr_irecv_iov_with_ref(), nm_sr_irecv_with_ref(), nm_sr_isend_iov_with_ref(), and nm_sr_isend_with_ref().
◆ nm_sr_request_test()
|
inlinestatic |
Tests whether the given status bits are set in request.
◆ nm_sr_request_unset_completion_queue()
|
extern |
Ask to not enqueue the request in the completion queue upon completion.
Remove it from the completion queue if it was already enqueued.
◆ nm_sr_request_wait()
|
extern |
Wait for request completion (or cancelation)
Referenced by nm_sr_rwait(), and nm_sr_swait().
◆ nm_sr_request_wait_all()
|
inlinestatic |
wait for completion of an array of requests
Referenced by nm_rpc_req_wait_all().
◆ nm_sr_send_dest()
|
inlinestatic |
set destination to a request, but do not send it immediately
◆ nm_sr_send_header()
|
inlinestatic |
◆ nm_sr_send_init()
|
inlinestatic |
Init a send request.
Referenced by nm_coll_tree_issend(), nm_sr_isend(), nm_sr_isend_data(), nm_sr_isend_iov(), nm_sr_isend_iov_with_ref(), nm_sr_isend_with_ref(), nm_sr_issend(), and nm_sr_rsend().
◆ nm_sr_send_isend()
|
inlinestatic |
send a built request to given gate & tag
Referenced by nm_sr_isend(), nm_sr_isend_data(), nm_sr_isend_iov(), nm_sr_isend_iov_with_ref(), and nm_sr_isend_with_ref().
◆ nm_sr_send_issend()
|
inlinestatic |
send a built request in synchronous mode
Referenced by nm_coll_tree_issend(), and nm_sr_issend().
◆ nm_sr_send_pack_contiguous()
|
inlinestatic |
Pack contiguous data into the given request.
Referenced by nm_sr_isend(), nm_sr_isend_with_ref(), nm_sr_issend(), and nm_sr_rsend().
◆ nm_sr_send_pack_data()
|
inlinestatic |
Pack data described through an iterator into the given request.
Referenced by nm_coll_tree_issend(), and nm_sr_isend_data().
◆ nm_sr_send_pack_iov()
|
inlinestatic |
Pack data described through iovec into the given request.
Referenced by nm_sr_isend_iov(), and nm_sr_isend_iov_with_ref().
◆ nm_sr_send_rsend()
|
inlinestatic |
send a built request in ready mode
Referenced by nm_sr_rsend().
◆ nm_sr_send_set_priority()
|
inlinestatic |
attach the given priority to the request.
- Note
- only strat_prio takes priorities into account
◆ nm_sr_send_submit()
|
inlinestatic |
submit the request once it is built
◆ nm_sr_send_submit_chunks()
|
inlinestatic |
submit partial chunks of a request.
- Warning
- no consistency check is done; it is the user responsibility to ensure chunks eventually cover the full request and are not overlapping.