Realm
A distributed, event-based tasking library
Loading...
Searching...
No Matches
subgraph_impl.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// Realm subgraph implementation
19
20#ifndef REALM_SUBGRAPH_IMPL_H
21#define REALM_SUBGRAPH_IMPL_H
22
23#include "realm/subgraph.h"
24#include "realm/id.h"
25#include "realm/event_impl.h"
26
27namespace Realm {
28
37
39 public:
41
43
44 void init(ID _me, int _owner);
45
46 static ID make_id(const SubgraphImpl &dummy, int owner, ID::IDType index)
47 {
48 return ID::make_subgraph(owner, 0, index);
49 }
50
51 // compile/analyze the subgraph
52 bool compile(void);
53
54 void instantiate(const void *args, size_t arglen, const ProfilingRequestSet &prs,
55 span<const Event> preconditions, span<const Event> postconditions,
56 Event start_event, Event finish_event, int priority_adjust);
57
58 void destroy(void);
59
61 public:
62 void defer(SubgraphImpl *_subgraph, Event wait_on);
63 virtual void event_triggered(bool poisoned, TimeLimit work_until);
64 virtual void print(std::ostream &os) const;
65 virtual Event get_finish_event(void) const;
66
67 protected:
69 };
70
71 public:
75 std::vector<SubgraphScheduleEntry> schedule;
77
79 };
80
81 // active messages
82
86 size_t arglen;
88
89 static void handle_message(NodeID sender, const SubgraphInstantiateMessage &msg,
90 const void *data, size_t datalen);
91 };
92
96
97 static void handle_message(NodeID sender, const SubgraphDestroyMessage &msg,
98 const void *data, size_t datalen);
99 };
100
101}; // namespace Realm
102
103#endif
Definition event_impl.h:49
Definition event.h:50
Definition id.h:30
static ID make_subgraph(unsigned owner_node, unsigned creator_node, unsigned subgraph_idx)
::realm_id_t IDType
Definition id.h:32
Definition profiling.h:363
Definition subgraph_impl.h:60
SubgraphImpl * subgraph
Definition subgraph_impl.h:68
virtual void event_triggered(bool poisoned, TimeLimit work_until)
virtual Event get_finish_event(void) const
void defer(SubgraphImpl *_subgraph, Event wait_on)
virtual void print(std::ostream &os) const
Definition subgraph_impl.h:38
ID me
Definition subgraph_impl.h:72
DeferredDestroy deferred_destroy
Definition subgraph_impl.h:78
void init(ID _me, int _owner)
size_t num_intermediate_events
Definition subgraph_impl.h:76
static ID make_id(const SubgraphImpl &dummy, int owner, ID::IDType index)
Definition subgraph_impl.h:46
SubgraphDefinition * defn
Definition subgraph_impl.h:74
size_t max_preconditions
Definition subgraph_impl.h:76
std::vector< SubgraphScheduleEntry > schedule
Definition subgraph_impl.h:75
size_t num_final_events
Definition subgraph_impl.h:76
void instantiate(const void *args, size_t arglen, const ProfilingRequestSet &prs, span< const Event > preconditions, span< const Event > postconditions, Event start_event, Event finish_event, int priority_adjust)
SubgraphImpl * next_free
Definition subgraph_impl.h:73
Definition subgraph.h:36
Definition timers.h:129
Definition utils.h:84
Definition activemsg.h:38
int NodeID
Definition nodeset.h:40
Definition subgraph.h:68
OpKind
Definition subgraph.h:164
Definition subgraph_impl.h:93
static void handle_message(NodeID sender, const SubgraphDestroyMessage &msg, const void *data, size_t datalen)
Subgraph subgraph
Definition subgraph_impl.h:94
Event wait_on
Definition subgraph_impl.h:95
Definition subgraph_impl.h:83
Event finish_event
Definition subgraph_impl.h:85
size_t arglen
Definition subgraph_impl.h:86
int priority_adjust
Definition subgraph_impl.h:87
Subgraph subgraph
Definition subgraph_impl.h:84
Event wait_on
Definition subgraph_impl.h:85
static void handle_message(NodeID sender, const SubgraphInstantiateMessage &msg, const void *data, size_t datalen)
Definition subgraph_impl.h:29
unsigned intermediate_event_count
Definition subgraph_impl.h:34
unsigned op_index
Definition subgraph_impl.h:31
std::vector< std::pair< unsigned, int > > preconditions
Definition subgraph_impl.h:32
unsigned first_interp
Definition subgraph_impl.h:33
unsigned num_interps
Definition subgraph_impl.h:33
bool is_final_event
Definition subgraph_impl.h:35
unsigned intermediate_event_base
Definition subgraph_impl.h:34
SubgraphDefinition::OpKind op_kind
Definition subgraph_impl.h:30