NewMadeleine

Documentation

« back to PM2 home.
nm_coll.h
Go to the documentation of this file.
1/*
2 * NewMadeleine
3 * Copyright (C) 2014-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
21#include <nm_public.h>
23#include <Padico/Puk.h>
24
55/* ** communicator-based collectives *********************** */
56
58
59extern void nm_coll_bcast(nm_comm_t comm, int root, void*buffer, nm_len_t len, nm_tag_t tag);
60
61extern void nm_coll_scatter(nm_comm_t comm, int root, const void*sbuf, nm_len_t slen, void*rbuf, nm_len_t rlen, nm_tag_t tag);
62
63extern void nm_coll_gather(nm_comm_t comm, int root, const void*sbuf, nm_len_t slen, void*rbuf, nm_len_t rlen, nm_tag_t tag);
64
65extern void nm_coll_allgather(nm_comm_t comm, const void*sbuf, nm_len_t slen, void*rbuf, nm_len_t rlen, nm_tag_t tag);
66
67/* ** group-based collectives ****************************** */
68
71
73
75 void*buffer, nm_len_t len, nm_tag_t tag);
76
78 const void*sbuf, nm_len_t slen, void*rbuf, nm_len_t rlen, nm_tag_t tag);
79
81 const void*sbuf, nm_len_t slen, void*rbuf, nm_len_t rlen, nm_tag_t tag);
82
84 const void*sbuf, nm_len_t slen, void*rbuf, nm_len_t rlen, nm_tag_t tag);
85
86/* ** data-based collectives ******************************* */
87
89
92extern void nm_coll_data_scatter(nm_comm_t p_comm, int root, struct nm_data_s*p_sdata, struct nm_data_s*p_rdata, nm_tag_t tag);
93
96extern void nm_coll_data_gather(nm_comm_t p_comm, int root, struct nm_data_s*p_sdata, struct nm_data_s*p_rdata, nm_tag_t tag);
97
98extern void nm_coll_data_allgather(nm_comm_t comm, struct nm_data_s*p_sdata, struct nm_data_s*p_rdata, nm_tag_t tag);
99
100/* ** group + data collectives ***************************** */
101
103 struct nm_data_s*p_data, nm_tag_t tag);
104
106 struct nm_data_s*p_sdata, struct nm_data_s*p_rdata, nm_tag_t tag);
107
109 struct nm_data_s*p_sdata, struct nm_data_s*p_rdata, nm_tag_t tag);
110
114 struct nm_data_s*p_sdata, struct nm_data_s*p_rdata, nm_tag_t tag);
115
118/* ** non-blocking collectives ***************************** */
119
120
121/* ** coll reqs */
122
127
131typedef void (*nm_coll_req_notifier_t)(void*ref);
132
138
140
141/* ** ibcast */
142
146
151
156
161
162/* ** ibarrier */
163
166
169
170/* ** iscatter */
171
172extern struct nm_coll_req_s*nm_coll_iscatter(nm_comm_t comm, int root, const void*sbuf, nm_len_t slen,
173 void*rbuf, nm_len_t rlen, nm_tag_t tag,
175
177 const void*sbuf, nm_len_t slen,
178 void*rbuf, nm_len_t rlen, nm_tag_t tag,
180
182 struct nm_data_s*p_sdata, struct nm_data_s*p_rdata, nm_tag_t tag,
184
185/* ** igather */
186
187extern struct nm_coll_req_s*nm_coll_igather(nm_comm_t comm, int root, const void*sbuf, nm_len_t slen,
188 void*rbuf, nm_len_t rlen, nm_tag_t tag,
190
192 const void*sbuf, nm_len_t slen,
193 void*rbuf, nm_len_t rlen, nm_tag_t tag,
195
197 struct nm_data_s*p_sdata, struct nm_data_s*p_rdata, nm_tag_t tag,
199
200/* ** iallgather */
201
202extern struct nm_coll_req_s*nm_coll_iallgather(nm_comm_t comm, const void*sbuf, nm_len_t slen, void*rbuf, nm_len_t rlen, nm_tag_t tag,
204
206 const void*sbuf, nm_len_t slen, void*rbuf, nm_len_t rlen, nm_tag_t tag,
208
210 struct nm_data_s*p_sdata, struct nm_data_s*p_rdata, nm_tag_t tag,
212
213/* ** specific operations */
214
216 struct nm_data_s*p_data, nm_tag_t tag1, nm_tag_t tag2, nm_len_t block_size, nm_coll_tree_kind_t kind);
217
218
struct nm_coll_req_s * nm_coll_group_iscatter(nm_session_t p_session, nm_group_t p_group, int root, const void *sbuf, nm_len_t slen, void *rbuf, nm_len_t rlen, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *p_ref)
struct nm_coll_req_s * nm_coll_group_data_iallgather(nm_session_t p_session, nm_group_t p_group, struct nm_data_s *p_sdata, struct nm_data_s *p_rdata, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *p_ref)
void nm_coll_data_allgather(nm_comm_t comm, struct nm_data_s *p_sdata, struct nm_data_s *p_rdata, nm_tag_t tag)
struct nm_coll_req_s * nm_coll_ibcast_pipeline(nm_session_t p_session, nm_group_t p_group, int root, struct nm_data_s *p_data, nm_tag_t tag, nm_len_t block_size, nm_coll_tree_kind_t kind, nm_coll_req_notifier_t p_notify, void *ref)
ibcast with pipelined algorithm; for internal use
void nm_coll_gather(nm_comm_t comm, int root, const void *sbuf, nm_len_t slen, void *rbuf, nm_len_t rlen, nm_tag_t tag)
struct nm_coll_req_s * nm_coll_ibcast(nm_comm_t p_comm, int root, void *buffer, nm_len_t len, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *ref)
generic ibcast on communicator with contiguous data, with automatic algorithm selection
void nm_coll_group_gather(nm_session_t p_session, nm_group_t p_group, int root, const void *sbuf, nm_len_t slen, void *rbuf, nm_len_t rlen, nm_tag_t tag)
void nm_coll_barrier(nm_comm_t comm, nm_tag_t tag)
void nm_coll_group_allgather(nm_session_t p_session, nm_group_t p_group, const void *sbuf, nm_len_t slen, void *rbuf, nm_len_t rlen, nm_tag_t tag)
void nm_coll_data_bcast(nm_comm_t comm, int root, struct nm_data_s *p_data, nm_tag_t tag)
struct nm_coll_req_s * nm_coll_iscatter(nm_comm_t comm, int root, const void *sbuf, nm_len_t slen, void *rbuf, nm_len_t rlen, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *ref)
void nm_coll_group_data_scatter(nm_session_t p_session, nm_group_t p_group, int root, struct nm_data_s *p_sdata, struct nm_data_s *p_rdata, nm_tag_t tag)
struct nm_coll_req_s * nm_coll_group_igather(nm_session_t p_session, nm_group_t p_group, int root, const void *sbuf, nm_len_t slen, void *rbuf, nm_len_t rlen, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *p_ref)
void nm_coll_group_data_bcast(nm_session_t p_session, nm_group_t p_group, int root, struct nm_data_s *p_data, nm_tag_t tag)
struct nm_coll_req_s * nm_coll_ibcast_tree(nm_session_t p_session, nm_group_t p_group, int root, struct nm_data_s *p_data, nm_tag_t tag, nm_coll_tree_kind_t kind, nm_coll_req_notifier_t p_notify, void *ref)
ibcast with tree algorithm; for internal use
void(* nm_coll_req_notifier_t)(void *ref)
notification function for collective reqs
Definition nm_coll.h:131
void nm_coll_scatter(nm_comm_t comm, int root, const void *sbuf, nm_len_t slen, void *rbuf, nm_len_t rlen, nm_tag_t tag)
struct nm_coll_req_s * nm_coll_ibarrier(nm_comm_t p_comm, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *ref)
void nm_coll_group_bcast(nm_session_t p_session, nm_group_t p_group, int root, void *buffer, nm_len_t len, nm_tag_t tag)
struct nm_coll_req_s * nm_coll_group_data_iscatter(nm_session_t p_session, nm_group_t p_group, int root, struct nm_data_s *p_sdata, struct nm_data_s *p_rdata, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *p_ref)
void nm_coll_group_scatter(nm_session_t p_session, nm_group_t p_group, int root, const void *sbuf, nm_len_t slen, void *rbuf, nm_len_t rlen, nm_tag_t tag)
void nm_coll_group_barrier(nm_session_t p_session, nm_group_t p_group, nm_tag_t tag)
struct nm_coll_req_s * nm_coll_group_data_igather(nm_session_t p_session, nm_group_t p_group, int root, struct nm_data_s *p_sdata, struct nm_data_s *p_rdata, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *p_ref)
struct nm_coll_req_s * nm_coll_group_iallgather(nm_session_t p_session, nm_group_t p_group, const void *sbuf, nm_len_t slen, void *rbuf, nm_len_t rlen, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *p_ref)
void nm_coll_group_data_allgather(nm_session_t p_session, nm_group_t p_group, struct nm_data_s *p_sdata, struct nm_data_s *p_rdata, nm_tag_t tag)
allgather using nm_data; on all nodes, p_rdata will contain all data for all processes.
void nm_coll_allgather(nm_comm_t comm, const void *sbuf, nm_len_t slen, void *rbuf, nm_len_t rlen, nm_tag_t tag)
struct nm_coll_req_s * nm_coll_iallgather(nm_comm_t comm, const void *sbuf, nm_len_t slen, void *rbuf, nm_len_t rlen, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *p_ref)
struct nm_coll_req_s * nm_coll_igather(nm_comm_t comm, int root, const void *sbuf, nm_len_t slen, void *rbuf, nm_len_t rlen, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *ref)
void nm_coll_data_gather(nm_comm_t p_comm, int root, struct nm_data_s *p_sdata, struct nm_data_s *p_rdata, nm_tag_t tag)
gather using nm_data; on root, p_rdata will contain all data for all processes.
void nm_coll_bcast_2trees(nm_session_t p_session, nm_group_t p_group, int root, struct nm_data_s *p_data, nm_tag_t tag1, nm_tag_t tag2, nm_len_t block_size, nm_coll_tree_kind_t kind)
void nm_coll_group_data_gather(nm_session_t p_session, nm_group_t p_group, int root, struct nm_data_s *p_sdata, struct nm_data_s *p_rdata, nm_tag_t tag)
void nm_coll_data_scatter(nm_comm_t p_comm, int root, struct nm_data_s *p_sdata, struct nm_data_s *p_rdata, nm_tag_t tag)
scatter using nm_data; p_sdata must contain all data for all processes.
struct nm_coll_req_s * nm_coll_req_t
a request for a non-blocking collective
Definition nm_coll.h:126
void nm_coll_req_wait(struct nm_coll_req_s *p_coll_req)
void nm_coll_group_wait(nm_session_t p_session, nm_group_t p_group, int root, nm_tag_t tag)
root waits for all nodes; equivalent to half-barrier or gather without data
struct nm_coll_req_s * nm_coll_group_ibarrier(nm_session_t p_session, nm_group_t p_group, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *ref)
struct nm_coll_req_s * nm_coll_group_data_ibcast(nm_session_t p_session, nm_group_t p_group, int root, struct nm_data_s *p_data, nm_tag_t tag, nm_coll_req_notifier_t p_notify, void *ref)
generic ibcast on group+data with automatic algorithm selection
void nm_coll_bcast(nm_comm_t comm, int root, void *buffer, nm_len_t len, nm_tag_t tag)
int nm_coll_req_test(struct nm_coll_req_s *p_coll_req)
struct nm_group_s * nm_group_t
type for groups
Definition nm_group.h:38
enum nm_coll_tree_kind_e nm_coll_tree_kind_t
nm_tag_t tag
the user-supplied tag
nm_data_propertie_gpu_preinit & p_data
Definition nm_data.h:538
static nm_comm_t p_comm
static nm_session_t p_session
uint16_t len
chunk len
Definition nm_headers.h:0
int root
const void * sbuf
pointer for sending
void * rbuf
pointer used for receiving
struct nm_coll_req_s * p_coll_req
non-blocking nmad native collective
This is the common public header for NewMad.
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
nm_coll_req_notifier_t p_notify
notification function for op termination
nm_coll_req_kind_t kind
void * p_ref
reference given to above p_notify
a data descriptor, used to pack/unpack data from app layout to/from contiguous buffers
Definition nm_data.h:199