NewMadeleine

Documentation

« back to PM2 home.
nm_core.h
Go to the documentation of this file.
1/*
2 * NewMadeleine
3 * Copyright (C) 2006-2025 (see AUTHORS file)
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or (at
8 * your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 */
15
16
17#ifndef NM_CORE_H
18#define NM_CORE_H
19
20#ifndef NM_PRIVATE_H
21# error "Cannot include this file directly. Please include <nm_private.h>"
22#endif
23
24#ifndef PIOMAN
25#include <pthread.h>
26#endif
27
34#ifdef PIOMAN_MULTITHREAD
35PUK_LFQUEUE_TYPE(nm_core_task, struct nm_core_task_s*, NULL, NM_CORE_TASK_QUEUE_SIZE);
36#else /* PIOMAN_MULTITHREAD */
38#endif /* PIOMAN_MULTITHREAD */
39
42struct nm_core
43{
46
47#ifdef PIOMAN
48 piom_ltask_t ltask;
49#else /* PIOMAN */
50 /* if PIOMan is enabled, it already manages a list of pw to poll */
51 struct nm_pw_poll_list_s pw_poll_list;
52#endif /* PIOMAN */
53 struct nm_pkt_wrap_list_s prefetch_large_send;
55#ifdef NMAD_HWLOC
56 hwloc_topology_t topology;
57#endif /* NMAD_HWLOC */
58
59 puk_component_t strategy_component;
60 puk_context_t strategy_context;
63 struct nm_gate_list_s gate_list;
64 struct nm_drv_list_s driver_list;
67 struct nm_core_task_lfqueue_s pending_tasks;
69 struct nm_req_chunk_allocator_s req_chunk_allocator;
70 struct nm_ctrl_chunk_allocator_s ctrl_chunk_allocator;
71 struct nm_pw_nohd_allocator_s pw_nohd_allocator;
72 struct nm_pw_buf_allocator_s pw_buf_allocator;
73 uint64_t unpack_seq;
77 struct nm_core_monitor_vect_s monitors;
78 struct nm_active_gate_list_s active_gates;
80 struct nm_trk_hashtable_s trk_table;
82 struct nm_core_dispatching_event_lfqueue_s dispatching_events;
83 struct nm_core_dispatching_event_allocator_s dispatching_event_allocator;
94#ifdef NMAD_PROFILE
95 puk_tick_t time_orig;
96 struct
97 {
98 unsigned long long n_locks;
99 unsigned long long n_schedule;
100 unsigned long long n_packs;
101 unsigned long long n_unpacks;
102 unsigned long long n_unexpected;
103 unsigned long long n_rdvs;
104 unsigned long long n_rdvs_accept_small;
105 unsigned long long n_rdvs_accept_single;
106 unsigned long long n_rdvs_accept_split;
107 unsigned long long n_pw_split;
108 unsigned long long n_pw_out;
109 unsigned long long n_pw_in;
110 unsigned long long n_try_and_commit;
111 unsigned long long n_strat_apply;
112 unsigned long long n_outoforder_event;
113 unsigned long long n_event_queue_full;
114 unsigned long long n_packs_partitioned;
115 unsigned long long n_send_data_copy;
116 unsigned long long n_recv_data_copy;
117 unsigned long max_unpacks;
118 unsigned long max_packs;
119 unsigned long long n_memory_host;
120 unsigned long long n_memory_managed;
121 unsigned long long n_memory_unregistered;
122 unsigned long long n_memory_device;
123 } profiling;
124#endif /* NMAD_PROFILE */
125};
126
127#endif /* NM_CORE_H */
enum nm_thread_level_e nm_thread_level_t
PUK_LFQUEUE_NOTHREAD_TYPE(nm_core_task, struct nm_core_task_s *, NULL, NM_CORE_TASK_QUEUE_SIZE)
lfqueue for pending tasks
PUK_LFQUEUE_TYPE(nm_pkt_wrap, struct nm_pkt_wrap_s *, NULL, 512)
LF queue type for completed pw.
#define NM_CORE_TASK_QUEUE_SIZE
size of the queue to submit core tasks
asynchronous tasks for nmad core.
Core NewMadeleine structure.
Definition nm_core.h:43
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
int enable_pwsend_timeout
Definition nm_core.h:89
struct nm_core_dispatching_event_allocator_s dispatching_event_allocator
allocator for elements of above list
Definition nm_core.h:83
puk_context_t strategy_context
global context of the strategy
Definition nm_core.h:60
int enable_send_prefetch
whether to prefetch large messages for send while rdv is in progress
Definition nm_core.h:90
struct nm_trk_hashtable_s trk_table
trk table hashed by component status; used for reverse lookup
Definition nm_core.h:80
int n_unpacks
number of pending packs & unpacks
Definition nm_core.h:74
nm_thread_level_t thread_level
Definition nm_core.h:45
int enable_recv_prefetch
whether to prefetch large messages for recv while rdv is in progress
Definition nm_core.h:91
uint64_t unpack_seq
next sequence number for unpacks
Definition nm_core.h:73
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
int enable_gpu_support
whether GPU support is enabled
Definition nm_core.h:92
int nb_drivers
number of drivers in drivers list
Definition nm_core.h:65
struct nm_matching_wildcard_table_s wildcard_table
matching info for wildcard requests
Definition nm_core.h:76
nm_spinlock_t dispatching_lock
lock for dispatching of events
Definition nm_core.h:84
struct nm_core_monitor_vect_s monitors
monitors for upper layers to track events in nmad core
Definition nm_core.h:77
int enable_isend_csum
check message integrity between isend submission & completion
Definition nm_core.h:88
nm_spinlock_t lock
lock to protect req lists in core
Definition nm_core.h:44
struct nm_pw_nohd_allocator_s pw_nohd_allocator
allocator for header-less pw
Definition nm_core.h:71
int enable_auto_flush
automatic flush after each pack_submit
Definition nm_core.h:87
struct nm_active_gate_list_s active_gates
list of gates with active requests
Definition nm_core.h:78
struct nm_pkt_wrap_list_s prefetch_large_send
large packets to prefetch
Definition nm_core.h:53
int n_packs
Definition nm_core.h:74
struct nm_matching_tag_table_s tag_table
matching infor for requests with tag (and any gate)
Definition nm_core.h:75
struct nm_drv_list_s driver_list
list of drivers.
Definition nm_core.h:64
struct nm_gate_list_s gate_list
list of gates.
Definition nm_core.h:63
struct nm_core_dispatching_event_lfqueue_s dispatching_events
queue for events to dispatch
Definition nm_core.h:82
const struct nm_strategy_iface_s * strategy_iface
interface of the selected strategy
Definition nm_core.h:61
int enable_schedopt
whether schedopt is enabled atop drivers
Definition nm_core.h:86
puk_component_t strategy_component
component for the selected strategy
Definition nm_core.h:59
struct nm_pw_poll_list_s pw_poll_list
active pw for send/recv to poll
Definition nm_core.h:51
struct nm_pw_buf_allocator_s pw_buf_allocator
allocator for pw with contiguous buffer
Definition nm_core.h:72
Driver for 'NewMad_Strategy' component interface.
Definition nm_strategy.h:22