NewMadeleine

Documentation

« back to PM2 home.
nm_coll_dynamic_private.h
Go to the documentation of this file.
1/*
2 * NewMadeleine
3 * Copyright (C) 2019-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_COLL_PRIVATE_H
17#define NM_COLL_PRIVATE_H
18
20#include <nm_rpc_interface.h>
22
23#ifdef PIOMAN
24
26struct multicast_header_s
27{
28 nm_len_t body_len; // See (struct nm_multicast_req_s).body_len
29 int nb_nodes;
30 int src_node;
31} __attribute__((packed));
32
33
34enum nm_multicast_req_type_e
35 {
36 UNSPECIFIED, // Error !
37 PENDING, // I'm the pending recv: the recv always posted to receive broadcast messages which have not matching user recv
38 USER_RECV, // I'm the recv posted by the user
39 INITIAL_SEND, // I'm the node which called nm_coll_dynamic_send*() and this is my first send
40 FORWARD_INITIAL, // I'm the node which called nm_coll_dynamic_send*(), but it's not my first send
41 FORWARD_RECV // I received data from a broadcast, and I'm forwarding it to other nodes
42 };
43
44
46struct nm_multicast_req_s
47{
48 /* Common attributes for send and recv requests: */
49 nm_sr_request_t*request;
51 struct nm_data_s body_data;
52 int*ref_nodes;
53 int*ref_prios;
54 struct multicast_header_s*ref_header;
56
57 /* Attributes for recv requests: */
58 int src_node;
59 void (*come_from_coop_callback)(struct nm_data_s*, nm_len_t, void*);
60 void*come_from_coop_callback_arg;
61 void (*end_recv_callback)(void*);
62 void*end_recv_callback_arg;
63 void (*normal_recv_recv_data_callback)(nm_sr_request_t*, void*);
64 void*normal_recv_recv_data_callback_arg;
65 piom_cond_t*cond_wait_recv;
66 struct nm_data_s header_data;
67 struct nm_data_s multicast_data;
68 nm_rpc_token_t rpc_token;
69 void*copied_data_ptr;
73 /* Attributes for send requests: */
74 int last;
76 int nb_nodes_in_tree;
77 int tree_step;
78 int tree_additionnal_info;
79 nm_len_t body_len;
84 struct nm_multicast_req_s*initial_recv;
86 void (*end_send_callback)(void*);
87 void*end_send_callback_arg;
88
89 enum nm_multicast_req_type_e type;
90};
91
92PUK_ALLOCATOR_TYPE(nm_multicast_req, struct nm_multicast_req_s);
93
94void free_request_nodes_data(struct nm_multicast_req_s*p_req);
95void send_multicast(int*nodes, int*prios, int nb_nodes, nm_tag_t tag, struct nm_data_s*data,
96 nm_len_t body_len, int tree_step, int separator_id, int src_node,
97 struct nm_multicast_req_s*initial_recv, callback_function end_send_callback, void*arg);
98
99void monitor_send(nm_rpc_req_t rpc_req, void*_ref);
100void normal_receive_handler(nm_sr_event_t event, const nm_sr_event_info_t*p_info, void*_ref);
101void register_recv_data(nm_session_t p_session, int src_node, nm_tag_t tag, struct nm_data_s*data,
102 nm_len_t len, nm_sr_request_t *p_request, piom_cond_t*cond_wait_recv,
103 callback_function_come_from_coop come_from_coop_callback, callback_function end_recv_callback,
104 callback_function_normal_recv normal_recv_callback, void*arg);
105
106
107#else /* PIOMAN */
108# error "cannot use interface coll_dynamic without pioman"
109#endif /* PIOMAN */
110
111#endif /* NM_COLL_PRIVATE_H */
struct nm_core_event_s __attribute__
Definition nm_data.h:539
nm_sr_event_t
events for monitors
nm_tag_t tag
the user-supplied tag
nm_len_t len
Definition nm_data.h:1007
static nm_session_t p_session
PUK_ALLOCATOR_TYPE(nm_sr_req, nm_sr_request_t)
uint64_t nm_tag_t
user tags, 64 bits, contained in indirect hashtable
Definition nm_types.h:56
uint64_t nm_len_t
data length used by nmad
Definition nm_types.h:68
a data descriptor, used to pack/unpack data from app layout to/from contiguous buffers
Definition nm_data.h:200
an outgoing rpc request
an incoming rpc request
internal defintion of the sendrecv request
information field for sendrecv events