Realm
A distributed, event-based tasking library
Loading...
Searching...
No Matches
gasnetex_module.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// GASNet-EX network module implementation for Realm
19
20#ifndef GASNETEX_MODULE_H
21#define GASNETEX_MODULE_H
22
23#include "realm/network.h"
24
25namespace Realm {
26
27 class GASNetEXInternal;
28
30 protected:
32
33 public:
34 virtual ~GASNetEXModule();
35
36 // all subclasses should define this (static) method - its responsibilities
37 // are:
38 // 1) determine if the network module should even be loaded
39 // 2) fix the command line if the spawning system hijacked it
40 static NetworkModule *create_network_module(RuntimeImpl *runtime, int *argc,
41 const char ***argv);
42 // Enumerates all the peers that the current node could potentially share memory with
43 virtual void get_shared_peers(NodeSet &shared_peers);
44
45 // actual parsing of the command line should wait until here if at all
46 // possible
47 virtual void parse_command_line(RuntimeImpl *runtime,
48 std::vector<std::string> &cmdline);
49
50 // "attaches" to the network, if that is meaningful - attempts to
51 // bind/register/(pick your network-specific verb) the requested memory
52 // segments with the network
53 virtual void attach(RuntimeImpl *runtime, std::vector<NetworkSegment *> &segments);
54
55 virtual void create_memories(RuntimeImpl *runtime);
56
57 // detaches from the network
58 virtual void detach(RuntimeImpl *runtime, std::vector<NetworkSegment *> &segments);
59
60 // collective communication within this network
61 virtual void barrier(void);
62 virtual void broadcast(NodeID root, const void *val_in, void *val_out, size_t bytes);
63 virtual void gather(NodeID root, const void *val_in, void *vals_out, size_t bytes);
64 virtual void allgatherv(const char *val_in, size_t bytes, std::vector<char> &vals_out,
65 std::vector<size_t> &lengths);
66
67 virtual size_t sample_messages_received_count(void);
68 virtual bool check_for_quiescence(size_t sampled_receive_count);
69
70 // used to create a remote proxy for a memory
71 virtual MemoryImpl *create_remote_memory(RuntimeImpl *runtime, Memory m, size_t size,
72 Memory::Kind kind,
73 const ByteArray &rdma_info);
74 virtual IBMemory *create_remote_ib_memory(RuntimeImpl *runtime, Memory m, size_t size,
75 Memory::Kind kind,
76 const ByteArray &rdma_info);
77
78 virtual ActiveMessageImpl *
79 create_active_message_impl(NodeID target, unsigned short msgid, size_t header_size,
80 size_t max_payload_size, const void *src_payload_addr,
81 size_t src_payload_lines, size_t src_payload_line_stride,
82 void *storage_base, size_t storage_size);
83
85 NodeID target, unsigned short msgid, size_t header_size, size_t max_payload_size,
86 const LocalAddress &src_payload_addr, size_t src_payload_lines,
87 size_t src_payload_line_stride, const RemoteAddress &dest_payload_addr,
88 void *storage_base, size_t storage_size);
89
91 NodeID target, unsigned short msgid, size_t header_size, size_t max_payload_size,
92 const RemoteAddress &dest_payload_addr, void *storage_base, size_t storage_size);
93
95 const NodeSet &targets, unsigned short msgid, size_t header_size,
96 size_t max_payload_size, const void *src_payload_addr, size_t src_payload_lines,
97 size_t src_payload_line_stride, void *storage_base, size_t storage_size);
98
99 virtual size_t recommended_max_payload(NodeID target, bool with_congestion,
100 size_t header_size);
101 virtual size_t recommended_max_payload(const NodeSet &targets, bool with_congestion,
102 size_t header_size);
103 virtual size_t recommended_max_payload(NodeID target,
104 const RemoteAddress &dest_payload_addr,
105 bool with_congestion, size_t header_size);
106 virtual size_t recommended_max_payload(NodeID target, const void *data,
107 size_t bytes_per_line, size_t lines,
108 size_t line_stride, bool with_congestion,
109 size_t header_size);
110 virtual size_t recommended_max_payload(const NodeSet &targets, const void *data,
111 size_t bytes_per_line, size_t lines,
112 size_t line_stride, bool with_congestion,
113 size_t header_size);
114 virtual size_t recommended_max_payload(NodeID target,
115 const LocalAddress &src_payload_addr,
116 size_t bytes_per_line, size_t lines,
117 size_t line_stride,
118 const RemoteAddress &dest_payload_addr,
119 bool with_congestion, size_t header_size);
120
121 public:
128#ifdef REALM_USE_CUDA
129 bool cfg_bind_cudamem;
130#endif
131#ifdef REALM_USE_HIP
132 bool cfg_bind_hipmem;
133#endif
136 // number and size of "outbufs", used to put pkt header and/or data in
137 // registered memory for RDMA goodness
141 int cfg_am_limit; // upper bound on AMs in flight to any given peer
142
143 protected:
145 };
146
147}; // namespace Realm
148
149#endif
Definition activemsg.h:205
Definition bytearray.h:53
Definition gasnetex_internal.h:642
Definition gasnetex_module.h:29
virtual void gather(NodeID root, const void *val_in, void *vals_out, size_t bytes)
virtual 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, size_t header_size)
GASNetEXInternal * internal
Definition gasnetex_module.h:144
virtual size_t recommended_max_payload(NodeID target, bool with_congestion, size_t header_size)
virtual IBMemory * create_remote_ib_memory(RuntimeImpl *runtime, Memory m, size_t size, Memory::Kind kind, const ByteArray &rdma_info)
virtual void attach(RuntimeImpl *runtime, std::vector< NetworkSegment * > &segments)
virtual void detach(RuntimeImpl *runtime, std::vector< NetworkSegment * > &segments)
virtual bool check_for_quiescence(size_t sampled_receive_count)
virtual size_t recommended_max_payload(const NodeSet &targets, bool with_congestion, size_t header_size)
size_t cfg_outbuf_count
Definition gasnetex_module.h:138
virtual ActiveMessageImpl * create_active_message_impl(NodeID target, unsigned short msgid, size_t header_size, size_t max_payload_size, const void *src_payload_addr, size_t src_payload_lines, size_t src_payload_line_stride, void *storage_base, size_t storage_size)
virtual void barrier(void)
bool cfg_do_checksums
Definition gasnetex_module.h:134
virtual size_t sample_messages_received_count(void)
bool cfg_use_rma_put
Definition gasnetex_module.h:140
static NetworkModule * create_network_module(RuntimeImpl *runtime, int *argc, const char ***argv)
virtual ActiveMessageImpl * create_active_message_impl(NodeID target, unsigned short msgid, size_t header_size, size_t max_payload_size, const RemoteAddress &dest_payload_addr, void *storage_base, size_t storage_size)
long long cfg_crit_timeout
Definition gasnetex_module.h:124
virtual void parse_command_line(RuntimeImpl *runtime, std::vector< std::string > &cmdline)
virtual void get_shared_peers(NodeSet &shared_peers)
virtual 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, size_t header_size)
bool cfg_bind_hostmem
Definition gasnetex_module.h:127
size_t cfg_outbuf_size
Definition gasnetex_module.h:138
bool cfg_use_negotiated
Definition gasnetex_module.h:123
bool cfg_use_immediate
Definition gasnetex_module.h:122
virtual size_t recommended_max_payload(NodeID target, const RemoteAddress &dest_payload_addr, bool with_congestion, size_t header_size)
size_t cfg_max_medium
Definition gasnetex_module.h:125
bool cfg_batch_messages
Definition gasnetex_module.h:135
virtual ActiveMessageImpl * create_active_message_impl(const NodeSet &targets, unsigned short msgid, size_t header_size, size_t max_payload_size, const void *src_payload_addr, size_t src_payload_lines, size_t src_payload_line_stride, void *storage_base, size_t storage_size)
bool cfg_force_rma
Definition gasnetex_module.h:139
virtual void create_memories(RuntimeImpl *runtime)
int cfg_am_limit
Definition gasnetex_module.h:141
virtual ActiveMessageImpl * create_active_message_impl(NodeID target, unsigned short msgid, size_t header_size, size_t max_payload_size, const LocalAddress &src_payload_addr, size_t src_payload_lines, size_t src_payload_line_stride, const RemoteAddress &dest_payload_addr, void *storage_base, size_t storage_size)
virtual 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, size_t header_size)
virtual void broadcast(NodeID root, const void *val_in, void *val_out, size_t bytes)
virtual MemoryImpl * create_remote_memory(RuntimeImpl *runtime, Memory m, size_t size, Memory::Kind kind, const ByteArray &rdma_info)
size_t cfg_max_long
Definition gasnetex_module.h:126
virtual void allgatherv(const char *val_in, size_t bytes, std::vector< char > &vals_out, std::vector< size_t > &lengths)
Definition ib_memory.h:30
Definition mem_impl.h:50
Definition memory.h:33
Kind
Definition memory.h:59
Definition network.h:144
Definition nodeset.h:117
Definition runtime_impl.h:264
Definition activemsg.h:38
int NodeID
Definition nodeset.h:40
Definition network.h:58
Definition network.h:46
unsigned short msgid
Definition ucp_internal.h:2