Realm
A distributed, event-based tasking library
Loading...
Searching...
No Matches
activemsg.h
Go to the documentation of this file.
1/*
2 * Copyright 2025 Stanford University, NVIDIA Corporation
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18// hopefully a more user-friendly C++ template wrapper for GASNet active
19// messages...
20
21#ifndef ACTIVEMSG_H
22#define ACTIVEMSG_H
23
24#include "realm/realm_config.h"
26#include "realm/mutex.h"
27#include "realm/serialize.h"
28#include "realm/nodeset.h"
29#include "realm/network.h"
30#include "realm/atomics.h"
31#include "realm/threads.h"
32#include "realm/bgwork.h"
33#include <atomic>
34#include <cstddef>
35#include <limits>
36#include <type_traits>
37#include <mutex>
38#include <vector>
39
40#include <optional>
41
42namespace Realm {
43
44 namespace Config {
45 // if true, the number and min/max/avg/stddev duration of handler per
46 // message type is recorded and printed
48
49 // the maximum time we're willing to spend on inline message
50 // handlers
51 extern long long max_inline_message_time;
52 }; // namespace Config
53
54 enum
55 {
56 PAYLOAD_NONE, // no payload in packet
57 PAYLOAD_KEEP, // use payload pointer, guaranteed to be stable
58 PAYLOAD_FREE, // take ownership of payload, free when done
59 PAYLOAD_COPY, // make a copy of the payload
60 PAYLOAD_SRCPTR, // payload has been copied to the src data pool
61 PAYLOAD_PENDING, // payload needs to be copied, but hasn't yet
62 PAYLOAD_KEEPREG, // use payload pointer, AND it's registered!
63 PAYLOAD_EMPTY, // message can have payload, but this one is 0 bytes
64 };
65
66 class ActiveMessageImpl;
67
68 template <typename T, size_t INLINE_STORAGE = 256>
70 public:
71 // constructs an INACTIVE message object - call init(...) as needed
73
74 // construct a new active message for either a single recipient or a mask
75 // of recipients
76 // in addition to the header struct (T), a message can include a variable
77 // payload which can be delivered to a particular destination address
78 ActiveMessage(NodeID _target, size_t _max_payload_size = 0);
79 ActiveMessage(NodeID _target, size_t _max_payload_size,
80 const RemoteAddress &_dest_payload_addr);
81 ActiveMessage(const Realm::NodeSet &_targets, size_t _max_payload_size = 0);
82
83 // providing the payload (as a 1D reference, which must be PAYLOAD_KEEP)
84 // up front can avoid a copy if the source location is directly accessible
85 // by the networking hardware
86 // Per the semantics of PAYLOAD_KEEP, you must keep the payload buffer
87 // alive and unmodified until the call to commit or cancel returns
88 ActiveMessage(NodeID _target, const void *_data, size_t _datalen);
89 ActiveMessage(NodeID _target, const LocalAddress &_src_payload_addr, size_t _datalen,
90 const RemoteAddress &_dest_payload_addr);
91 ActiveMessage(const Realm::NodeSet &_targets, const void *_data, size_t _datalen);
92 ActiveMessage(NodeID _target, const LocalAddress &_src_payload_addr,
93 size_t _bytes_per_line, size_t _lines, size_t _line_stride,
94 const RemoteAddress &_dest_payload_addr);
95
97
98 // a version of `init` for each constructor above
99 void init(NodeID _target, size_t _max_payload_size = 0);
100 void init(NodeID _target, size_t _max_payload_size,
101 const RemoteAddress &_dest_payload_addr);
102 void init(const Realm::NodeSet &_targets, size_t _max_payload_size = 0);
103 void init(NodeID _target, const void *_data, size_t _datalen);
104 void init(NodeID _target, const LocalAddress &_src_payload_addr, size_t _datalen,
105 const RemoteAddress &_dest_payload_addr);
106 void init(const Realm::NodeSet &_targets, const void *_data, size_t _datalen);
107 void init(NodeID _target, const LocalAddress &_src_payload_addr,
108 size_t _bytes_per_line, size_t _lines, size_t _line_stride,
109 const RemoteAddress &_dest_payload_addr);
110
111 // large messages may need to be fragmented, so use cases that can
112 // handle the fragmentation at a higher level may want to know the
113 // largest size that is fragmentation-free - the answer can depend
114 // on whether the data is to be delivered to a known RemoteAddress
115 // and/or whether the source data location is known
116 // a call that sets `with_congestion` may get a smaller value (maybe
117 // even 0) if the path to the named target(s) is getting full
118 static size_t recommended_max_payload(NodeID target, bool with_congestion);
119 static size_t recommended_max_payload(const NodeSet &targets, bool with_congestion);
120 static size_t recommended_max_payload(NodeID target,
121 const RemoteAddress &dest_payload_addr,
122 bool with_congestion);
123 static size_t recommended_max_payload(NodeID target, const void *data,
124 size_t bytes_per_line, size_t lines,
125 size_t line_stride, bool with_congestion);
126 static size_t recommended_max_payload(const NodeSet &targets, const void *data,
127 size_t bytes_per_line, size_t lines,
128 size_t line_stride, bool with_congestion);
129 static size_t
130 recommended_max_payload(NodeID target, const LocalAddress &src_payload_addr,
131 size_t bytes_per_line, size_t lines, size_t line_stride,
132 const RemoteAddress &dest_payload_addr, bool with_congestion);
133
134 // operator-> gives access to the header structure
135 T *operator->(void);
136 T &operator*(void);
137
138 // variable payload can be written to in three ways:
139 // (a) Realm-style serialization (currently eager)
140 template <typename T2>
141 bool operator<<(const T2 &to_append);
142 // (b) old memcpy-like behavior (using the various payload modes)
143 void add_payload(const void *data, size_t datalen, int payload_mode = PAYLOAD_COPY);
144 void add_payload(const void *data, size_t bytes_per_line, size_t lines,
145 size_t line_stride, int payload_mode = PAYLOAD_COPY);
146 // (c) request for a pointer to write into (writes must be completed before
147 // call to commit or cancel)
148 void *payload_ptr(size_t datalen);
149
150 // register callbacks to be called upon:
151 // a) local completion - i.e. all source data has been read and can now
152 // be safely overwritten
153 // b) remote completion - message has been received AND HANDLED by target
154 //
155 // callbacks need to be "lightweight" - for heavier work, the message
156 // handler on the target can send an explicit response message
157 template <typename CALLABLE>
158 void add_local_completion(const CALLABLE &callable);
159 template <typename CALLABLE>
160 void add_remote_completion(const CALLABLE &callable);
161
162 // every active message must eventually be commit()'ed or cancel()'ed
163 void commit(void);
164 void cancel(void);
165
166 protected:
170 alignas(alignof(T) > alignof(uint64_t) ? alignof(T) : alignof(uint64_t)) uint64_t
171 inline_capacity[INLINE_STORAGE / sizeof(uint64_t)];
172
173 private:
174 // chunked-mode state: only used when the requested payload exceeds the
175 // network's hard limit for a single message
176 size_t network_max_payload_{0}; // 0 = normal (non-chunked) mode
177 NodeSet chunk_targets_;
178 const void *chunk_src_data_{nullptr};
179 size_t chunk_src_datalen_{0};
180 std::vector<std::byte>
181 chunk_alloc_; // owned buffer for network-allocated chunked mode
182
183 void init_chunked(NodeID _target, size_t _max_payload_size);
184 void init_chunked(const NodeSet &_targets, size_t _max_payload_size);
185 void init_chunked_data(NodeID _target, const void *_data, size_t _datalen);
186 void init_chunked_data(const NodeSet &_targets, const void *_data, size_t _datalen);
187 void commit_chunked(void);
188 static uint64_t next_chunk_message_id(NodeID node_id);
189 };
190
191 // type-erased wrappers for completion callbacks
193 public:
195 virtual void invoke() = 0;
196 virtual size_t size() const = 0;
197 virtual CompletionCallbackBase *clone_at(void *p) const = 0;
198
199 static const size_t ALIGNMENT = 8;
200
201 // helper functions for invoking/cloning/destroying a collection of callbacks
202 static void invoke_all(void *start, size_t bytes);
203 static void clone_all(void *dst, const void *src, size_t bytes);
204 static void destroy_all(void *start, size_t bytes);
205 };
206
207 template <typename CALLABLE>
209 public:
210 CompletionCallback(const CALLABLE &_callable);
211 virtual void invoke();
212 virtual size_t size() const;
213 virtual CompletionCallbackBase *clone_at(void *p) const;
214
215 protected:
216 CALLABLE callable;
217 };
218
219 // per-network active message implementations are mostly opaque, but a few
220 // fields are exposed to avoid virtual function calls
222 public:
224
225 // reserves space for a local/remote completion - caller will
226 // placement-new the completion at the provided address
227 virtual void *add_local_completion(size_t size) = 0;
228 virtual void *add_remote_completion(size_t size) = 0;
229
230 virtual void commit(size_t act_payload_size) = 0;
231 virtual void cancel() = 0;
232
236 };
237
239
242
244 void record(long long t_start, long long t_end);
245 };
246
248 uint32_t chunk_id{0};
249 uint32_t total_chunks{0};
250 uint64_t msg_id{0};
251 };
252
253 // singleton class that can convert message type->ID and ID->handler
255 public:
258
259 typedef unsigned short MessageID;
260 typedef void (*MessageHandler)(NodeID sender, const void *header, const void *payload,
261 size_t payload_size, TimeLimit work_until);
262 typedef void (*MessageHandlerNoTimeout)(NodeID sender, const void *header,
263 const void *payload, size_t payload_size);
264 typedef bool (*MessageHandlerInline)(NodeID sender, const void *header,
265 const void *payload, size_t payload_size,
266 TimeLimit work_until);
267
268 template <typename T>
270
272 void record_message_handler_call(MessageID id, long long t_start, long long t_end);
274
276
278
279 typedef unsigned TypeHash;
280
291
293
294 protected:
296
297 std::vector<HandlerEntry> handlers;
298 };
299
301
317
318 template <typename T, typename T2 = T>
320 public:
323
324 // when registering an active message handler, the following three methods
325 // are looked for in class T2
326 // (a) void handle_message(NodeID, const T&, const void *, size_t, TimeLimit)
327 // (b) void handle_message(NodeID, const T&, const void *, size_t)
328 // (c) bool handle_inline(NodeID, const T&, const void *, size_t, TimeLimit)
329 //
330 // at least one of (a) or (b) must be present, with (a) being preferred
331 //
332 // if (c) is present, it will be used to attempt inline handling of
333 // active messages as they arrive, with the following constraints:
334 // (i) the handler must not block on any mutexes (trylocks are ok)
335 // (ii) the handler must not perform dynamic memory allocation/frees
336 // (iii) the handler must try very hard to stay within the specified
337 // time limit
338 // if the inline handler is unable to satisfy these requirements, it should
339 // not attempt to handle the message, returning 'false' and letting it be
340 // queued as normal
341
342 // returns either the requested kind of handler or a null pointer if
343 // it doesn't exist
349
350 // this method does nothing, but can be called to force the instantiation
351 // of a handler registration object (needed when things are inside templates)
353 };
354
355 namespace ThreadLocal {
356 // this flag will be true when we are running a message handler
357 extern thread_local bool in_message_handler;
358 }; // namespace ThreadLocal
359
361 : public BackgroundWorkItem {
362 public:
363 IncomingMessageManager(int _nodes, int _dedicated_threads,
366
367 typedef uintptr_t CallbackData;
368 typedef void (*CallbackFnptr)(NodeID, CallbackData, CallbackData);
369
370 // adds an incoming message to the queue
371 // returns true if the call was handled immediately (in which case the
372 // callback, if present, will NOT be called), or false if the message
373 // will be processed later
375 const void *hdr, size_t hdr_size, int hdr_mode,
376 const void *payload, size_t payload_size, int payload_mode,
377 CallbackFnptr callback_fnptr, CallbackData callback_data1,
378 CallbackData callback_data2, TimeLimit work_until);
379
380 void start_handler_threads(size_t stack_size);
381
382 // stalls caller until all incoming messages have been handled (and at
383 // least 'min_messages_handled' in total)
384 void drain_incoming_messages(size_t min_messages_handled);
385
386 void shutdown(void);
387
388 virtual bool do_work(TimeLimit work_until);
389
391
392 protected:
393 struct MessageBlock;
394
409
411 static MessageBlock *new_block(size_t _total_size);
412 static void free_block(MessageBlock *block);
413
414 void reset();
415
416 // called with message manager lock held
417 Message *append_message(size_t hdr_bytes_needed, size_t payload_bytes_needed);
418
419 // called _without_ message manager lock held
421
422 size_t total_size, size_used;
425 };
426
427 int get_messages(Message *&head, Message **&tail, bool wait);
428 bool return_messages(int sender, size_t num_handled, Message *head, Message **tail);
429
430 int nodes, dedicated_threads, sleeper_count;
436 int *todo_list; // list of nodes with non-empty message lists
437 int todo_oldest, todo_newest;
443 Mutex::CondVar condvar, drain_condvar;
445 std::vector<Thread *> handler_threads;
449 size_t cfg_max_available_blocks, cfg_message_block_size;
450
451 struct PairHash {
452 std::size_t operator()(const std::pair<NodeID, uint64_t> &p) const
453 {
454 return std::hash<NodeID>()(p.first) ^ (std::hash<uint64_t>()(p.second) << 1);
455 }
456 };
457
458 std::unordered_map<std::pair<NodeID, uint64_t>, std::unique_ptr<FragmentedMessage>,
459 PairHash>
461 };
462
463 template <typename UserHdr>
466 UserHdr user;
467
468 UserHdr *operator->() { return &user; }
469 const UserHdr *operator->() const { return &user; }
470 UserHdr &operator*() { return user; }
471 const UserHdr &operator*() const { return user; }
472 };
473
474 // trait to detect WrappedWithFragInfo types
475 template <typename T>
476 struct is_wrapped_with_frag_info : std::false_type {};
477 template <typename U>
478 struct is_wrapped_with_frag_info<WrappedWithFragInfo<U>> : std::true_type {};
479
480} // namespace Realm
481
482#include "realm/activemsg.inl"
483
484#endif
Definition activemsg.h:302
const char * name
Definition activemsg.h:312
virtual ActiveMessageHandlerTable::MessageHandler get_handler(void) const =0
virtual ~ActiveMessageHandlerRegBase(void)
Definition activemsg.h:304
ActiveMessageHandlerRegBase * next_handler
Definition activemsg.h:314
virtual ActiveMessageHandlerTable::MessageHandlerNoTimeout get_handler_notimeout(void) const =0
std::optional< const FragmentInfo &(*)(const void *)> extract_frag_info
Definition activemsg.h:315
bool must_free
Definition activemsg.h:313
ActiveMessageHandlerTable::TypeHash hash
Definition activemsg.h:311
virtual ActiveMessageHandlerTable::MessageHandlerInline get_handler_inline(void) const =0
Definition activemsg.h:319
void force_instantiation(void)
Definition activemsg.h:352
virtual ActiveMessageHandlerTable::MessageHandlerInline get_handler_inline(void) const
virtual ActiveMessageHandlerTable::MessageHandler get_handler(void) const
virtual ActiveMessageHandlerTable::MessageHandlerNoTimeout get_handler_notimeout(void) const
Definition activemsg.h:254
const char * lookup_message_name(MessageID id)
bool(* MessageHandlerInline)(NodeID sender, const void *header, const void *payload, size_t payload_size, TimeLimit work_until)
Definition activemsg.h:264
unsigned short MessageID
Definition activemsg.h:259
MessageID lookup_message_id(void) const
void(* MessageHandlerNoTimeout)(NodeID sender, const void *header, const void *payload, size_t payload_size)
Definition activemsg.h:262
void record_message_handler_call(MessageID id, long long t_start, long long t_end)
unsigned TypeHash
Definition activemsg.h:279
void(* MessageHandler)(NodeID sender, const void *header, const void *payload, size_t payload_size, TimeLimit work_until)
Definition activemsg.h:260
static void append_handler_reg(ActiveMessageHandlerRegBase *new_reg)
HandlerEntry * lookup_message_handler(MessageID id)
static ActiveMessageHandlerRegBase * pending_handlers
Definition activemsg.h:295
std::vector< HandlerEntry > handlers
Definition activemsg.h:297
Definition activemsg.h:221
virtual void commit(size_t act_payload_size)=0
virtual void * add_local_completion(size_t size)=0
void * header_base
Definition activemsg.h:233
virtual void * add_remote_completion(size_t size)=0
size_t payload_size
Definition activemsg.h:235
void * payload_base
Definition activemsg.h:234
virtual void cancel()=0
virtual ~ActiveMessageImpl()
Definition activemsg.h:223
Definition activemsg.h:69
Realm::Serialization::FixedBufferSerializer fbs
Definition activemsg.h:169
void init(NodeID _target, const LocalAddress &_src_payload_addr, size_t _bytes_per_line, size_t _lines, size_t _line_stride, const RemoteAddress &_dest_payload_addr)
static size_t recommended_max_payload(NodeID target, const void *data, size_t bytes_per_line, size_t lines, size_t line_stride, bool with_congestion)
ActiveMessage(const Realm::NodeSet &_targets, const void *_data, size_t _datalen)
ActiveMessageImpl * impl
Definition activemsg.h:167
ActiveMessage(NodeID _target, size_t _max_payload_size=0)
void init(NodeID _target, const LocalAddress &_src_payload_addr, size_t _datalen, const RemoteAddress &_dest_payload_addr)
uint64_t inline_capacity[INLINE_STORAGE/sizeof(uint64_t)]
Definition activemsg.h:171
void * payload_ptr(size_t datalen)
void init(NodeID _target, const void *_data, size_t _datalen)
void add_payload(const void *data, size_t bytes_per_line, size_t lines, size_t line_stride, int payload_mode=PAYLOAD_COPY)
void init(NodeID _target, size_t _max_payload_size=0)
ActiveMessage(const Realm::NodeSet &_targets, size_t _max_payload_size=0)
T * header
Definition activemsg.h:168
ActiveMessage(NodeID _target, const void *_data, size_t _datalen)
void init(const Realm::NodeSet &_targets, const void *_data, size_t _datalen)
bool operator<<(const T2 &to_append)
void add_payload(const void *data, size_t datalen, int payload_mode=PAYLOAD_COPY)
static size_t recommended_max_payload(NodeID target, bool with_congestion)
static size_t recommended_max_payload(NodeID target, const RemoteAddress &dest_payload_addr, bool with_congestion)
static size_t recommended_max_payload(const NodeSet &targets, const void *data, size_t bytes_per_line, size_t lines, size_t line_stride, bool with_congestion)
ActiveMessage(NodeID _target, const LocalAddress &_src_payload_addr, size_t _bytes_per_line, size_t _lines, size_t _line_stride, const RemoteAddress &_dest_payload_addr)
static size_t recommended_max_payload(const NodeSet &targets, bool with_congestion)
void add_local_completion(const CALLABLE &callable)
void add_remote_completion(const CALLABLE &callable)
static size_t recommended_max_payload(NodeID target, const LocalAddress &src_payload_addr, size_t bytes_per_line, size_t lines, size_t line_stride, const RemoteAddress &dest_payload_addr, bool with_congestion)
void init(const Realm::NodeSet &_targets, size_t _max_payload_size=0)
void init(NodeID _target, size_t _max_payload_size, const RemoteAddress &_dest_payload_addr)
ActiveMessage(NodeID _target, size_t _max_payload_size, const RemoteAddress &_dest_payload_addr)
ActiveMessage(NodeID _target, const LocalAddress &_src_payload_addr, size_t _datalen, const RemoteAddress &_dest_payload_addr)
Definition bgwork.h:129
Definition activemsg.h:192
static void destroy_all(void *start, size_t bytes)
virtual size_t size() const =0
static void clone_all(void *dst, const void *src, size_t bytes)
static void invoke_all(void *start, size_t bytes)
virtual CompletionCallbackBase * clone_at(void *p) const =0
Definition activemsg.h:208
virtual CompletionCallbackBase * clone_at(void *p) const
CALLABLE callable
Definition activemsg.h:216
CompletionCallback(const CALLABLE &_callable)
virtual size_t size() const
Definition threads.h:382
Definition threads.h:342
Definition activemsg.h:361
size_t total_messages_handled
Definition activemsg.h:441
void drain_incoming_messages(size_t min_messages_handled)
int todo_newest
Definition activemsg.h:437
size_t drain_min_count
Definition activemsg.h:440
Message ** heads
Definition activemsg.h:433
bool return_messages(int sender, size_t num_handled, Message *head, Message **tail)
MessageBlock * current_block
Definition activemsg.h:446
int handlers_active
Definition activemsg.h:438
uintptr_t CallbackData
Definition activemsg.h:367
atomic< bool > bgwork_requested
Definition activemsg.h:431
std::vector< Thread * > handler_threads
Definition activemsg.h:445
int dedicated_threads
Definition activemsg.h:430
std::unordered_map< std::pair< NodeID, uint64_t >, std::unique_ptr< FragmentedMessage >, PairHash > frag_message
Definition activemsg.h:460
Mutex::CondVar condvar
Definition activemsg.h:443
Message *** tails
Definition activemsg.h:434
CoreReservation * core_rsrv
Definition activemsg.h:444
int get_messages(Message *&head, Message **&tail, bool wait)
bool add_incoming_message(NodeID sender, ActiveMessageHandlerTable::MessageID msgid, const void *hdr, size_t hdr_size, int hdr_mode, const void *payload, size_t payload_size, int payload_mode, CallbackFnptr callback_fnptr, CallbackData callback_data1, CallbackData callback_data2, TimeLimit work_until)
void start_handler_threads(size_t stack_size)
bool * in_handler
Definition activemsg.h:435
IncomingMessageManager(int _nodes, int _dedicated_threads, Realm::CoreReservationSet &crs)
size_t num_available_blocks
Definition activemsg.h:448
Mutex mutex
Definition activemsg.h:442
int shutdown_flag
Definition activemsg.h:432
int * todo_list
Definition activemsg.h:436
MessageBlock * available_blocks
Definition activemsg.h:447
bool drain_pending
Definition activemsg.h:439
virtual bool do_work(TimeLimit work_until)
size_t cfg_max_available_blocks
Definition activemsg.h:449
Definition nodeset.h:117
Definition timers.h:129
Definition mutex.h:325
Definition mutex.h:223
Definition atomics.h:31
#define REALM_INTERNAL_API_EXTERNAL_LINKAGE
Definition compiler_support.h:218
Helper utility for reconstructing large ActiveMessages that were split into multiple network packets.
bool profile_activemsg_handlers
long long max_inline_message_time
thread_local bool in_message_handler
Definition activemsg.h:42
ActiveMessageHandlerTable activemsg_handler_table
int NodeID
Definition nodeset.h:40
@ PAYLOAD_EMPTY
Definition activemsg.h:63
@ PAYLOAD_KEEPREG
Definition activemsg.h:62
@ PAYLOAD_PENDING
Definition activemsg.h:61
@ PAYLOAD_SRCPTR
Definition activemsg.h:60
@ PAYLOAD_NONE
Definition activemsg.h:56
@ PAYLOAD_COPY
Definition activemsg.h:59
@ PAYLOAD_FREE
Definition activemsg.h:58
@ PAYLOAD_KEEP
Definition activemsg.h:57
Definition activemsg.h:240
void record(long long t_start, long long t_end)
atomic< size_t > count
Definition activemsg.h:241
atomic< size_t > minval
Definition activemsg.h:241
atomic< size_t > maxval
Definition activemsg.h:241
atomic< size_t > sum
Definition activemsg.h:241
atomic< size_t > sum2
Definition activemsg.h:241
MessageHandlerNoTimeout handler_notimeout
Definition activemsg.h:285
std::optional< const FragmentInfo &(*)(const void *)> extract_frag_info
Definition activemsg.h:289
const char * name
Definition activemsg.h:283
ActiveMessageHandlerStats stats
Definition activemsg.h:287
TypeHash hash
Definition activemsg.h:282
MessageHandlerInline handler_inline
Definition activemsg.h:286
MessageHandler handler
Definition activemsg.h:284
Definition activemsg.h:247
uint32_t total_chunks
Definition activemsg.h:249
uint64_t msg_id
Definition activemsg.h:250
uint32_t chunk_id
Definition activemsg.h:248
static MessageBlock * new_block(size_t _total_size)
static void free_block(MessageBlock *block)
void recycle_message(Message *msg, IncomingMessageManager *manager)
Message * append_message(size_t hdr_bytes_needed, size_t payload_bytes_needed)
atomic< unsigned > use_count
Definition activemsg.h:423
size_t size_used
Definition activemsg.h:422
MessageBlock * next_free
Definition activemsg.h:424
Definition activemsg.h:395
CallbackFnptr callback_fnptr
Definition activemsg.h:406
CallbackData callback_data1
Definition activemsg.h:407
void * payload
Definition activemsg.h:403
bool hdr_needs_free
Definition activemsg.h:402
void * hdr
Definition activemsg.h:400
MessageBlock * block
Definition activemsg.h:396
size_t payload_size
Definition activemsg.h:404
Message * next_msg
Definition activemsg.h:397
ActiveMessageHandlerTable::HandlerEntry * handler
Definition activemsg.h:399
size_t hdr_size
Definition activemsg.h:401
NodeID sender
Definition activemsg.h:398
bool payload_needs_free
Definition activemsg.h:405
Definition activemsg.h:451
std::size_t operator()(const std::pair< NodeID, uint64_t > &p) const
Definition activemsg.h:452
Definition network.h:58
Definition network.h:46
Definition activemsg.h:464
UserHdr * operator->()
Definition activemsg.h:468
UserHdr & operator*()
Definition activemsg.h:470
const UserHdr * operator->() const
Definition activemsg.h:469
FragmentInfo frag_info
Definition activemsg.h:465
UserHdr user
Definition activemsg.h:466
const UserHdr & operator*() const
Definition activemsg.h:471
Definition activemsg.h:476
NodeID src
Definition ucp_internal.h:1
unsigned short msgid
Definition ucp_internal.h:2