NewMadeleine

Documentation

nmad core interface

This is the interface of the NewMad core. More...

Collaboration diagram for nmad core interface:

Modules

 synchronization
 nm_cond_* functions are used to manage synchronization with & without pioman.
 

Data Structures

struct  nm_core_internal_s
 exposed here for inlining; do not use this value, use the accessor nm_core_get_singleton() More...
 
struct  nm_core_tag_s
 An internal tag. More...
 
struct  nm_core_event_s
 An event, generated by the NewMad core. More...
 
struct  nm_core_event_matching_s
 matching info for global monitors More...
 
struct  nm_monitor_s
 generic monitor, used for requests and for global events (with matching) More...
 
struct  nm_core_monitor_s
 global monitor for status transitions More...
 
struct  nm_chunk_s
 
struct  nm_matching_container_s
 containers for matching info, used for caching More...
 
struct  nm_core_task_s
 asynchronous tasks for nmad core. More...
 
struct  nm_req_chunk_s
 a chunk of request More...
 
struct  nm_req_s
 a generic pack/unpack request More...
 
struct  nm_spinlock_s
 
struct  nm_abi_config_s
 config options that impact nmad ABI (content of structures exposed in API or used in inline code) More...
 

Macros

#define NM_STATUS_NONE   ((nm_status_t)0x00000000)
 empty request More...
 
#define NM_STATUS_PACK_INIT   ((nm_status_t)0x00000001)
 request initialized, not sent yet More...
 
#define NM_STATUS_UNPACK_INIT   ((nm_status_t)0x00000002)
 request initialized, not sent yet More...
 
#define NM_STATUS_PACK_COMPLETED   ((nm_status_t)0x00000004)
 sending operation has completed More...
 
#define NM_STATUS_UNPACK_COMPLETED   ((nm_status_t)0x00000008)
 unpack operation has completed More...
 
#define NM_STATUS_UNEXPECTED   ((nm_status_t)0x00000010)
 data or rdv has arrived, with no matching unpack More...
 
#define NM_STATUS_UNPACK_CANCELLED   ((nm_status_t)0x00000020)
 unpack operation has been cancelled More...
 
#define NM_STATUS_PACK_POSTED   ((nm_status_t)0x00000040)
 sending operation is in progress More...
 
#define NM_STATUS_UNPACK_POSTED   ((nm_status_t)0x00000080)
 unpack operation is in progress More...
 
#define NM_STATUS_ACK_RECEIVED   ((nm_status_t)0x00000100)
 ack received for the given pack More...
 
#define NM_STATUS_UNPACK_DATA0   ((nm_status_t)0x00000200)
 first byte of data arrived, not unpacked yet- event triggered only if unpack is posted without data spec More...
 
#define NM_STATUS_UNPACK_DATA_SIZE   ((nm_status_t)0x00000400)
 size of data is known (last chunk of data arrived), not unpacked yet- event triggered only if unpack is posted without data spec More...
 
#define NM_STATUS_FINALIZED   ((nm_status_t)0x00000800)
 request is finalized, may be freed More...
 
#define NM_STATUS_ERROR   ((nm_status_t)0x00001000)
 request is in error; see error state in request More...
 
#define NM_STATUS_PACK_MSG_SIZE   ((nm_status_t)0x00002000)
 msg size already sent; used only if flag pack_partitioned is set More...
 
#define NM_STATUS_UNPACK_PREFETCHED   ((nm_status_t)0x00004000)
 flag unpack request as prefetched More...
 
#define NM_STATUS_MASK_FULL   ((nm_status_t)-1)
 mask to catch all bits of status More...
 
#define NM_REQ_FLAG_NONE   ((nm_req_flag_t)0x00000000)
 no flag set More...
 
