nm_core_inline.h
Go to the documentation of this file.
53 return (p_drv->props.capabilities.max_msg_size > max_small) ? max_small : p_drv->props.capabilities.max_msg_size;
79static inline void nm_pw_assign(struct nm_pkt_wrap_s*p_pw, nm_trk_id_t trk_id, struct nm_drv_s*p_drv, nm_gate_t p_gate)
106 nm_core_lock_assert(nm_core_get_singleton()); /* needed by nm_pw_free, check early for easier debug */
168static inline void nm_core_task_enqueue(struct nm_core*p_core, int holding_lock, struct nm_core_task_s*p_core_task)
237static inline void nm_req_chunk_destroy(struct nm_core*p_core, struct nm_req_chunk_s*p_req_chunk)
280 nm_data_chunk_properties_compute(&p_req->data, chunk_offset, chunk_len, &p_req_chunk->chunk_props);
295 nm_data_chunk_properties_compute(&p_req_chunk->p_req->data, p_req_chunk->chunk_offset, p_req_chunk->chunk_len, &p_req_chunk->chunk_props);
300static inline void nm_core_post_req_chunk(nm_core_t p_core, nm_gate_t p_gate, struct nm_req_chunk_s*p_req_chunk)
333 NM_FATAL("trying to post RTR with chunk_offset = %llu; chunk_len = %llu\n", (unsigned long long)chunk_offset, (unsigned long long)chunk_len);
348static inline void nm_core_post_msg(nm_gate_t p_gate, nm_core_tag_t tag, nm_seq_t seq, nm_len_t msg_len)
372static inline struct nm_matching_wildcard_s*nm_matching_wildcard_bytag(struct nm_core*p_core, nm_core_tag_t core_tag)
375 struct nm_matching_wildcard_s*p_wildcard = nm_matching_wildcard_get(&p_core->wildcard_table, session_tag);
379static inline struct nm_matching_gsession_s*nm_matching_gsession_bytag(struct nm_gate_s*p_gate, nm_core_tag_t core_tag)
382 struct nm_matching_gsession_s*p_gsession = nm_matching_gsession_get(&p_gate->gsessions, session_tag);
static nm_session_hash_t nm_core_tag_get_hashcode(nm_core_tag_t core_tag)
Definition nm_core_interface.h:282
static nm_core_tag_t nm_core_tag_build(nm_session_hash_t hashcode, nm_tag_t tag)
Definition nm_core_interface.h:271
void nm_data_chunk_properties_compute(const struct nm_data_s *p_data, nm_len_t chunk_offset, nm_len_t chunk_len, struct nm_data_properties_s *p_props)
compute properties of the given chunk inside the data
#define NM_REQ_FLAG_PACK_SYNCHRONOUS
flag pack as synchronous (i.e.
Definition nm_core_interface.h:203
without even the implied warranty of !MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE See the GNU !General Public License for more details !mpif h
Definition mpif.h:19
static void nm_gate_set_active(struct nm_gate_s *p_gate)
mark gate as having active requests
Definition nm_core_inline.h:154
static struct nm_matching_gsession_s * nm_matching_gsession_bytag(struct nm_gate_s *p_gate, nm_core_tag_t core_tag)
Definition nm_core_inline.h:379
static nm_len_t nm_drv_max_small(const struct nm_drv_s *const p_drv)
get maximum size for small messages for the given driver
Definition nm_core_inline.h:50
static void nm_core_post_rtr(nm_gate_t p_gate, nm_core_tag_t tag, nm_seq_t seq, nm_trk_id_t trk_id, nm_len_t chunk_offset, nm_len_t chunk_len, const void *p_rdv_data, nm_len_t size)
Post a ready-to-receive to accept chunk on given trk_id.
Definition nm_core_inline.h:326
static void nm_pw_ref_dec_free(struct nm_pkt_wrap_s *p_pw, const char *label)
decrement ref_count for pw, supposed to reach 0
Definition nm_core_inline.h:116
static void nm_pw_assign(struct nm_pkt_wrap_s *p_pw, nm_trk_id_t trk_id, struct nm_drv_s *p_drv, nm_gate_t p_gate)
assign packet to given driver, gate, and track
Definition nm_core_inline.h:79
static void nm_core_post_ack(nm_gate_t p_gate, nm_core_tag_t tag, nm_seq_t seq)
Post an ACK.
Definition nm_core_inline.h:341
static int nm_gate_is_in_active_list(struct nm_core *p_core, struct nm_gate_s *p_gate)
Definition nm_core_inline.h:147
static void nm_req_chunk_init(struct nm_req_chunk_s *p_req_chunk, struct nm_req_s *p_req, nm_len_t chunk_offset, nm_len_t chunk_len)
Definition nm_core_inline.h:262
static void nm_core_post_ctrl(nm_gate_t p_gate, nm_header_ctrl_generic_t *p_header, const void *p_payload, nm_len_t payload_size)
Post a generic control header to the given gate.
Definition nm_core_inline.h:309
static int nm_trk_can_send(const struct nm_trk_s *p_trk)
checks whether we can post one more send pw on this trk
Definition nm_core_inline.h:67
static void nm_core_polling_level(struct nm_core *p_core)
dynamically adapt pioman polling frequency level depending on the number of pending requests
Definition nm_core_inline.h:356
static void nm_pw_completed_enqueue(struct nm_core *p_core, struct nm_pkt_wrap_s *p_pw)
enqueue a pw completion
Definition nm_core_inline.h:207
static void nm_req_chunk_update(struct nm_req_chunk_s *p_req_chunk)
update req chunk properties after it has been modified (split, trim, ...)
Definition nm_core_inline.h:284
static void nm_req_chunk_submit(struct nm_core *p_core, struct nm_req_chunk_s *p_req_chunk)
Definition nm_core_inline.h:227
static void nm_req_chunk_destroy(struct nm_core *p_core, struct nm_req_chunk_s *p_req_chunk)
Definition nm_core_inline.h:237
static void nm_pw_ref_dec(struct nm_pkt_wrap_s *p_pw, const char *label)
decrement ref_count for pw; free if ref_count reaches 0
Definition nm_core_inline.h:104
static struct nm_trk_s * nm_trk_get_by_index(nm_gate_t p_gate, int index)
Get a driver given its id.
Definition nm_core_inline.h:41
static struct nm_req_chunk_s * nm_req_chunk_alloc(struct nm_core *p_core)
Definition nm_core_inline.h:255
static void nm_core_task_enqueue(struct nm_core *p_core, int holding_lock, struct nm_core_task_s *p_core_task)
Definition nm_core_inline.h:168
static void nm_core_post_req_chunk(nm_core_t p_core, nm_gate_t p_gate, struct nm_req_chunk_s *p_req_chunk)
Post a req chunk for sending; it will later be scheduled by the strategy.
Definition nm_core_inline.h:300
#define nm_pw_ref_inc(P_PW, LABEL)
increment refcount for pw; make it a macro to be able to capture file/func/line in refcount tracking
Definition nm_core_inline.h:101
static int nm_gate_isactive(struct nm_gate_s *p_gate)
Definition nm_core_inline.h:140
static struct nm_matching_wildcard_s * nm_matching_wildcard_bytag(struct nm_core *p_core, nm_core_tag_t core_tag)
Definition nm_core_inline.h:372
static void nm_core_post_msg(nm_gate_t p_gate, nm_core_tag_t tag, nm_seq_t seq, nm_len_t msg_len)
Definition nm_core_inline.h:348
static int nm_trk_can_recv(const struct nm_trk_s *p_trk)
checks whether we can post one more recv pw on this trk
Definition nm_core_inline.h:57
static void nm_header_global_finalize(struct nm_pkt_wrap_s *p_pw)
Definition nm_core_inline.h:122
static uint16_t nm_header_global_v0len(const struct nm_pkt_wrap_s *p_pw)
Definition nm_core_inline.h:131
static struct nm_trk_s * nm_gate_trk_get(nm_gate_t p_gate, nm_drv_t p_drv)
Get the track per-gate data.
Definition nm_core_inline.h:27
static int nm_refcount_dec(struct nm_refcount_s *p_refcount, const void *p_holder __attribute__((unused)))
decrement refcount for holder; returns refcount (if 0, caller may free ref-counted resource)
Definition nm_core_interface.h:1315
static int nm_refcount_get(struct nm_refcount_s *p_refcount)
Definition nm_core_interface.h:1252
__PUK_SYM_INTERNAL void nm_core_task_flush(struct nm_core *p_core)
assert(p_data->ops.p_traversal !=NULL)
static void nm_header_init_msg(union nm_header_ctrl_generic_s *p_ctrl, nm_core_tag_t tag_id, nm_seq_t seq, nm_len_t msg_len)
Definition nm_headers.h:276
static void nm_header_init_ack(union nm_header_ctrl_generic_s *p_ctrl, nm_core_tag_t tag, nm_seq_t seq)
Definition nm_headers.h:312
#define NM_PROTO_FLAG_ACKREQ
data sent as synchronous send- please send an ack on first chunk
Definition nm_headers.h:54
static void nm_header_init_rtr(union nm_header_ctrl_generic_s *p_ctrl, nm_core_tag_t tag, nm_seq_t seq, nm_trk_id_t trk_id, nm_len_t chunk_offset, nm_len_t chunk_len, nm_len_t payload_size)
Definition nm_headers.h:300
static void nm_core_nolock_assert(struct nm_core *p_core)
assert that current thread doesn't hold the lock
static int nm_core_trylock(struct nm_core *p_core)
try to lock the nm core core return 1 is lock is successfully acquired, 0 otherwise
static void nm_core_lock_assert(struct nm_core *p_core)
assert that current thread holds the lock
nm_len_t size
size of the onsided data (not incuding target-side completion)
Definition nm_onesided_private.h:1
#define NM_PW_GLOBAL_HEADER
pw allocated with a contiguous buffer and a global header has been prepared.
Definition nm_pkt_wrap.h:49
#define NM_PW_BUFFER
pw allocated with NM_MAX_UNEXPECTED contiguous buffer.
Definition nm_pkt_wrap.h:44
void nm_pw_free(struct nm_core *p_core, struct nm_pkt_wrap_s *p_pw)
static struct nm_matching_wildcard_s * nm_matching_wildcard_get(struct nm_matching_wildcard_table_s *t, nm_core_tag_t tag)
Definition nm_tags.h:140
struct nm_core_task_s::@7::@9 completed_pw
struct nm_core_task_s::@7::@12 pack_submission
union nm_core_task_s::@7 content
struct nm_core_task_lfqueue_s pending_tasks
core tasks to execute asynchronously; enqueued from non-locked sections; read from locked sections
Definition nm_core.h:67
struct nm_ctrl_chunk_allocator_s ctrl_chunk_allocator
allocator for control chunks
Definition nm_core.h:70
struct nm_req_chunk_allocator_s req_chunk_allocator
allocator for req_chunk elements
Definition nm_core.h:69
struct nm_matching_wildcard_table_s wildcard_table
matching info for wildcard requests
Definition nm_core.h:76
struct nm_minidriver_properties_s props
driver properties (profile & capabilities)
Definition nm_drv.h:52
struct nm_pkt_wrap_s * p_pw_recv_any
global recv request if driver supports recv_probe_any
Definition nm_drv.h:49
struct nm_ctrl_chunk_list_s ctrl_chunk_list
control chunks posted to the gate
Definition nm_gate.h:137
struct nm_pkt_wrap_list_s pending_large_recv
large messages waiting for Track 1 (or 2) to be free- list of pw
Definition nm_gate.h:125
Definition nm_gate.h:52
struct to store matching info for wildcard requests, one per session
Definition nm_tags.h:126
int max_pkt_recvs
maximum number of concurrent receives; if 0, 1 is assumed
Definition nm_minidriver.h:252
int max_pkt_sends
maximum number of concurrent sends; if 0, 1 is assumed
Definition nm_minidriver.h:251
struct nm_minidriver_capabilities_s capabilities
Definition nm_minidriver.h:268
struct nm_refcount_s refcount
number of references pointing to the header
Definition nm_pkt_wrap.h:170
nm_len_t chunk_offset
offset of the chunk relative to the full data in the req
Definition nm_core_interface.h:474
struct nm_data_properties_s chunk_props
properties of the data chunk
Definition nm_core_interface.h:476
struct nm_req_s * p_req
link to insert the req chunk as a core task
Definition nm_core_interface.h:472
struct nm_req_s::@15::@17 pack
struct nm_req_chunk_s req_chunk
preallocated chunk for the common case (single-chunk)
Definition nm_core_interface.h:525