NewMadeleine

Documentation

« back to PM2 home.
nm_colldrv.h
Go to the documentation of this file.
1/*
2 * NewMadeleine
3 * Copyright (C) 2026 (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#ifndef NM_COLLDRV_H
17#define NM_COLLDRV_H
18
19#include <nm_public.h>
20#include <nm_core_interface.h>
21#include <Padico/Puk.h>
22
23
24/* ********************************************************* */
25/* ** coll driver interface */
26
27typedef void (*nm_colldrv_req_notifier_t)(void*ref);
28
59
68
70{
71 /* ** init */
72 void (*getprops)(puk_context_t context, struct nm_coll_driver_properties_s*p_props);
73 void (*init)(puk_context_t context);
74 void (*finalize)(puk_context_t context);
75 /* ** collectives */
76 void (*buf_get)(puk_context_t context, struct nm_colldrv_req_s*p_colldrv_req);
77 void (*buf_release)(puk_context_t context, struct nm_colldrv_req_s*p_colldrv_req);
78 void (*dispatch)(puk_context_t context, struct nm_colldrv_req_s*p_colldrv_req);
79 int (*poll)(puk_context_t context, struct nm_colldrv_req_s*p_colldrv_req);
80};
81PUK_IFACE_TYPE(NewMad_coll_driver, struct nm_coll_driver_interface_s);
82
83/* ********************************************************* */
84/* ** front-end */
85
93
94static inline void nm_colldrv_getprops(struct nm_colldrv_s*p_colldrv, struct nm_coll_driver_properties_s*p_props)
95{
96 (*p_colldrv->p_driver->getprops)(p_colldrv->p_context, p_props);
97}
98
99static inline void nm_colldrv_buf_get(struct nm_colldrv_s*p_colldrv, struct nm_colldrv_req_s*p_colldrv_req)
100{
101 (*p_colldrv->p_driver->buf_get)(p_colldrv->p_context, p_colldrv_req);
102}
103
104static inline void nm_colldrv_buf_release(struct nm_colldrv_s*p_colldrv, struct nm_colldrv_req_s*p_colldrv_req)
105{
106 (*p_colldrv->p_driver->buf_release)(p_colldrv->p_context, p_colldrv_req);
107}
108
109static inline void nm_colldrv_dispatch(struct nm_colldrv_s*p_colldrv, struct nm_colldrv_req_s*p_colldrv_req)
110{
111 (*p_colldrv->p_driver->dispatch)(p_colldrv->p_context, p_colldrv_req);
112}
113
114static inline int nm_colldrv_poll(struct nm_colldrv_s*p_colldrv, struct nm_colldrv_req_s*p_colldrv_req)
115{
116 return (*p_colldrv->p_driver->poll)(p_colldrv->p_context, p_colldrv_req);
117}
118
119#endif /* NM_COLLDRV_H */
void(* nm_colldrv_req_notifier_t)(void *ref)
Definition nm_colldrv.h:27
static void nm_colldrv_buf_get(struct nm_colldrv_s *p_colldrv, struct nm_colldrv_req_s *p_colldrv_req)
Definition nm_colldrv.h:99
static void nm_colldrv_buf_release(struct nm_colldrv_s *p_colldrv, struct nm_colldrv_req_s *p_colldrv_req)
Definition nm_colldrv.h:104
static void nm_colldrv_dispatch(struct nm_colldrv_s *p_colldrv, struct nm_colldrv_req_s *p_colldrv_req)
Definition nm_colldrv.h:109
static void nm_colldrv_getprops(struct nm_colldrv_s *p_colldrv, struct nm_coll_driver_properties_s *p_props)
Definition nm_colldrv.h:94
static int nm_colldrv_poll(struct nm_colldrv_s *p_colldrv, struct nm_colldrv_req_s *p_colldrv_req)
Definition nm_colldrv.h:114
PUK_IFACE_TYPE(NewMad_coll_driver, struct nm_coll_driver_interface_s)
This is the common public header for NewMad.
uint64_t nm_len_t
data length used by nmad
Definition nm_types.h:68
void(* getprops)(puk_context_t context, struct nm_coll_driver_properties_s *p_props)
Definition nm_colldrv.h:72
void(* buf_get)(puk_context_t context, struct nm_colldrv_req_s *p_colldrv_req)
Definition nm_colldrv.h:76
void(* dispatch)(puk_context_t context, struct nm_colldrv_req_s *p_colldrv_req)
Definition nm_colldrv.h:78
int(* poll)(puk_context_t context, struct nm_colldrv_req_s *p_colldrv_req)
Definition nm_colldrv.h:79
void(* finalize)(puk_context_t context)
Definition nm_colldrv.h:74
void(* init)(puk_context_t context)
Definition nm_colldrv.h:73
void(* buf_release)(puk_context_t context, struct nm_colldrv_req_s *p_colldrv_req)
Definition nm_colldrv.h:77
struct nm_coll_driver_properties_s::nm_coll_driver_capabilities_s capabilities
enum nm_colldrv_req_s::nm_colldrv_op_e op
void * p_notify_ref
ref passed to p_notify
Definition nm_colldrv.h:57
void * p_buf
buffer supplied by the driver
Definition nm_colldrv.h:50
struct nm_core_pollable_s pollable
hook to make this object pollable by the core
Definition nm_colldrv.h:34
int n_gates
length of p_gates array
Definition nm_colldrv.h:53
const struct nm_uuid_binary_s * p_group_uuid
UUID of the group.
Definition nm_colldrv.h:54
int root
index of root in p_gates
Definition nm_colldrv.h:38
nm_core_tag_t core_tag
Definition nm_colldrv.h:37
nm_len_t buf_len
length of the buffer
Definition nm_colldrv.h:51
void * p_drv_specific
Definition nm_colldrv.h:55
nm_colldrv_req_notifier_t p_notify
function called upon req termination
Definition nm_colldrv.h:56
nm_gate_t * p_gates
gates to run the collective on
Definition nm_colldrv.h:52
int self
index of self in p_gates
Definition nm_colldrv.h:39
struct nm_data_s data
user data
Definition nm_colldrv.h:49
@ NM_COLLDRV_OP_BARRIER
barrier
Definition nm_colldrv.h:44
@ NM_COLLDRV_OP_BCAST
bcast buffer to all nodes in group
Definition nm_colldrv.h:45
@ NM_COLLDRV_OP_WAITALL
wait all nodes in group
Definition nm_colldrv.h:43
struct nm_colldrv_s * p_colldrv
the colldrv managing this req
Definition nm_colldrv.h:36
struct nm_coll_driver_properties_s properties
Definition nm_colldrv.h:91
puk_context_t p_context
Definition nm_colldrv.h:89
const struct nm_coll_driver_interface_s * p_driver
Definition nm_colldrv.h:88
puk_component_t p_component
Definition nm_colldrv.h:90
An internal tag.
a data descriptor, used to pack/unpack data from app layout to/from contiguous buffers
Definition nm_data.h:200
Connection to another process.
Definition nm_gate.h:109
UUID in binary.
Definition nm_types.h:134