#define NM_REQ_FLAG_PACK_SYNCHRONOUS   ((nm_req_flag_t)0x00001000)
 flag pack as synchronous (i.e. More...
 
#define NM_REQ_FLAG_PACK   ((nm_req_flag_t)0x00002000)
 request is a pack More...
 
#define NM_REQ_FLAG_UNPACK   ((nm_req_flag_t)0x00004000)
 request is an unpack More...
 
#define NM_REQ_FLAG_UNPACK_DATA_INFO   ((nm_req_flag_t)0x00008000)
 flag unpack request as data information present More...
 
#define NM_REQ_FLAG_UNPACK_MATCHING_INFO   ((nm_req_flag_t)0x00010000)
 flag unpack request as matching information present More...
 
#define NM_REQ_FLAG_UNPACK_PREFETCHING   ((nm_req_flag_t)0x00020000)
 flag unpack request needs prefetching More...
 
#define NM_REQ_FLAG_MATCHING_WILDCARD   ((nm_req_flag_t)0x00100000)
 request submited in wildcard queue More...
 
#define NM_REQ_FLAG_MATCHING_GATE   ((nm_req_flag_t)0x00200000)
 request matching performed by gate More...
 
#define NM_REQ_FLAG_MATCHING_TAG   ((nm_req_flag_t)0x00400000)
 request matching performed by tag More...
 
#define NM_REQ_FLAG_MATCHING_FULL   ((nm_req_flag_t)0x00800000)
 request matching by gate + tag More...
 
#define NM_REQ_FLAG_FINALIZE_LATER   ((nm_req_flag_t)0x01000000)
 statuses NM_STATUS_UNPACK_COMPLETED and NM_STATUS_FINALIZED will be set separately More...
 
#define NM_REQ_FLAG_UNPACK_PARTITIONED   ((nm_req_flag_t)0x02000000)
 unpack request is partitioned; each chunk whill be notified separately More...
 
#define NM_REQ_FLAG_PACK_PARTITIONED   ((nm_req_flag_t)0x04000000)
 pack request is partitioned; send a separate msg header before data chunks More...
 
#define NM_REQ_CHUNK_FLAG_NONE   ((nm_req_chunk_flag_t)0x00000000)
 no flag set More...
 
#define NM_REQ_CHUNK_FLAG_SHORT   ((nm_req_chunk_flag_t)0x00020000)
 flag req_chunk as short More...
 
#define NM_REQ_CHUNK_FLAG_BUF_SEND   ((nm_req_chunk_flag_t)0x00040000)
 use buf_send to send this request More...
 
#define NM_REQ_CHUNK_FLAG_USE_COPY   ((nm_req_chunk_flag_t)0x00080000)
 flatten data as contiguous block before send More...
 
#define NM_REQ_CHUNK_FLAG_DATA_ITERATOR   ((nm_req_chunk_flag_t)0x00100000)
 use iterator-based data description in pw More...
 
#define NM_CORE_TAG_HASH_FULL   ((nm_session_hash_t)0xFFFFFFFF)
 mask for all sessions More...
 
#define NM_CORE_TAG_MASK_FULL   ((nm_core_tag_t){ .tag = NM_TAG_MASK_FULL, .hashcode = NM_CORE_TAG_HASH_FULL })
 
#define NM_CORE_TAG_NONE   ((nm_core_tag_t){ .tag = 0, .hashcode = 0x0 })
 
#define NM_EVENT_MATCHING_ANY   ((struct nm_core_event_matching_s){ .p_gate = NM_ANY_GATE, .tag = NM_CORE_TAG_NONE, .tag_mask = NM_CORE_TAG_NONE })
 matches any event More...
 
#define NM_MONITOR_NULL   ((struct nm_monitor_s){ .p_notifier = NULL, .event_mask = 0, .ref = NULL })
 
#define NM_CORE_MONITOR_NULL   ((struct nm_core_monitor_s){ .monitor = NM_MONITOR_NULL, .matching = NM_EVENT_MATCHING_ANY })
 
#define NM_MATCHING_CONTAINER_NULL   ((struct nm_matching_container_s) { NULL })
 

Typedefs

typedef struct nm_corenm_core_t
 
typedef struct nm_drv_snm_drv_t
 a nmad driver; opaque type for the user More...
 
typedef enum nm_thread_level_e nm_thread_level_t
 
typedef uint32_t nm_status_t
 status bits of pack/unpack requests More...
 
typedef nm_status_t nm_cond_status_t
 status with synchronization (wait/signal) More...
 
typedef uint32_t nm_req_flag_t
 pack/unpack flags More...
 
typedef uint32_t nm_req_chunk_flag_t
 flags for req_chunk More...
 
typedef uint32_t nm_session_hash_t
 a session hashcode in tags, used to multiplex sessions More...
 
typedef struct nm_core_tag_s nm_core_tag_t
 
typedef void(* nm_core_event_notifier_t) (const struct nm_core_event_s *const event, void *ref)
 an event notifier, fired upon status transition More...
 
typedef enum nm_core_task_kind_e nm_core_task_kind_t
 
typedef void(* nm_injector_pull_data_t) (struct nm_req_s *p_req, const struct nm_data_s *p_data, nm_len_t chunk_offset, nm_len_t chunk_len, void *p_ref)
 user-supplied function called to pull data to posted request through nmad core p_req is the user request that matched this chunk p_data is the memory buffer where to copy the chunk (may be different from p_req->data in case we are actually peeking. More...
 
typedef struct nm_spinlock_s nm_spinlock_t
 

Enumerations

enum  nm_thread_level_e { NM_THREAD_SINGLE = 0 , NM_THREAD_FUNNELED = 1 , NM_THREAD_SERIALIZED = 2 , NM_THREAD_MULTIPLE = 3 }
 
enum  nm_core_task_kind_e {
  NM_CORE_TASK_NONE = 0 , NM_CORE_TASK_UNPACK_NEXT = 1 , NM_CORE_TASK_COMPLETED_PW = 2 , NM_CORE_TASK_COMPLETED_PREFETCH = 3 ,
  NM_CORE_TASK_PACK_SUBMISSION = 4 , NM_CORE_TASK_RTR_SEND = 5 , NM_CORE_TASK_HANDLER = 6
}
 

Functions

puk_component_t nm_core_component_load (const char *entity, const char *name)
 
int nm_core_init (nm_core_t *pp_core)
 
int nm_core_set_strategy (nm_core_t p_core, puk_component_t strategy)
 
int nm_core_exit (nm_core_t p_core)
 
void nm_core_schedopt_disable (nm_core_t p_core)
 disable schedopt for raw driver use More...
 
 __attribute__ ((pure)) static inline nm_core_t nm_core_get_singleton(void)
 
void nm_core_set_hints (nm_core_t p_core, int size, int rank)
 
 PUK_VECT_TYPE (nm_drv, nm_drv_t)
 
int nm_core_driver_load_init (nm_core_t p_core, puk_component_t driver, nm_trk_kind_t kind, nm_drv_t *pp_drv, const char **p_url)
 
nm_gate_t nm_core_gate_new (nm_core_t p_core, nm_drv_vect_t *p_drvs)
 Init a new gate, using the given set of drivers. More...
 
void nm_core_gate_connect_async (nm_core_t p_core, nm_gate_t gate, nm_drv_t p_drv, nm_trk_id_t trk_id, const char *url)
 start connection process on given gate/trk More...
 
void nm_core_gate_connect_wait (nm_core_t p_core, struct nm_trk_s *p_trk)
 wait for connection completion More...
 
nm_thread_level_t nm_core_get_thread_level (nm_core_t)
 Get the current thread level. More...
 
void nm_core_set_thread_level (nm_thread_level_t)
 Sets the thread level before nm core init. More...
 
int nm_schedule (nm_core_t p_core)
 
struct nm_core_tag_s __attribute__ ((packed))
 
static nm_core_tag_t nm_core_tag_build (nm_session_hash_t hashcode, nm_tag_t tag)
 
static nm_tag_t nm_core_tag_get_tag (nm_core_tag_t core_tag)
 
static nm_session_hash_t nm_core_tag_get_hashcode (nm_core_tag_t core_tag)
 
void nm_core_monitor_add (nm_core_t p_core, struct nm_core_monitor_s *m)
 Register an event monitor. More...
 
void nm_core_monitor_remove (nm_core_t p_core, struct nm_core_monitor_s *m)
 Unregister an event monitor. More...
 
void nm_core_req_monitor (struct nm_core *p_core, struct nm_req_s *p_req, struct nm_monitor_s monitor)
 set a per-request monitor. More...
 
 PUK_LIST_DECLARE_TYPE (nm_req_chunk)
 
 PUK_LIST_DECLARE_TYPE (nm_req)
 
void nm_core_pack_init (struct nm_core *p_core, struct nm_req_s *p_pack)
 initializes an empty pack request More...
 
void nm_core_pack_data (nm_core_t p_core, struct nm_req_s *p_pack, const struct nm_data_s *p_data)
 build a pack request from data descriptor More...
 
void nm_core_pack_send (struct nm_core *p_core, struct nm_req_s *p_pack, nm_core_tag_t tag, nm_gate_t p_gate, nm_req_flag_t flags)
 set tag/gate/flags for pack request More...
 
void nm_core_pack_submit (struct nm_core *p_core, struct nm_req_s *p_pack)
 post a pack request More...
 
void nm_core_pack_set_priority (struct nm_core *p_core, struct nm_req_s *p_pack, nm_prio_t priority)
 set a priority for the given pack request More...
 
static void nm_core_pack_set_hlen (struct nm_core *p_core __attribute__((unused)), struct nm_req_s *p_pack, nm_len_t hlen)
 set a header length for the given pack request More...
 
void nm_core_pack_submit_chunks (struct nm_core *p_core, struct nm_req_s *p_pack, int n, const struct nm_chunk_s *p_chunks)
 
void nm_core_unpack_init (struct nm_core *p_core, struct nm_req_s *p_unpack)
 initializes an empty unpack request More...
 
void nm_core_unpack_offset (struct nm_core *p_core, struct nm_req_s *p_unpack, nm_len_t offset)
 set an offset on data; data before offset will be discarded More...
 
void nm_core_unpack_data (struct nm_core *p_core, struct nm_req_s *p_unpack, const struct nm_data_s *p_data)
 build an unpack request from data descriptor More...
 
void nm_core_unpack_match_recv (struct nm_core *p_core, struct nm_req_s *p_unpack, nm_gate_t p_gate, nm_core_tag_t tag, nm_core_tag_t tag_mask)
 match an unpack request with given gate/tag, next sequence number assumed More...
 
void nm_core_unpack_match_event (struct nm_core *p_core, struct nm_req_s *p_unpack, const struct nm_core_event_s *p_event)
 match an unpack request with a packet that triggered an event More...
 
void nm_core_unpack_submit (struct nm_core *p_core, struct nm_req_s *p_unpack, nm_req_flag_t flags)
 submit an unpack request More...
 
int nm_core_unpack_peek (struct nm_core *p_core, struct nm_req_s *p_unpack, const struct nm_data_s *p_data, nm_len_t peek_offset, nm_len_t peek_len)
 peeks unexpected data without consumming it. More...
 
int nm_core_unpack_iprobe (struct nm_core *p_core, struct nm_req_s *p_unpack)
 probes whether an incoming packet matched this unposted request. More...
 
int nm_core_unpack_cancel (struct nm_core *p_core, struct nm_req_s *p_unpack)
 cancel a pending unpack More...
 
int nm_core_iprobe (struct nm_core *p_core, nm_gate_t p_gate, nm_core_tag_t tag, nm_core_tag_t tag_mask, nm_gate_t *pp_out_gate, nm_core_tag_t *p_out_tag, nm_len_t *p_out_size)
 probe unexpected packet, check matching for (packet_tag & tag_mask) == tag More...
 
void nm_core_flush (struct nm_core *p_core)
 Flush pending packs (if supported by the strategy). More...
 
nm_seq_t nm_core_send_seq_get (struct nm_core *p_core, nm_gate_t p_gate, nm_core_tag_t tag)
 get a seq number in the out stream, to route packet outside of nmad core More...
 
void nm_core_inject_chunk (struct nm_core *p_core, nm_gate_t p_gate, nm_core_tag_t tag, nm_seq_t seq, nm_len_t chunk_offset, nm_len_t chunk_len, int is_last_chunk, nm_injector_pull_data_t p_pull_data, void *p_ref)
 inject a packet in nmad core as if it arrived from network. More...
 
void nm_core_inject_complete (struct nm_core *p_core, struct nm_req_s *p_req, nm_len_t chunk_offset, nm_len_t chunk_len)
 notify data was injected in a matched request, but do not finalize the request (the status will be NM_STATUS_UNPACK_COMPLETED). More...
 
void nm_core_inject_finalize (struct nm_core *p_core, struct nm_req_s *p_req)
 finalize an injected request that was only completed. More...
 
void nm_core_inject_complete_finalize (struct nm_core *p_core, struct nm_req_s *p_req, nm_len_t chunk_offset, nm_len_t chunk_len)
 notify data was injected in a matched request and finalize this request. More...
 
void nm_core_unpack_partition_set (struct nm_req_s *p_unpack, int n_partitions)
 
void nm_core_unpack_partition_free (struct nm_req_s *p_unpack)
 
int nm_core_unpack_partition_test (struct nm_req_s *p_unpack, int partition)
 
void nm_core_task_submit_locked (struct nm_core *p_core, void(*p_handler)(void))
 lock then submit task to pending list More...
 
void nm_core_task_submit_unlocked (struct nm_core *p_core, void(*p_handler)(void))
 submit task lock-free to the submission list More...
 
static void nm_cond_destroy (nm_cond_status_t *p_cond __attribute__((unused)))
 
static void nm_cond_mask (nm_cond_status_t *p_cond, nm_status_t bitmask)
 
static void nm_status_init (struct nm_req_s *p_req, nm_status_t bitmask)
 initialize cond status with given initial value More...
 
static void nm_status_destroy (struct nm_req_s *p_req)
 
static nm_status_t nm_status_test (const struct nm_req_s *p_req, nm_status_t bitmask)
 query for given bits in req status; returns matched bits More...
 
static void nm_status_add (struct nm_req_s *p_req, nm_status_t bitmask)
 
static void nm_status_unset (struct nm_req_s *p_req, nm_status_t bitmask)
 remove bits of bitmask from req status More...
 
static void nm_status_wait (struct nm_req_s *p_req, nm_status_t bitmask, nm_core_t p_core)
 wait for any bit matching in req status More...
 
static void nm_status_signal (struct nm_req_s *p_req, nm_status_t bitmask)
 
static void nm_status_wait_all (void **pp_reqs, int n, uintptr_t offset, nm_status_t bitmask, nm_core_t p_core)
 wait for all reqs, any bit in bitmask More...
 
static void nm_status_assert (struct nm_req_s *p_req __attribute__((unused)), nm_status_t value __attribute__((unused)))
 
static void nm_status_spinwait (struct nm_req_s *p_req, nm_status_t status)
 
static int nm_status_test_allbits (struct nm_req_s *p_req, nm_status_t bitmask)
 tests for all given bits in status More...
 
static void nm_mem_fence_always (void)
 memory fence, always More...
 
static void nm_mem_fence (void)
 memory fence only when multithread More...
 
static int nm_atomic_inc (int *v)
 increment int, atomic only when multithread More...
 
static int nm_atomic_alway_inc (int *v)
 increment int, always atomic More...
 
static int nm_atomic_dec (int *v)
 decrement int, atomic only when multithread More...
 
static int nm_atomic_always_dec (int *v)
 decrement int, always atomic More...
 
static void nm_atomic_add (int *v, int v2)
 int add, atomic only when multithread More...
 
static void nm_atomic_always_add (int *v, int v2)
 int add, always atomic More...
 
static int nm_atomic_compare_and_swap (int *v, int oldval, int newval)
 boolean int compare and swap, atomic only when multithread More...
 
static int nm_atomic_always_compare_and_swap (int *v, int oldval, int newval)
 boolean int compare and swap, always atomic More...
 
static void nm_spin_init (nm_spinlock_t *p_spin)
 init the spin lock More...
 
static void nm_spin_destroy (nm_spinlock_t *p_spin)
 destroy the spin lock More...
 
static void nm_spin_lock (nm_spinlock_t *p_spin)
 acquire the spin lock More...
 
static void nm_spin_unlock (nm_spinlock_t *p_spin)
 release the spin lock More...
 
static int nm_spin_trylock (nm_spinlock_t *p_spin)
 try to lock the spin lock return 1 if lock is successfully acquired, 0 otherwise More...
 
static void nm_spin_assert_locked (nm_spinlock_t *p_spin)
 assert that current thread holds the lock More...
 
static void nm_spin_assert_notlocked (nm_spinlock_t *p_spin)
 assert that current thread doesn't hold the lock More...
 
static void nm_spin_check_nothread (nm_spinlock_t *p_spin __attribute__((unused)))
 check that we are always called from the same thread in case of non-threaded mode More...
 
static void nm_spin_clear_nothread (nm_spinlock_t *p_spin __attribute__((unused)))
 clear the last_tid tracking for lock consistency checking More...
 
static void nm_spin_init (nm_spinlock_t *p_spin __attribute__((unused)))
 
static void nm_spin_destroy (nm_spinlock_t *p_spin __attribute__((unused)))
 
static void nm_spin_lock (nm_spinlock_t *p_spin __attribute__((unused)))
 
static void nm_spin_unlock (nm_spinlock_t *p_spin __attribute__((unused)))
 
static int nm_spin_trylock (nm_spinlock_t *p_spin __attribute__((unused)))
 
static void nm_spin_assert_locked (nm_spinlock_t *p_spin __attribute__((unused)))
 
static void nm_spin_assert_notlocked (nm_spinlock_t *p_spin __attribute__((unused)))
 

Variables

struct nm_core_internal_s nm_core_internal
 
struct nm_core_event_s __attribute__
 
enum  nm_errno_e {
  NM_ESUCCESS = 0 , NM_EUNKNOWN = 1 , NM_ENOTIMPL = 2 , NM_ESCFAILD = 3 ,
  NM_EAGAIN = 4 , NM_ECLOSED = 5 , NM_EBROKEN = 6 , NM_EINVAL = 7 ,
  NM_ENOTFOUND = 8 , NM_ENOMEM = 9 , NM_EALREADY = 10 , NM_ETIMEDOUT = 11 ,
  NM_EINPROGRESS = 12 , NM_EUNREACH = 13 , NM_ECANCELED = 14 , NM_EABORTED = 15 ,
  NM_EBUSY = 16 , NM_ENOTPOSTED = 17 , NM_ETRUNCATED = 18 , _NM_ERR_MAX
}
 Error codes. More...
 
const char * nm_strerror (int rc)
 
static void nm_cond_destroy (nm_cond_status_t *p_cond)
 free resources associated with a nm_cond_status_t object More...
 
static nm_status_t nm_cond_test (const nm_cond_status_t *p_cond, nm_status_t bitmask)
 test whether the given bit is set in the status; unlocked, weak consistency More...
 
static nm_status_t nm_cond_test_locked (const nm_cond_status_t *p_cond, nm_status_t bitmask)
 test whether the given bit is set in the status; locked, guaranteed consistency, slower More...
 
static void nm_cond_add (nm_cond_status_t *p_cond, nm_status_t bitmask)
 add a bit to the bitmask in the status, do not unlock waiters (for bits that will not be waited for) More...
 
static void nm_cond_wait (nm_cond_status_t *p_cond, nm_status_t bitmask, nm_core_t p_core)
 wait for the given bit to be set in the status; do active polling while waiting More...
 
static void nm_cond_signal (nm_cond_status_t *p_cond, nm_status_t bitmask)
 add a bit and wake up threads waiting for it More...
 
static void nm_cond_wait_all (void **pp_conds, int n, uintptr_t offset, nm_status_t bitmask, nm_core_t p_core)
 wait on multiple statuses at the same time More...
 

Detailed Description

This is the interface of the NewMad core.

All other include files in the core are internal and shouldn't be included outside of the core.

End-users are not supposed to use directly this core interface. They should use instead a higher level interface such as sendrecv interface (sendrecv), Pack interface (pack), or MadMPI: MPI Interface (MadMPI) for messaging, and Launcher interface (launcher) for init and connection establishment.

Macro Definition Documentation

◆ NM_CORE_MONITOR_NULL

#define NM_CORE_MONITOR_NULL   ((struct nm_core_monitor_s){ .monitor = NM_MONITOR_NULL, .matching = NM_EVENT_MATCHING_ANY })

Definition at line 309 of file nm_core_interface.h.

◆ NM_CORE_TAG_HASH_FULL

#define NM_CORE_TAG_HASH_FULL   ((nm_session_hash_t)0xFFFFFFFF)

mask for all sessions

Definition at line 227 of file nm_core_interface.h.

◆ NM_CORE_TAG_MASK_FULL

#define NM_CORE_TAG_MASK_FULL   ((nm_core_tag_t){ .tag = NM_TAG_MASK_FULL, .hashcode = NM_CORE_TAG_HASH_FULL })

Definition at line 238 of file nm_core_interface.h.

◆ NM_CORE_TAG_NONE

#define NM_CORE_TAG_NONE   ((nm_core_tag_t){ .tag = 0, .hashcode = 0x0 })

Definition at line 239 of file nm_core_interface.h.

◆ NM_EVENT_MATCHING_ANY

#define NM_EVENT_MATCHING_ANY   ((struct nm_core_event_matching_s){ .p_gate = NM_ANY_GATE, .tag = NM_CORE_TAG_NONE, .tag_mask = NM_CORE_TAG_NONE })

matches any event

Definition at line 305 of file nm_core_interface.h.

◆ NM_MATCHING_CONTAINER_NULL

#define NM_MATCHING_CONTAINER_NULL   ((struct nm_matching_container_s) { NULL })

Definition at line 328 of file nm_core_interface.h.

◆ NM_MONITOR_NULL

#define NM_MONITOR_NULL   ((struct nm_monitor_s){ .p_notifier = NULL, .event_mask = 0, .ref = NULL })

Definition at line 307 of file nm_core_interface.h.

◆ NM_REQ_CHUNK_FLAG_BUF_SEND

#define NM_REQ_CHUNK_FLAG_BUF_SEND   ((nm_req_chunk_flag_t)0x00040000)

use buf_send to send this request

Definition at line 214 of file nm_core_interface.h.

◆ NM_REQ_CHUNK_FLAG_DATA_ITERATOR

#define NM_REQ_CHUNK_FLAG_DATA_ITERATOR   ((nm_req_chunk_flag_t)0x00100000)

use iterator-based data description in pw

Definition at line 218 of file nm_core_interface.h.

◆ NM_REQ_CHUNK_FLAG_NONE

#define NM_REQ_CHUNK_FLAG_NONE   ((nm_req_chunk_flag_t)0x00000000)

no flag set

Definition at line 210 of file nm_core_interface.h.

◆ NM_REQ_CHUNK_FLAG_SHORT

#define NM_REQ_CHUNK_FLAG_SHORT   ((nm_req_chunk_flag_t)0x00020000)

flag req_chunk as short

Definition at line 212 of file nm_core_interface.h.

◆ NM_REQ_CHUNK_FLAG_USE_COPY

#define NM_REQ_CHUNK_FLAG_USE_COPY   ((nm_req_chunk_flag_t)0x00080000)

flatten data as contiguous block before send

Definition at line 216 of file nm_core_interface.h.

◆ NM_REQ_FLAG_FINALIZE_LATER

#define NM_REQ_FLAG_FINALIZE_LATER   ((nm_req_flag_t)0x01000000)

statuses NM_STATUS_UNPACK_COMPLETED and NM_STATUS_FINALIZED will be set separately

Definition at line 200 of file nm_core_interface.h.

◆ NM_REQ_FLAG_MATCHING_FULL

#define NM_REQ_FLAG_MATCHING_FULL   ((nm_req_flag_t)0x00800000)

request matching by gate + tag

Definition at line 198 of file nm_core_interface.h.

◆ NM_REQ_FLAG_MATCHING_GATE

#define NM_REQ_FLAG_MATCHING_GATE   ((nm_req_flag_t)0x00200000)

request matching performed by gate

Definition at line 194 of file nm_core_interface.h.

◆ NM_REQ_FLAG_MATCHING_TAG

#define NM_REQ_FLAG_MATCHING_TAG   ((nm_req_flag_t)0x00400000)

request matching performed by tag

Definition at line 196 of file nm_core_interface.h.

◆ NM_REQ_FLAG_MATCHING_WILDCARD

#define NM_REQ_FLAG_MATCHING_WILDCARD   ((nm_req_flag_t)0x00100000)

request submited in wildcard queue

Definition at line 192 of file nm_core_interface.h.

◆ NM_REQ_FLAG_NONE

#define NM_REQ_FLAG_NONE   ((nm_req_flag_t)0x00000000)

no flag set

Definition at line 178 of file nm_core_interface.h.

◆ NM_REQ_FLAG_PACK

#define NM_REQ_FLAG_PACK   ((nm_req_flag_t)0x00002000)

request is a pack

Definition at line 182 of file nm_core_interface.h.

◆ NM_REQ_FLAG_PACK_PARTITIONED

#define NM_REQ_FLAG_PACK_PARTITIONED   ((nm_req_flag_t)0x04000000)

pack request is partitioned; send a separate msg header before data chunks

Definition at line 204 of file nm_core_interface.h.

◆ NM_REQ_FLAG_PACK_SYNCHRONOUS

#define NM_REQ_FLAG_PACK_SYNCHRONOUS   ((nm_req_flag_t)0x00001000)

flag pack as synchronous (i.e.

request the receiver to send an ack)

Definition at line 180 of file nm_core_interface.h.

◆ NM_REQ_FLAG_UNPACK

#define NM_REQ_FLAG_UNPACK   ((nm_req_flag_t)0x00004000)

request is an unpack

Definition at line 184 of file nm_core_interface.h.

◆ NM_REQ_FLAG_UNPACK_DATA_INFO

#define NM_REQ_FLAG_UNPACK_DATA_INFO   ((nm_req_flag_t)0x00008000)

flag unpack request as data information present

Definition at line 186 of file nm_core_interface.h.

◆ NM_REQ_FLAG_UNPACK_MATCHING_INFO

#define NM_REQ_FLAG_UNPACK_MATCHING_INFO   ((nm_req_flag_t)0x00010000)

flag unpack request as matching information present

Definition at line 188 of file nm_core_interface.h.

◆ NM_REQ_FLAG_UNPACK_PARTITIONED

#define NM_REQ_FLAG_UNPACK_PARTITIONED   ((nm_req_flag_t)0x02000000)

unpack request is partitioned; each chunk whill be notified separately

Definition at line 202 of file nm_core_interface.h.

◆ NM_REQ_FLAG_UNPACK_PREFETCHING

#define NM_REQ_FLAG_UNPACK_PREFETCHING   ((nm_req_flag_t)0x00020000)

flag unpack request needs prefetching

Definition at line 190 of file nm_core_interface.h.

◆ NM_STATUS_ACK_RECEIVED

#define NM_STATUS_ACK_RECEIVED   ((nm_status_t)0x00000100)

ack received for the given pack

Definition at line 156 of file nm_core_interface.h.

◆ NM_STATUS_ERROR

#define NM_STATUS_ERROR   ((nm_status_t)0x00001000)

request is in error; see error state in request

Definition at line 164 of file nm_core_interface.h.

◆ NM_STATUS_FINALIZED

#define NM_STATUS_FINALIZED   ((nm_status_t)0x00000800)

request is finalized, may be freed

Examples
nm_bench_req_monitor.c.

Definition at line 162 of file nm_core_interface.h.

◆ NM_STATUS_MASK_FULL

#define NM_STATUS_MASK_FULL   ((nm_status_t)-1)

mask to catch all bits of status

Definition at line 171 of file nm_core_interface.h.

◆ NM_STATUS_NONE

#define NM_STATUS_NONE   ((nm_status_t)0x00000000)

empty request

Definition at line 138 of file nm_core_interface.h.

◆ NM_STATUS_PACK_COMPLETED

#define NM_STATUS_PACK_COMPLETED   ((nm_status_t)0x00000004)

sending operation has completed

Definition at line 144 of file nm_core_interface.h.

◆ NM_STATUS_PACK_INIT

#define NM_STATUS_PACK_INIT   ((nm_status_t)0x00000001)

request initialized, not sent yet

Definition at line 140 of file nm_core_interface.h.

◆ NM_STATUS_PACK_MSG_SIZE

#define NM_STATUS_PACK_MSG_SIZE   ((nm_status_t)0x00002000)

msg size already sent; used only if flag pack_partitioned is set

Definition at line 166 of file nm_core_interface.h.

◆ NM_STATUS_PACK_POSTED

#define NM_STATUS_PACK_POSTED   ((nm_status_t)0x00000040)

sending operation is in progress

Definition at line 152 of file nm_core_interface.h.

◆ NM_STATUS_UNEXPECTED

#define NM_STATUS_UNEXPECTED   ((nm_status_t)0x00000010)

data or rdv has arrived, with no matching unpack

Definition at line 148 of file nm_core_interface.h.

◆ NM_STATUS_UNPACK_CANCELLED

#define NM_STATUS_UNPACK_CANCELLED   ((nm_status_t)0x00000020)

unpack operation has been cancelled

Definition at line 150 of file nm_core_interface.h.

◆ NM_STATUS_UNPACK_COMPLETED

#define NM_STATUS_UNPACK_COMPLETED   ((nm_status_t)0x00000008)

unpack operation has completed

Definition at line 146 of file nm_core_interface.h.

◆ NM_STATUS_UNPACK_DATA0

#define NM_STATUS_UNPACK_DATA0   ((nm_status_t)0x00000200)

first byte of data arrived, not unpacked yet- event triggered only if unpack is posted without data spec

Definition at line 158 of file nm_core_interface.h.

◆ NM_STATUS_UNPACK_DATA_SIZE

#define NM_STATUS_UNPACK_DATA_SIZE   ((nm_status_t)0x00000400)

size of data is known (last chunk of data arrived), not unpacked yet- event triggered only if unpack is posted without data spec

Definition at line 160 of file nm_core_interface.h.

◆ NM_STATUS_UNPACK_INIT

#define NM_STATUS_UNPACK_INIT   ((nm_status_t)0x00000002)

request initialized, not sent yet

Definition at line 142 of file nm_core_interface.h.

◆ NM_STATUS_UNPACK_POSTED

#define NM_STATUS_UNPACK_POSTED   ((nm_status_t)0x00000080)

unpack operation is in progress

Definition at line 154 of file nm_core_interface.h.

◆ NM_STATUS_UNPACK_PREFETCHED

#define NM_STATUS_UNPACK_PREFETCHED   ((nm_status_t)0x00004000)

flag unpack request as prefetched

Definition at line 168 of file nm_core_interface.h.

Typedef Documentation

◆ nm_cond_status_t

status with synchronization (wait/signal)

Definition at line 132 of file nm_core_interface.h.

◆ nm_core_event_notifier_t

typedef void(* nm_core_event_notifier_t) (const struct nm_core_event_s *const event, void *ref)

an event notifier, fired upon status transition

Definition at line 272 of file nm_core_interface.h.

◆ nm_core_t

typedef struct nm_core* nm_core_t

Definition at line 48 of file nm_core_interface.h.

◆ nm_core_tag_t

typedef struct nm_core_tag_s nm_core_tag_t

Definition at line 236 of file nm_core_interface.h.

◆ nm_core_task_kind_t

Definition at line 341 of file nm_core_interface.h.

◆ nm_drv_t

typedef struct nm_drv_s* nm_drv_t

a nmad driver; opaque type for the user

Definition at line 79 of file nm_core_interface.h.

◆ nm_injector_pull_data_t

typedef void(* nm_injector_pull_data_t) (struct nm_req_s *p_req, const struct nm_data_s *p_data, nm_len_t chunk_offset, nm_len_t chunk_len, void *p_ref)

user-supplied function called to pull data to posted request through nmad core p_req is the user request that matched this chunk p_data is the memory buffer where to copy the chunk (may be different from p_req->data in case we are actually peeking.

chunk_offset, chunk_len describe the chunk we are receiving p_ref user-supplied reference given to nm_core_inject_chunk()

Definition at line 523 of file nm_core_interface.h.

◆ nm_req_chunk_flag_t

typedef uint32_t nm_req_chunk_flag_t

flags for req_chunk

Definition at line 207 of file nm_core_interface.h.

◆ nm_req_flag_t

typedef uint32_t nm_req_flag_t

pack/unpack flags

Definition at line 175 of file nm_core_interface.h.

◆ nm_session_hash_t

typedef uint32_t nm_session_hash_t

a session hashcode in tags, used to multiplex sessions

Definition at line 224 of file nm_core_interface.h.

◆ nm_spinlock_t

typedef struct nm_spinlock_s nm_spinlock_t

Definition at line 913 of file nm_core_interface.h.

◆ nm_status_t

typedef uint32_t nm_status_t

status bits of pack/unpack requests

Definition at line 130 of file nm_core_interface.h.

◆ nm_thread_level_t

Definition at line 106 of file nm_core_interface.h.

Enumeration Type Documentation

◆ nm_core_task_kind_e

Enumerator
NM_CORE_TASK_NONE 
NM_CORE_TASK_UNPACK_NEXT 

try to match the next unpack on the given gate/tag/gtag

NM_CORE_TASK_COMPLETED_PW 

process a completed pw

NM_CORE_TASK_COMPLETED_PREFETCH 

prefetch completed; process RTR if received

NM_CORE_TASK_PACK_SUBMISSION 

process a submitted pack request

NM_CORE_TASK_RTR_SEND 

send a RTR once the large pw for recv has been posted

NM_CORE_TASK_HANDLER 

call a user handler, mainly for testing/benchmarking

Definition at line 331 of file nm_core_interface.h.

◆ nm_errno_e

enum nm_errno_e

Error codes.

Enumerator
NM_ESUCCESS 

successful operation

NM_EUNKNOWN 

unknown error

NM_ENOTIMPL 

not implemented

NM_ESCFAILD 

syscall failed, see errno

NM_EAGAIN 

poll again

NM_ECLOSED 

connection closed

NM_EBROKEN 

error condition on connection

NM_EINVAL 

invalid parameter

NM_ENOTFOUND 

not found

NM_ENOMEM 

out of memory

NM_EALREADY 

already in progress or done

NM_ETIMEDOUT 

operation timeout

NM_EINPROGRESS 

operation in progress

NM_EUNREACH 

destination unreachable

NM_ECANCELED 

operation canceled

NM_EABORTED 

operation aborted

NM_EBUSY 

gate/track is busy

NM_ENOTPOSTED 

request not posted

NM_ETRUNCATED 

receive is too short, message would be truncated

_NM_ERR_MAX 

Definition at line 32 of file nm_errno.h.

◆ nm_thread_level_e

Enumerator
NM_THREAD_SINGLE 
NM_THREAD_FUNNELED 
NM_THREAD_SERIALIZED 
NM_THREAD_MULTIPLE 

Definition at line 99 of file nm_core_interface.h.

Function Documentation

◆ __attribute__() [1/2]

struct nm_core_tag_s __attribute__ ( (packed)  )

◆ __attribute__() [2/2]

__attribute__ ( (pure)  )

Definition at line 67 of file nm_core_interface.h.

References nm_core_internal, and nm_core_internal_s::p_core_singleton.

◆ nm_atomic_add()

static void nm_atomic_add ( int *  v,
int  v2 
)
inlinestatic

int add, atomic only when multithread

Definition at line 835 of file nm_core_interface.h.

References nm_core_get_thread_level(), and NM_THREAD_SERIALIZED.

Here is the call graph for this function:

◆ nm_atomic_alway_inc()

static int nm_atomic_alway_inc ( int *  v)
inlinestatic

increment int, always atomic

Definition at line 805 of file nm_core_interface.h.

◆ nm_atomic_always_add()

static void nm_atomic_always_add ( int *  v,
int  v2 
)
inlinestatic

int add, always atomic

Definition at line 853 of file nm_core_interface.h.

◆ nm_atomic_always_compare_and_swap()

static int nm_atomic_always_compare_and_swap ( int *  v,
int  oldval,
int  newval 
)
inlinestatic

boolean int compare and swap, always atomic

Definition at line 885 of file nm_core_interface.h.

◆ nm_atomic_always_dec()

static int nm_atomic_always_dec ( int *  v)
inlinestatic

decrement int, always atomic

Definition at line 829 of file nm_core_interface.h.

◆ nm_atomic_compare_and_swap()

static int nm_atomic_compare_and_swap ( int *  v,
int  oldval,
int  newval 
)
inlinestatic

boolean int compare and swap, atomic only when multithread

Definition at line 859 of file nm_core_interface.h.

References nm_core_get_thread_level(), and NM_THREAD_SERIALIZED.

Here is the call graph for this function:

◆ nm_atomic_dec()

static int nm_atomic_dec ( int *  v)
inlinestatic

decrement int, atomic only when multithread

Definition at line 811 of file nm_core_interface.h.

References nm_core_get_thread_level(), and NM_THREAD_SERIALIZED.

Referenced by nm_pw_ref_dec().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nm_atomic_inc()

static int nm_atomic_inc ( int *  v)
inlinestatic

increment int, atomic only when multithread

Definition at line 787 of file nm_core_interface.h.

References nm_core_get_thread_level(), and NM_THREAD_SERIALIZED.

Referenced by nm_coll_tree_issend(), nm_coll_tree_recv(), nm_coll_tree_send(), and nm_pw_ref_inc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nm_cond_add()

static void nm_cond_add ( nm_cond_status_t p_cond,
nm_status_t  bitmask 
)
inlinestatic

add a bit to the bitmask in the status, do not unlock waiters (for bits that will not be waited for)

Definition at line 665 of file nm_core_interface.h.

Referenced by nm_status_add().

Here is the caller graph for this function:

◆ nm_cond_destroy() [1/2]

static void nm_cond_destroy ( nm_cond_status_t *p_cond   __attribute__(unused))
inlinestatic

Definition at line 651 of file nm_core_interface.h.

◆ nm_cond_destroy() [2/2]

static void nm_cond_destroy ( nm_cond_status_t p_cond)
inlinestatic

free resources associated with a nm_cond_status_t object

Referenced by nm_status_destroy().

Here is the caller graph for this function:

◆ nm_cond_mask()

static void nm_cond_mask ( nm_cond_status_t p_cond,
nm_status_t  bitmask 
)
inlinestatic

Definition at line 670 of file nm_core_interface.h.

Referenced by nm_status_unset().

Here is the caller graph for this function:

◆ nm_cond_signal()

static void nm_cond_signal ( nm_cond_status_t p_cond,
nm_status_t  bitmask 
)
inlinestatic

add a bit and wake up threads waiting for it

Examples
nm_bench_req_monitor.c.

Definition at line 675 of file nm_core_interface.h.

Referenced by nm_status_signal().

Here is the caller graph for this function:

◆ nm_cond_test()

static nm_status_t nm_cond_test ( const nm_cond_status_t p_cond,
nm_status_t  bitmask 
)
inlinestatic

test whether the given bit is set in the status; unlocked, weak consistency

Definition at line 655 of file nm_core_interface.h.

Referenced by nm_cond_test_locked(), nm_cond_wait(), and nm_status_test().

Here is the caller graph for this function:

◆ nm_cond_test_locked()

static nm_status_t nm_cond_test_locked ( const nm_cond_status_t p_cond,
nm_status_t  bitmask 
)
inlinestatic

test whether the given bit is set in the status; locked, guaranteed consistency, slower

Definition at line 660 of file nm_core_interface.h.

References nm_cond_test().

Referenced by nm_status_test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nm_cond_wait()

static void nm_cond_wait ( nm_cond_status_t p_cond,
nm_status_t  bitmask,
nm_core_t  p_core 
)
inlinestatic

wait for the given bit to be set in the status; do active polling while waiting

Examples
nm_bench_req_monitor.c.

Definition at line 680 of file nm_core_interface.h.

References nm_cond_test(), and nm_schedule().

Referenced by nm_cond_wait_all(), and nm_status_wait().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nm_cond_wait_all()

static void nm_cond_wait_all ( void **  pp_conds,
int  n,
uintptr_t  offset,
nm_status_t  bitmask,
nm_core_t  p_core 
)
inlinestatic

wait on multiple statuses at the same time

Definition at line 688 of file nm_core_interface.h.

References nm_cond_wait().

Referenced by nm_status_wait_all().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nm_core_component_load()

puk_component_t nm_core_component_load ( const char *  entity,
const char *  name 
)

◆ nm_core_driver_load_init()

int nm_core_driver_load_init ( nm_core_t  p_core,
puk_component_t  driver,
nm_trk_kind_t  kind,
nm_drv_t pp_drv,
const char **  p_url 
)

◆ nm_core_exit()

int nm_core_exit ( nm_core_t  p_core)

◆ nm_core_flush()

void nm_core_flush ( struct nm_core p_core)

Flush pending packs (if supported by the strategy).

◆ nm_core_gate_connect_async()

void nm_core_gate_connect_async ( nm_core_t  p_core,
nm_gate_t  gate,
nm_drv_t  p_drv,
nm_trk_id_t  trk_id,
const char *  url 
)

start connection process on given gate/trk

◆ nm_core_gate_connect_wait()

void nm_core_gate_connect_wait ( nm_core_t  p_core,
struct nm_trk_s p_trk 
)

wait for connection completion

◆ nm_core_gate_new()

nm_gate_t nm_core_gate_new ( nm_core_t  p_core,
nm_drv_vect_t *  p_drvs 
)

Init a new gate, using the given set of drivers.

◆ nm_core_get_thread_level()

nm_thread_level_t nm_core_get_thread_level ( nm_core_t  )

◆ nm_core_init()

int nm_core_init ( nm_core_t pp_core)

◆ nm_core_inject_chunk()

void nm_core_inject_chunk ( struct nm_core p_core,
nm_gate_t  p_gate,
nm_core_tag_t  tag,
nm_seq_t  seq,
nm_len_t  chunk_offset,
nm_len_t  chunk_len,
int  is_last_chunk,
nm_injector_pull_data_t  p_pull_data,
void *  p_ref 
)

inject a packet in nmad core as if it arrived from network.

p_pull_data is called when a matching request is posted

◆ nm_core_inject_complete()

void nm_core_inject_complete ( struct nm_core p_core,
struct nm_req_s p_req,
nm_len_t  chunk_offset,
nm_len_t  chunk_len 
)

notify data was injected in a matched request, but do not finalize the request (the status will be NM_STATUS_UNPACK_COMPLETED).

◆ nm_core_inject_complete_finalize()

void nm_core_inject_complete_finalize ( struct nm_core p_core,
struct nm_req_s p_req,
nm_len_t  chunk_offset,
nm_len_t  chunk_len 
)

notify data was injected in a matched request and finalize this request.

◆ nm_core_inject_finalize()

void nm_core_inject_finalize ( struct nm_core p_core,
struct nm_req_s p_req 
)

finalize an injected request that was only completed.

◆ nm_core_iprobe()

int nm_core_iprobe ( struct nm_core p_core,
nm_gate_t  p_gate,
nm_core_tag_t  tag,
nm_core_tag_t  tag_mask,
nm_gate_t pp_out_gate,
nm_core_tag_t p_out_tag,
nm_len_t p_out_size 
)

probe unexpected packet, check matching for (packet_tag & tag_mask) == tag

◆ nm_core_monitor_add()

void nm_core_monitor_add ( nm_core_t  p_core,
struct nm_core_monitor_s m 
)

Register an event monitor.

◆ nm_core_monitor_remove()

void nm_core_monitor_remove ( nm_core_t  p_core,
struct nm_core_monitor_s m 
)

Unregister an event monitor.

◆ nm_core_pack_data()

void nm_core_pack_data ( nm_core_t  p_core,
struct nm_req_s p_pack,
const struct nm_data_s p_data 
)

build a pack request from data descriptor

Referenced by nm_sr_send_pack_data().

Here is the caller graph for this function:

◆ nm_core_pack_init()

void nm_core_pack_init ( struct nm_core p_core,
struct nm_req_s p_pack 
)

initializes an empty pack request

Referenced by nm_sr_send_init().

Here is the caller graph for this function:

◆ nm_core_pack_send()

void nm_core_pack_send ( struct nm_core p_core,
struct nm_req_s p_pack,
nm_core_tag_t  tag,
nm_gate_t  p_gate,
nm_req_flag_t  flags 
)

set tag/gate/flags for pack request

Referenced by nm_sr_send_dest(), nm_sr_send_issend(), and nm_sr_send_rsend().

Here is the caller graph for this function:

◆ nm_core_pack_set_hlen()

static void nm_core_pack_set_hlen ( struct nm_core *p_core   __attribute__(unused),
struct nm_req_s p_pack,
nm_len_t  hlen 
)
inlinestatic

set a header length for the given pack request

Definition at line 465 of file nm_core_interface.h.

References nm_req_s::hlen, hlen, and nm_req_s::pack.

Referenced by nm_sr_send_header().

Here is the caller graph for this function:

◆ nm_core_pack_set_priority()

void nm_core_pack_set_priority ( struct nm_core p_core,
struct nm_req_s p_pack,
nm_prio_t  priority 
)

set a priority for the given pack request

Referenced by nm_sr_send_set_priority().

Here is the caller graph for this function:

◆ nm_core_pack_submit()

void nm_core_pack_submit ( struct nm_core p_core,
struct nm_req_s p_pack 
)

post a pack request

Referenced by nm_sr_send_issend(), nm_sr_send_rsend(), and nm_sr_send_submit().

Here is the caller graph for this function:

◆ nm_core_pack_submit_chunks()

void nm_core_pack_submit_chunks ( struct nm_core p_core,
struct nm_req_s p_pack,
int  n,
const struct nm_chunk_s p_chunks 
)

Referenced by nm_sr_send_submit_chunks().

Here is the caller graph for this function:

◆ nm_core_req_monitor()

void nm_core_req_monitor ( struct nm_core p_core,
struct nm_req_s p_req,
struct nm_monitor_s  monitor 
)

set a per-request monitor.

Fire event immediately if pending

◆ nm_core_schedopt_disable()

void nm_core_schedopt_disable ( nm_core_t  p_core)

disable schedopt for raw driver use

◆ nm_core_send_seq_get()

nm_seq_t nm_core_send_seq_get ( struct nm_core p_core,
nm_gate_t  p_gate,
nm_core_tag_t  tag 
)

get a seq number in the out stream, to route packet outside of nmad core

◆ nm_core_set_hints()

void nm_core_set_hints ( nm_core_t  p_core,
int  size,
int  rank 
)

◆ nm_core_set_strategy()

int nm_core_set_strategy ( nm_core_t  p_core,
puk_component_t  strategy 
)

◆ nm_core_set_thread_level()

void nm_core_set_thread_level ( nm_thread_level_t  )

Sets the thread level before nm core init.

Note
should be called before init

◆ nm_core_tag_build()

static nm_core_tag_t nm_core_tag_build ( nm_session_hash_t  hashcode,
nm_tag_t  tag 
)
inlinestatic

◆ nm_core_tag_get_hashcode()

static nm_session_hash_t nm_core_tag_get_hashcode ( nm_core_tag_t  core_tag)
inlinestatic

Definition at line 252 of file nm_core_interface.h.

References nm_core_tag_s::hashcode.

Referenced by nm_matching_gsession_bytag(), and nm_matching_wildcard_bytag().

Here is the caller graph for this function:

◆ nm_core_tag_get_tag()

static nm_tag_t nm_core_tag_get_tag ( nm_core_tag_t  core_tag)
inlinestatic

Definition at line 248 of file nm_core_interface.h.

References nm_core_tag_s::tag.

Referenced by nm_sr_request_get_tag().

Here is the caller graph for this function:

◆ nm_core_task_submit_locked()

void nm_core_task_submit_locked ( struct nm_core p_core,
void(*)(void)  p_handler 
)

lock then submit task to pending list

◆ nm_core_task_submit_unlocked()

void nm_core_task_submit_unlocked ( struct nm_core p_core,
void(*)(void)  p_handler 
)

submit task lock-free to the submission list

◆ nm_core_unpack_cancel()

int nm_core_unpack_cancel ( struct nm_core p_core,
struct nm_req_s p_unpack 
)

cancel a pending unpack

Note
cancel may fail if matching was already done.

◆ nm_core_unpack_data()

void nm_core_unpack_data ( struct nm_core p_core,
struct nm_req_s p_unpack,
const struct nm_data_s p_data 
)

build an unpack request from data descriptor

Referenced by nm_sr_recv_unpack_data().

Here is the caller graph for this function:

◆ nm_core_unpack_init()

void nm_core_unpack_init ( struct nm_core p_core,
struct nm_req_s p_unpack 
)

initializes an empty unpack request

Referenced by nm_sr_recv_init().

Here is the caller graph for this function:

◆ nm_core_unpack_iprobe()

int nm_core_unpack_iprobe ( struct nm_core p_core,
struct nm_req_s p_unpack 
)

probes whether an incoming packet matched this unposted request.

in case of success, request and packet are associated and request must be posted.

Referenced by nm_sr_recv_iprobe().

Here is the caller graph for this function:

◆ nm_core_unpack_match_event()

void nm_core_unpack_match_event ( struct nm_core p_core,
struct nm_req_s p_unpack,
const struct nm_core_event_s p_event 
)

match an unpack request with a packet that triggered an event

Referenced by nm_sr_recv_match_event().

Here is the caller graph for this function:

◆ nm_core_unpack_match_recv()

void nm_core_unpack_match_recv ( struct nm_core p_core,
struct nm_req_s p_unpack,
nm_gate_t  p_gate,
nm_core_tag_t  tag,
nm_core_tag_t  tag_mask 
)

match an unpack request with given gate/tag, next sequence number assumed

Referenced by nm_sr_recv_match().

Here is the caller graph for this function:

◆ nm_core_unpack_offset()

void nm_core_unpack_offset ( struct nm_core p_core,
struct nm_req_s p_unpack,
nm_len_t  offset 
)

set an offset on data; data before offset will be discarded

Referenced by nm_sr_recv_offset().

Here is the caller graph for this function:

◆ nm_core_unpack_partition_free()

void nm_core_unpack_partition_free ( struct nm_req_s p_unpack)

◆ nm_core_unpack_partition_set()

void nm_core_unpack_partition_set ( struct nm_req_s p_unpack,
int  n_partitions 
)

◆ nm_core_unpack_partition_test()

int nm_core_unpack_partition_test ( struct nm_req_s p_unpack,
int  partition 
)

◆ nm_core_unpack_peek()

int nm_core_unpack_peek ( struct nm_core p_core,
struct nm_req_s p_unpack,
const struct nm_data_s p_data,
nm_len_t  peek_offset,
nm_len_t  peek_len 
)

peeks unexpected data without consumming it.

offset & len are relative to p_data

Referenced by nm_sr_recv_peek(), and nm_sr_recv_peek_offset().

Here is the caller graph for this function:

◆ nm_core_unpack_submit()

void nm_core_unpack_submit ( struct nm_core p_core,
struct nm_req_s p_unpack,
nm_req_flag_t  flags 
)

submit an unpack request

Referenced by nm_sr_recv_post().

Here is the caller graph for this function:

◆ nm_mem_fence()

static void nm_mem_fence ( void  )
inlinestatic

memory fence only when multithread

Definition at line 773 of file nm_core_interface.h.

References nm_core_get_thread_level(), and NM_THREAD_SERIALIZED.

Here is the call graph for this function:

◆ nm_mem_fence_always()

static void nm_mem_fence_always ( void  )
inlinestatic

memory fence, always

Definition at line 767 of file nm_core_interface.h.

◆ nm_schedule()

int nm_schedule ( nm_core_t  p_core)

Referenced by nm_cond_wait().

Here is the caller graph for this function:

◆ nm_spin_assert_locked() [1/2]

static void nm_spin_assert_locked ( nm_spinlock_t *p_spin   __attribute__(unused))
inlinestatic

Definition at line 1076 of file nm_core_interface.h.

◆ nm_spin_assert_locked() [2/2]

static void nm_spin_assert_locked ( nm_spinlock_t p_spin)
inlinestatic

assert that current thread holds the lock

Referenced by nm_core_lock_assert().

Here is the caller graph for this function:

◆ nm_spin_assert_notlocked() [1/2]

static void nm_spin_assert_notlocked ( nm_spinlock_t *p_spin   __attribute__(unused))
inlinestatic

Definition at line 1088 of file nm_core_interface.h.

◆ nm_spin_assert_notlocked() [2/2]

static void nm_spin_assert_notlocked ( nm_spinlock_t p_spin)
inlinestatic

assert that current thread doesn't hold the lock

Referenced by nm_core_nolock_assert().

Here is the caller graph for this function:

◆ nm_spin_check_nothread()

static void nm_spin_check_nothread ( nm_spinlock_t *p_spin   __attribute__(unused))
inlinestatic

check that we are always called from the same thread in case of non-threaded mode

Definition at line 941 of file nm_core_interface.h.

References nm_core_get_thread_level(), NM_FATAL, and NM_THREAD_SERIALIZED.

Referenced by nm_spin_lock(), and nm_spin_trylock().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nm_spin_clear_nothread()

static void nm_spin_clear_nothread ( nm_spinlock_t *p_spin   __attribute__(unused))
inlinestatic

clear the last_tid tracking for lock consistency checking

Definition at line 962 of file nm_core_interface.h.

References nm_core_get_thread_level(), NM_FATAL, NM_THREAD_SERIALIZED, and NM_WARN.

Referenced by nm_spin_unlock().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nm_spin_destroy() [1/2]

static void nm_spin_destroy ( nm_spinlock_t *p_spin   __attribute__(unused))
inlinestatic

Definition at line 994 of file nm_core_interface.h.

◆ nm_spin_destroy() [2/2]

static void nm_spin_destroy ( nm_spinlock_t p_spin)
inlinestatic

destroy the spin lock

Referenced by nm_core_lock_destroy().

Here is the caller graph for this function:

◆ nm_spin_init() [1/2]

static void nm_spin_init ( nm_spinlock_t *p_spin   __attribute__(unused))
inlinestatic

Definition at line 982 of file nm_core_interface.h.

◆ nm_spin_init() [2/2]

static void nm_spin_init ( nm_spinlock_t p_spin)
inlinestatic

init the spin lock

Referenced by nm_core_lock_init().

Here is the caller graph for this function:

◆ nm_spin_lock() [1/2]

static void nm_spin_lock ( nm_spinlock_t *p_spin   __attribute__(unused))
inlinestatic

Definition at line 1005 of file nm_core_interface.h.

References nm_core_get_thread_level(), NM_FATAL, nm_spin_check_nothread(), and NM_THREAD_SERIALIZED.

Here is the call graph for this function:

◆ nm_spin_lock() [2/2]

static void nm_spin_lock ( nm_spinlock_t p_spin)
inlinestatic

acquire the spin lock

Referenced by nm_core_lock().

Here is the caller graph for this function:

◆ nm_spin_trylock() [1/2]

static int nm_spin_trylock ( nm_spinlock_t *p_spin   __attribute__(unused))
inlinestatic

Definition at line 1047 of file nm_core_interface.h.

References nm_core_get_thread_level(), nm_spin_check_nothread(), and NM_THREAD_SERIALIZED.

Here is the call graph for this function:

◆ nm_spin_trylock() [2/2]

static int nm_spin_trylock ( nm_spinlock_t p_spin)
inlinestatic

try to lock the spin lock return 1 if lock is successfully acquired, 0 otherwise

Referenced by nm_core_trylock().

Here is the caller graph for this function:

◆ nm_spin_unlock() [1/2]

static void nm_spin_unlock ( nm_spinlock_t *p_spin   __attribute__(unused))
inlinestatic

Definition at line 1028 of file nm_core_interface.h.

References nm_core_get_thread_level(), nm_spin_clear_nothread(), and NM_THREAD_SERIALIZED.

Here is the call graph for this function:

◆ nm_spin_unlock() [2/2]

static void nm_spin_unlock ( nm_spinlock_t p_spin)
inlinestatic

release the spin lock

Referenced by nm_core_unlock().

Here is the caller graph for this function:

◆ nm_status_add()

static void nm_status_add ( struct nm_req_s p_req,
nm_status_t  bitmask 
)
inlinestatic

Definition at line 721 of file nm_core_interface.h.

References nm_cond_add(), and nm_req_s::status.

Here is the call graph for this function:

◆ nm_status_assert()

static void nm_status_assert ( struct nm_req_s *p_req   __attribute__(unused),
nm_status_t value   __attribute__(unused) 
)
inlinestatic

Definition at line 748 of file nm_core_interface.h.

References NM_STATUS_MASK_FULL, and nm_status_test().

Here is the call graph for this function:

◆ nm_status_destroy()

static void nm_status_destroy ( struct nm_req_s p_req)
inlinestatic

Definition at line 709 of file nm_core_interface.h.

References nm_cond_destroy(), and nm_req_s::status.

Here is the call graph for this function:

◆ nm_status_init()

static void nm_status_init ( struct nm_req_s p_req,
nm_status_t  bitmask 
)
inlinestatic

initialize cond status with given initial value

Definition at line 705 of file nm_core_interface.h.

References nm_cond_init(), and nm_req_s::status.

Here is the call graph for this function:

◆ nm_status_signal()

static void nm_status_signal ( struct nm_req_s p_req,
nm_status_t  bitmask 
)
inlinestatic

Definition at line 736 of file nm_core_interface.h.

References nm_cond_signal(), and nm_req_s::status.

Here is the call graph for this function:

◆ nm_status_spinwait()

static void nm_status_spinwait ( struct nm_req_s p_req,
nm_status_t  status 
)
inlinestatic

Definition at line 753 of file nm_core_interface.h.

References nm_status_test(), and status.

Here is the call graph for this function:

◆ nm_status_test()

static nm_status_t nm_status_test ( const struct nm_req_s p_req,
nm_status_t  bitmask 
)
inlinestatic

query for given bits in req status; returns matched bits

Definition at line 714 of file nm_core_interface.h.

References nm_cond_test(), nm_cond_test_locked(), NM_STATUS_FINALIZED, and nm_req_s::status.

Referenced by nm_sr_recv_data_size_wait(), nm_sr_recv_data_test(), nm_sr_recv_data_wait(), nm_sr_request_get_expected_size(), nm_status_assert(), nm_status_spinwait(), nm_status_test_allbits(), and nm_status_wait().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nm_status_test_allbits()

static int nm_status_test_allbits ( struct nm_req_s p_req,
nm_status_t  bitmask 
)
inlinestatic

tests for all given bits in status

Definition at line 759 of file nm_core_interface.h.

References nm_status_test().

Referenced by nm_sr_request_test().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nm_status_unset()

static void nm_status_unset ( struct nm_req_s p_req,
nm_status_t  bitmask 
)
inlinestatic

remove bits of bitmask from req status

Definition at line 726 of file nm_core_interface.h.

References nm_cond_mask(), and nm_req_s::status.

Here is the call graph for this function:

◆ nm_status_wait()

static void nm_status_wait ( struct nm_req_s p_req,
nm_status_t  bitmask,
nm_core_t  p_core 
)
inlinestatic

wait for any bit matching in req status

Definition at line 731 of file nm_core_interface.h.

References nm_cond_wait(), nm_status_test(), and nm_req_s::status.

Referenced by nm_sr_recv_data_size_wait(), nm_sr_recv_data_wait(), and nm_sr_rwait_data().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nm_status_wait_all()

static void nm_status_wait_all ( void **  pp_reqs,
int  n,
uintptr_t  offset,
nm_status_t  bitmask,
nm_core_t  p_core 
)
inlinestatic

wait for all reqs, any bit in bitmask

Definition at line 741 of file nm_core_interface.h.

References nm_cond_wait_all(), nm_req_s::offset, and nm_req_s::status.

Referenced by nm_sr_request_wait_all().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ nm_strerror()

const char * nm_strerror ( int  rc)

◆ PUK_LIST_DECLARE_TYPE() [1/2]

PUK_LIST_DECLARE_TYPE ( nm_req  )

◆ PUK_LIST_DECLARE_TYPE() [2/2]

PUK_LIST_DECLARE_TYPE ( nm_req_chunk  )

◆ PUK_VECT_TYPE()

PUK_VECT_TYPE ( nm_drv  ,
nm_drv_t   
)

Variable Documentation

◆ __attribute__

struct nm_ctrl_chunk_s __attribute__

◆ nm_core_internal

struct nm_core_internal_s nm_core_internal
private

Referenced by __attribute__().