Realm
A distributed, event-based tasking library
Loading...
Searching...
No Matches
memcpy_channel.h
Go to the documentation of this file.
1/*
2 * Copyright 2025 Los Alamos National Laboratory, 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#ifndef MEMCPY_CHANNEL
19#define MEMCPY_CHANNEL
20
21#include <vector>
22
23#include "realm/mem_impl.h"
24#include "realm/bgwork.h"
26
27namespace Realm {
28
29 class MemcpyChannel;
30
31 class MemcpyXferDes : public XferDes {
32 public:
33 MemcpyXferDes(uintptr_t _dma_op, Channel *_channel, NodeID _launch_node,
34 XferDesID _guid, const std::vector<XferDesPortInfo> &inputs_info,
35 const std::vector<XferDesPortInfo> &outputs_info, int _priority);
36
37 long get_requests(Request **requests, long nr);
40 void flush();
41
42 virtual bool request_available();
44 virtual void enqueue_request(Request *req);
45
47
48 private:
49 bool memcpy_req_in_use = false;
50 MemcpyRequest memcpy_req;
51 bool has_serdez = false;
52 };
53
54 class MemcpyChannel : public SingleXDQChannel<MemcpyChannel, MemcpyXferDes> {
55 public:
57 const std::unordered_map<realm_id_t, SharedMemoryInfo>
58 &remote_shared_memory_mappings);
59
60 // multiple concurrent memcpys ok
61 static const bool is_ordered = false;
62
64
65 virtual uint64_t
66 supports_path(ChannelCopyInfo channel_copy_info, CustomSerdezID src_serdez_id,
67 CustomSerdezID dst_serdez_id, ReductionOpID redop_id,
68 size_t total_bytes, const std::vector<size_t> *src_frags,
69 const std::vector<size_t> *dst_frags, XferDesKind *kind_ret = 0,
70 unsigned *bw_ret = 0, unsigned *lat_ret = 0);
71
72 virtual XferDes *create_xfer_des(uintptr_t dma_op, NodeID launch_node, XferDesID guid,
73 const std::vector<XferDesPortInfo> &inputs_info,
74 const std::vector<XferDesPortInfo> &outputs_info,
75 int priority, XferDesRedopInfo redop_info,
76 const void *fill_data, size_t fill_size,
77 size_t fill_total);
78
79 virtual long submit(Request **requests, long nr);
80
81 const Node *node = nullptr;
82 bool is_stopped = false;
83 };
84}; // namespace Realm
85
86#endif
Definition bgwork.h:36
Definition channel.h:713
Definition memcpy_channel.h:54
const Node * node
Definition memcpy_channel.h:81
MemcpyChannel(BackgroundWorkManager *_bgwork, const Node *_node, const std::unordered_map< realm_id_t, SharedMemoryInfo > &remote_shared_memory_mappings)
virtual long submit(Request **requests, long nr)
virtual XferDes * create_xfer_des(uintptr_t dma_op, NodeID launch_node, XferDesID guid, const std::vector< XferDesPortInfo > &inputs_info, const std::vector< XferDesPortInfo > &outputs_info, int priority, XferDesRedopInfo redop_info, const void *fill_data, size_t fill_size, size_t fill_total)
static const bool is_ordered
Definition memcpy_channel.h:61
virtual uint64_t supports_path(ChannelCopyInfo channel_copy_info, CustomSerdezID src_serdez_id, CustomSerdezID dst_serdez_id, ReductionOpID redop_id, size_t total_bytes, const std::vector< size_t > *src_frags, const std::vector< size_t > *dst_frags, XferDesKind *kind_ret=0, unsigned *bw_ret=0, unsigned *lat_ret=0)
bool is_stopped
Definition memcpy_channel.h:82
Definition channel.h:169
Definition memcpy_channel.h:31
virtual void enqueue_request(Request *req)
virtual Request * dequeue_request()
void notify_request_read_done(Request *req)
long get_requests(Request **requests, long nr)
void notify_request_write_done(Request *req)
MemcpyXferDes(uintptr_t _dma_op, Channel *_channel, NodeID _launch_node, XferDesID _guid, const std::vector< XferDesPortInfo > &inputs_info, const std::vector< XferDesPortInfo > &outputs_info, int _priority)
bool progress_xd(MemcpyChannel *channel, TimeLimit work_until)
virtual bool request_available()
Definition channel.h:103
Definition channel.h:1014
Definition timers.h:129
Definition channel.h:286
Channel * channel
Definition channel.h:343
Definition activemsg.h:38
int NodeID
Definition nodeset.h:40
XferDesKind
Definition channel.h:85
int CustomSerdezID
Definition custom_serdez.h:148
unsigned long long XferDesID
Definition channel.h:57
::realm_reduction_op_id_t ReductionOpID
Definition event.h:38
Definition channel.h:684
Definition runtime_impl.h:88
Definition channel.h:210