16#ifndef NM_CORE_INLINE_H
17#define NM_CORE_INLINE_H
31 assert(
p_drv != NULL);
46 assert(index < p_gate->n_trks);
68 assert(
p_drv != NULL);
76 assert(trk_id < p_gate->n_trks);
93 assert(p_pw->
p_drv != NULL);
111 (!nm_active_gate_list_cell_isnull(
p_gate)));
142#ifdef PIOMAN_MULTITHREAD
143 rc = nm_core_task_lfqueue_enqueue(&p_core->
pending_tasks, p_core_task);
145 rc = nm_core_task_lfqueue_enqueue_single_writer(&p_core->
pending_tasks, p_core_task);
200 if(r->driver->rdv_accept)
202 (*r->driver->rdv_accept)(r->_status,
p_gate);
218 (*r->driver->try_and_commit)(r->_status,
p_gate);
225 static int inprogress = 0;
253 nm_active_gate_list_cell_setnull(
p_gate);
273 nm_ctrl_chunk_list_cell_init(p_ctrl_chunk);
274 p_ctrl_chunk->
ctrl = *p_header;
294 piom_ltask_completed(&p_pw->ltask);
307 assert(p_req_chunk->
p_req != NULL);
333 nm_req_chunk_list_cell_init(p_req_chunk);
340 nm_req_chunk_list_cell_init(p_req_chunk);
361 const void*p_rdv_data)
399 piom_ltask_poll_level_set(high);
static int nm_atomic_dec(int *v)
decrement int, atomic only when multithread
static nm_session_hash_t nm_core_tag_get_hashcode(nm_core_tag_t core_tag)
#define NM_REQ_FLAG_PACK_SYNCHRONOUS
flag pack as synchronous (i.e.
static nm_core_tag_t nm_core_tag_build(nm_session_hash_t hashcode, nm_tag_t tag)
static int nm_atomic_inc(int *v)
increment int, atomic only when multithread
@ NM_CORE_TASK_PACK_SUBMISSION
process a submitted pack request
@ NM_CORE_TASK_COMPLETED_PW
process a completed pw
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
__PUK_SYM_INTERNAL void nm_core_task_flush(struct nm_core *p_core)
without even the implied warranty of !MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE See the GNU !General Public License for more details !mpif h
static void nm_pw_ref_inc(struct nm_pkt_wrap_s *p_pw)
static void nm_gate_set_active(struct nm_gate_s *p_gate)
mark gate as having active requests
static struct nm_matching_gsession_s * nm_matching_gsession_bytag(struct nm_gate_s *p_gate, nm_core_tag_t core_tag)
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
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
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)
Post a ready-to-receive to accept chunk on given trk_id.
static void nm_core_post_ack(nm_gate_t p_gate, nm_core_tag_t tag, nm_seq_t seq)
Post an ACK.
static void nm_strat_submit_req_chunk(nm_core_t p_core, nm_gate_t p_gate, struct nm_req_chunk_s *p_req_chunk, int front)
static int nm_gate_is_in_active_list(struct nm_core *p_core, struct nm_gate_s *p_gate)
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)
static void nm_core_polling_level(struct nm_core *p_core)
dynamically adapt pioman polling frequency level depending on the number of pending requests
static void nm_pw_completed_enqueue(struct nm_core *p_core, struct nm_pkt_wrap_s *p_pw)
enqueue a pw completion, or process immediately if possible
static void nm_req_chunk_submit(struct nm_core *p_core, struct nm_req_chunk_s *p_req_chunk)
static void nm_strat_gate_schedule(nm_core_t p_core, nm_gate_t p_gate)
apply strategy on the given gate, for the case where strategy doesn't have global scheduling
static void nm_req_chunk_destroy(struct nm_core *p_core, struct nm_req_chunk_s *p_req_chunk)
static void nm_strat_rdv_accept(nm_core_t p_core, nm_gate_t p_gate)
process postponed rdv requests
static struct nm_trk_s * nm_trk_get_by_index(nm_gate_t p_gate, int index)
Get a driver given its id.
static struct nm_req_chunk_s * nm_req_chunk_alloc(struct nm_core *p_core)
static void nm_strat_schedule(nm_core_t p_core, nm_gate_t p_gate)
apply strategy on the given gate (all active gates if p_gate = NULL)
static void nm_strat_pack_ctrl(nm_gate_t p_gate, nm_header_ctrl_generic_t *p_header)
static void nm_pw_ref_dec(struct nm_pkt_wrap_s *p_pw)
static void nm_core_task_enqueue(struct nm_core *p_core, int holding_lock, struct nm_core_task_s *p_core_task)
static int nm_gate_isactive(struct nm_gate_s *p_gate)
static struct nm_matching_wildcard_s * nm_matching_wildcard_bytag(struct nm_core *p_core, nm_core_tag_t core_tag)
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)
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.
nm_tag_t tag
the user-supplied tag
#define NM_ALIGN_FRONTIER
#define nm_profile_inc(COUNTER)
@ NM_GATE_STATUS_CONNECTED
gate actually connected, may be used/polled
static void nm_core_unlock(struct nm_core *p_core)
unlock the nm core lock
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
#define NM_FATAL(format,...)
nm_mpi_count_t count
number of elements to be exchanged
#define NM_MAX_UNEXPECTED
Maximum size of unexpected packets.
#define NM_PW_COMPLETED
send/recv of pw is completed
void nm_pw_free(struct nm_core *p_core, struct nm_pkt_wrap_s *p_pw)
int8_t nm_trk_id_t
ID of a track, assigned in order.
#define NM_LEN_UNDEFINED
length is undefined
#define NM_GATE_NONE
no gate
uint64_t nm_len_t
data length used by nmad
uint32_t nm_seq_t
Sequence number for packets on a given gate/tag.
asynchronous tasks for nmad core.
struct nm_core_task_s::@11::@13 completed_pw
enum nm_core_task_kind_e kind
union nm_core_task_s::@11 content
struct nm_pkt_wrap_s * p_pw
struct nm_core_task_s::@11::@15 pack_submission
struct nm_req_chunk_s * p_req_chunk
Core NewMadeleine structure.
struct nm_core_task_lfqueue_s pending_tasks
core tasks to execute asynchronously; enqueued from non-locked sections; read from locked sections
puk_context_t strategy_context
global context of the strategy
int n_unpacks
number of pending packs & unpacks
struct nm_ctrl_chunk_allocator_s ctrl_chunk_allocator
allocator for control chunks
struct nm_req_chunk_allocator_s req_chunk_allocator
allocator for req_chunk elements
struct nm_matching_wildcard_table_s wildcard_table
matching info for wildcard requests
struct nm_active_gate_list_s active_gates
list of gates with active requests
const struct nm_strategy_iface_s * strategy_iface
interface of the selected strategy
nm_header_ctrl_generic_t ctrl
struct nm_minidriver_properties_s props
driver properties (profile & capabilities)
struct nm_pkt_wrap_s * p_pw_recv_any
global recv request if driver supports recv_any
Connection to another process.
int strat_todo
strategy has work to do
struct puk_receptacle_NewMad_Strategy_s strategy_receptacle
Strategy components elements.
struct nm_core * p_core
NM core object.
struct nm_ctrl_chunk_list_s ctrl_chunk_list
control chunks posted to the gate
struct nm_matching_gsession_table_s gsessions
table of gate/session
struct nm_trk_s * trks
Tracks opened for each driver.
int n_trks
Number of tracks opened on this gate.
struct nm_req_chunk_list_s req_chunk_list
send reqs posted to the gate
nm_gate_status_t status
current status of the gate (connected / not connected)
struct nm_pkt_wrap_list_s pending_large_recv
large messages waiting for Track 1 (or 2) to be free- list of pw
struct to store matching info for wildcard requests, one per session
nm_len_t max_msg_size
maximum message size for the track
struct nm_minidriver_capabilities_s capabilities
struct nm_core_task_s core_task
nm_trk_id_t trk_id
assignated track ID.
int ref_count
number of references pointing to the header
nm_pw_flag_t flags
packet flags.
nm_drv_t p_drv
link to insert the pw as a core task
struct nm_trk_s * p_trk
assignated track, if relevant.
nm_gate_t p_gate
assignated gate, if relevant.
nm_len_t chunk_offset
offset of the chunk relative to the full data in the req
struct nm_core_task_s core_task
nm_proto_t proto_flags
pre-computed proto flags
struct nm_data_properties_s chunk_props
properties of the data chunk
nm_len_t chunk_len
length of the chunk
struct nm_req_s * p_req
link to insert the req chunk as a core task
a generic pack/unpack request
struct nm_req_chunk_s req_chunk
preallocated chunk for the common case (single-chunk)
nm_req_flag_t flags
flags given by user
struct nm_data_s data
data descriptor to send/recv
struct nm_req_s::@18::@20 pack
nm_len_t len
cumulated data length
void(* submit_req_chunk)(puk_context_t p_context, struct nm_req_chunk_s *p_req_chunk, int front)
submit an outgoing req chunk to the strategy; req chunk is enqueued in gate req_chunk_list if this fu...
void(* submit_ctrl_chunk)(puk_context_t p_context, struct nm_ctrl_chunk_s *p_ctrl_chunk)
submit an outgoing ctrl chunk to the strategy; ctrl_chunk is enqueued in gate ctrl_chunk_list if this...
void(* schedule)(puk_context_t p_context)
schedule all events:
struct nm_drv_s * p_drv
driver attached to the track