NewMadeleine

Documentation

nm_private.h
Go to the documentation of this file.
1/*
2 * NewMadeleine
3 * Copyright (C) 2006-2024 (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_PRIVATE_H
18#define NM_PRIVATE_H
19
26#include "nm_private_config.h"
27#include <Padico/Puk.h>
28#ifdef PIOMAN
29#include <pioman.h>
30#endif
31
32#if defined(PUKABI)
33#include <Padico/Puk-ABI.h>
34#endif /* PUKABI */
35#if defined(PUKABI_ENABLE_FSYS)
36#define NM_SYS(SYMBOL) PUK_ABI_FSYS_WRAP(SYMBOL)
37#else /* PUKABI_ENABLE_FSYS */
38#define NM_SYS(SYMBOL) SYMBOL
39#endif /* PUKABI_ENABLE_FSYS */
40
41#ifndef NMAD_BUILD
42# error "NMAD_BUILD flag not set while including nm_private.h. This header is not part of API and cannot be used outside of nmad."
43#endif /* NMAD_BUILD */
44
45#include <nm_public.h>
46#include <nm_core_interface.h>
47#include <nm_log.h>
48
49#include <nm_parameters.h>
50#include <nm_trace.h>
51
52#include <Padico/Module.h>
53
54#ifdef NMAD_HWLOC
55#include <hwloc.h>
56#endif
57
58#include <nm_core_private.h>
59#include <nm_tags.h>
60#include <nm_pkt_wrap.h>
61#include <nm_minidriver.h>
62#include <nm_drv.h>
63#include <nm_log.h>
64#ifdef PIOMAN
65#include <nm_piom_ltasks.h>
66#endif
67#include <nm_headers.h>
68#include <nm_strategy.h>
69#include <nm_gate.h>
70#include <nm_core.h>
71#include <nm_lock.h>
72
73#ifdef NMAD_PIOMAN
74# define NMAD_CONFIG_PIOMAN 1
75#else
76# define NMAD_CONFIG_PIOMAN 0
77#endif
78
79#ifdef NMAD_HWLOC
80# define NMAD_CONFIG_HWLOC 1
81#else
82# define NMAD_CONFIG_HWLOC 0
83#endif
84
85#ifdef NMAD_PUKABI
86# define NMAD_CONFIG_PUKABI 1
87#else
88# define NMAD_CONFIG_PUKABI 0
89#endif
90
91#ifdef NMAD_DEBUG
92# define NMAD_CONFIG_DEBUG 1
93#else
94# define NMAD_CONFIG_DEBUG 0
95#endif
96
97#ifdef NDEBUG
98# define NMAD_CONFIG_NDEBUG 1
99#else
100# define NMAD_CONFIG_NDEBUG 0
101#endif
102
103#ifdef NMAD_SIMGRID
104# define NMAD_CONFIG_SIMGRID 1
105#else
106# define NMAD_CONFIG_SIMGRID 0
107#endif
108
109#define _tostring2(s) #s
110#define _tostring(s) _tostring2(s)
111
112#define NMAD_CONFIG_STRING \
113 " pioman = " _tostring(NMAD_CONFIG_PIOMAN) \
114 " hwloc = " _tostring(NMAD_CONFIG_HWLOC) \
115 " pukabi = " _tostring(NMAD_CONFIG_PUKABI) \
116 " debug = " _tostring(NMAD_CONFIG_DEBUG) \
117 " ndebug = " _tostring(NMAD_CONFIG_NDEBUG) \
118 " simgrid = " _tostring(NMAD_CONFIG_SIMGRID)
119
120
121/* ** core ************************************************* */
122
124
126
127__PUK_SYM_INTERNAL
128void nm_core_driver_flush(struct nm_core*p_core);
129
130__PUK_SYM_INTERNAL
131void nm_core_driver_connect_wait_all(struct nm_core*p_core, struct nm_drv_s*p_drv);
132
133__PUK_SYM_INTERNAL
135
136__PUK_SYM_INTERNAL
138
139__PUK_SYM_INTERNAL
141
142__PUK_SYM_INTERNAL
143void nm_core_status_event(nm_core_t p_core, const struct nm_core_event_s*const p_event, struct nm_req_s*p_req);
144
145__PUK_SYM_INTERNAL
147
148__PUK_SYM_INTERNAL
149void nm_so_schedule_clean(struct nm_core*p_core);
150
151__PUK_SYM_INTERNAL
152void nm_core_progress(struct nm_core*p_core);
153
154__PUK_SYM_INTERNAL
155void nm_core_task_flush(struct nm_core*p_core);
156
157__PUK_SYM_INTERNAL
159
160__PUK_SYM_INTERNAL
162
163__PUK_SYM_INTERNAL
165
166__PUK_SYM_INTERNAL
167void nm_core_matching_check(struct nm_core*p_core);
168
169void nm_core_unpack_trigger_next(struct nm_core*p_core, struct nm_core_task_s*p_core_task);
170
171/* ** packet wrappers ************************************** */
172
173__PUK_SYM_INTERNAL
175
176__PUK_SYM_INTERNAL
178
180
182
184
185__PUK_SYM_INTERNAL
187
189
191
192__PUK_SYM_INTERNAL
194
195__PUK_SYM_INTERNAL
197
198__PUK_SYM_INTERNAL
200
201__PUK_SYM_INTERNAL
203
204__PUK_SYM_INTERNAL
206
209void nm_pw_process_complete_send(struct nm_core*p_core, struct nm_pkt_wrap_s*p_pw);
210
213void nm_pw_process_complete_recv(struct nm_core*p_core, struct nm_pkt_wrap_s*p_pw);
214
215__PUK_SYM_INTERNAL
216void nm_rtr_handler(struct nm_pkt_wrap_s*p_rtr_pw, const struct nm_header_ctrl_rtr_s*p_header);
217
218/* ** data ************************************************* */
219
222 const struct nm_data_s*p_data, nm_len_t chunk_offset, nm_len_t chunk_len, uint8_t flags);
223
225void nm_data_pkt_unpack(const struct nm_data_s*p_data, const struct nm_header_pkt_data_s*h, const struct nm_pkt_wrap_s*p_pw,
227
228#include "nm_core_inline.h"
229#include "nm_tactics.h"
230#include "nm_sampling.h"
231
234#endif /* NM_PRIVATE_H */
__PUK_SYM_INTERNAL void nm_core_gate_disconnected(struct nm_core *p_core, nm_gate_t p_gate, nm_drv_t p_drv)
__PUK_SYM_INTERNAL void nm_core_driver_flush(struct nm_core *p_core)
void nm_pw_send_poll(struct nm_pkt_wrap_s *p_pw)
__PUK_SYM_INTERNAL void nm_core_status_event(nm_core_t p_core, const struct nm_core_event_s *const p_event, struct nm_req_s *p_req)
__PUK_SYM_INTERNAL void nm_pw_send_unfetch(struct nm_pkt_wrap_s *p_pw)
__PUK_SYM_INTERNAL void nm_core_driver_connect_wait_all(struct nm_core *p_core, struct nm_drv_s *p_drv)
void nm_data_pkt_unpack(const struct nm_data_s *p_data, const struct nm_header_pkt_data_s *h, const struct nm_pkt_wrap_s *p_pw, nm_len_t chunk_offset, nm_len_t chunk_len)
unpack from pkt format to data format
__PUK_SYM_INTERNAL void nm_pw_recv_wait(struct nm_pkt_wrap_s *p_pw)
__PUK_SYM_INTERNAL void nm_pw_recv_progress(struct nm_pkt_wrap_s *p_pw)
void nm_pw_process_complete_send(struct nm_core *p_core, struct nm_pkt_wrap_s *p_pw)
Process a complete successful outgoing request.
__PUK_SYM_INTERNAL void nm_core_driver_close(struct nm_drv_s *p_drv)
__PUK_SYM_INTERNAL void nm_core_matching_check(struct nm_core *p_core)
void nm_pw_process_complete_recv(struct nm_core *p_core, struct nm_pkt_wrap_s *p_pw)
Process complete incoming request.
__PUK_SYM_INTERNAL void nm_rtr_handler(struct nm_pkt_wrap_s *p_rtr_pw, const struct nm_header_ctrl_rtr_s *p_header)
__PUK_SYM_INTERNAL void nm_core_driver_destroy(struct nm_drv_s *p_drv)
__PUK_SYM_INTERNAL void nm_so_schedule_clean(struct nm_core *p_core)
void nm_core_post_send(struct nm_pkt_wrap_s *p_pw, nm_gate_t p_gate, nm_trk_id_t trk_id)
void nm_pw_send_post(struct nm_pkt_wrap_s *p_pw)
void nm_pw_send_trigger(struct nm_pkt_wrap_s *p_pw)
__PUK_SYM_INTERNAL void nm_core_progress(struct nm_core *p_core)
__PUK_SYM_INTERNAL void nm_pw_recv_prefetch(struct nm_pkt_wrap_s *p_pw)
__PUK_SYM_INTERNAL void nm_core_task_flush(struct nm_core *p_core)
__PUK_SYM_INTERNAL void nm_pw_send_wait(struct nm_pkt_wrap_s *p_pw)
__PUK_SYM_INTERNAL void nm_pw_send_progress(struct nm_pkt_wrap_s *p_pw)
void nm_core_unpack_trigger_next(struct nm_core *p_core, struct nm_core_task_s *p_core_task)
void nm_pw_send_complete_default(struct nm_pkt_wrap_s *p_pw)
__PUK_SYM_INTERNAL void nm_core_events_dispatch(struct nm_core *p_core)
void nm_core_post_recv(struct nm_pkt_wrap_s *p_pw, nm_gate_t p_gate, nm_trk_id_t trk_id, nm_drv_t p_drv)
__PUK_SYM_INTERNAL void nm_drv_refill_recv(nm_drv_t p_drv, nm_gate_t p_gate)
__PUK_SYM_INTERNAL void nm_pw_send_prefetch(struct nm_pkt_wrap_s *p_pw)
__PUK_SYM_INTERNAL void nm_core_gate_disconnect(struct nm_gate_s *p_gate)
void nm_pw_send_post_default(struct nm_pkt_wrap_s *p_pw)
void nm_data_pkt_pack(struct nm_pkt_wrap_s *p_pw, nm_core_tag_t tag, nm_seq_t seq, const struct nm_data_s *p_data, nm_len_t chunk_offset, nm_len_t chunk_len, uint8_t flags)
pack data from nm_data format to pkt format
__PUK_SYM_INTERNAL void nm_core_gate_destroy(struct nm_gate_s *p_gate)
__PUK_SYM_INTERNAL void nm_pw_recv_unfetch(struct nm_pkt_wrap_s *p_pw)
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
Definition for nmad core.
Inline functions for nmad core.
nm_tag_t tag
the user-supplied tag
Private definitions for nmad core.
static nm_gate_t p_gate
nm_len_t chunk_len
length of this chunk
Definition: nm_headers.h:4
nm_trk_id_t trk_id
index of the track relative to the gate
Definition: nm_headers.h:3
nm_len_t chunk_offset
offset of the enclosed chunk
Definition: nm_headers.h:4
nm_seq_t seq
sequence number
Definition: nm_headers.h:2
Locking interface used in nm core.
Basic primitives to display info & warnings.
Definition of the driver interface.
nm_onesided_flag_t flags
This is the internal interface for packet wrappers, bellow the scheduler.
This is the common public header for NewMad.
Tactics i.e.
Private definitions for managing tags and structures indexed by tags.
Definitions for traces.
int8_t nm_trk_id_t
ID of a track, assigned in order.
Definition: nm_types.h:88
uint64_t nm_len_t
data length used by nmad
Definition: nm_types.h:70
uint32_t nm_seq_t
Sequence number for packets on a given gate/tag.
Definition: nm_types.h:104
An event, generated by the NewMad core.
An internal tag.
asynchronous tasks for nmad core.
Core NewMadeleine structure.
Definition: nm_core.h:39
a data descriptor, used to pack/unpack data from app layout to/from contiguous buffers
Definition: nm_data.h:189
Driver.
Definition: nm_drv.h:29
Connection to another process.
Definition: nm_gate.h:100
Internal packet wrapper.
Definition: nm_pkt_wrap.h:117
a generic pack/unpack request