Realm
A distributed, event-based tasking library
Loading...
Searching...
No Matches
byfield.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// byfield (filter) operations for Realm dependent partitioning
19
20#ifndef REALM_DEPPART_BYFIELD_H
21#define REALM_DEPPART_BYFIELD_H
22
24
25namespace Realm {
26
27 template <int N, typename T, typename FT>
29 public:
30 static const int DIM = N;
31 typedef T IDXTYPE;
32 typedef FT FIELDTYPE;
33
35 RegionInstance _inst, size_t _field_offset);
36 virtual ~ByFieldMicroOp(void);
37
38 void set_value_range(FT _lo, FT _hi);
39 void set_value_set(const std::vector<FT>& _value_set);
40 void add_sparsity_output(FT _val, SparsityMap<N,T> _sparsity);
41
42 virtual void execute(void);
43
44 void dispatch(PartitioningOperation *op, bool inline_ok);
45
46 protected:
47 friend struct RemoteMicroOpMessage<ByFieldMicroOp<N,T,FT> >;
49
50 friend class PartitioningMicroOp;
51 template <typename S>
52 REALM_ATTR_WARN_UNUSED(bool serialize_params(S& s) const);
53
54 // construct from received packet
55 template <typename S>
56 ByFieldMicroOp(NodeID _requestor, AsyncMicroOp *_async_microop, S& s);
57
58 template <typename BM>
59 void populate_bitmasks(std::map<FT, BM *>& bitmasks);
60
66 std::set<FT> value_set;
67 std::map<FT, SparsityMap<N,T> > sparsity_outputs;
68 };
69
70 template <int N, typename T, typename FT>
72 public:
74 const std::vector<FieldDataDescriptor<IndexSpace<N,T>,FT> >& _field_data,
75 const ProfilingRequestSet &reqs,
76 GenEventImpl *_finish_event, EventImpl::gen_t _finish_gen);
77
78 virtual ~ByFieldOperation(void);
79
81
82 virtual void execute(void);
83
84 virtual void print(std::ostream& os) const;
85
86 protected:
88 std::vector<FieldDataDescriptor<IndexSpace<N,T>,FT> > field_data;
89 std::vector<FT> colors;
90 std::vector<SparsityMap<N,T> > subspaces;
91 };
92
93};
94
95#endif // REALM_DEPPART_BYFIELD_H
Definition activemsg.h:303
Definition partitions.h:85
Definition byfield.h:28
FT FIELDTYPE
Definition byfield.h:32
void dispatch(PartitioningOperation *op, bool inline_ok)
bool value_set_valid
Definition byfield.h:64
FT range_lo
Definition byfield.h:65
ByFieldMicroOp(IndexSpace< N, T > _parent_space, IndexSpace< N, T > _inst_space, RegionInstance _inst, size_t _field_offset)
size_t field_offset
Definition byfield.h:63
static ActiveMessageHandlerReg< RemoteMicroOpMessage< ByFieldMicroOp< N, T, FT > > > areg
Definition byfield.h:48
IndexSpace< N, T > inst_space
Definition byfield.h:61
virtual ~ByFieldMicroOp(void)
void set_value_range(FT _lo, FT _hi)
RegionInstance inst
Definition byfield.h:62
void set_value_set(const std::vector< FT > &_value_set)
static const int DIM
Definition byfield.h:30
std::map< FT, SparsityMap< N, T > > sparsity_outputs
Definition byfield.h:67
REALM_ATTR_WARN_UNUSED(bool serialize_params(S &s) const)
IndexSpace< N, T > parent_space
Definition byfield.h:61
FT range_hi
Definition byfield.h:65
ByFieldMicroOp(NodeID _requestor, AsyncMicroOp *_async_microop, S &s)
std::set< FT > value_set
Definition byfield.h:66
void add_sparsity_output(FT _val, SparsityMap< N, T > _sparsity)
virtual void execute(void)
T IDXTYPE
Definition byfield.h:31
bool value_range_valid
Definition byfield.h:64
void populate_bitmasks(std::map< FT, BM * > &bitmasks)
Definition byfield.h:71
std::vector< FT > colors
Definition byfield.h:89
virtual ~ByFieldOperation(void)
std::vector< SparsityMap< N, T > > subspaces
Definition byfield.h:90
virtual void print(std::ostream &os) const
std::vector< FieldDataDescriptor< IndexSpace< N, T >, FT > > field_data
Definition byfield.h:88
ByFieldOperation(const IndexSpace< N, T > &_parent, const std::vector< FieldDataDescriptor< IndexSpace< N, T >, FT > > &_field_data, const ProfilingRequestSet &reqs, GenEventImpl *_finish_event, EventImpl::gen_t _finish_gen)
IndexSpace< N, T > parent
Definition byfield.h:87
IndexSpace< N, T > add_color(FT color)
virtual void execute(void)
unsigned gen_t
Definition event_impl.h:87
Definition event_impl.h:198
Definition partitions.h:98
Definition partitions.h:153
Definition profiling.h:363
Definition instance.h:66
Definition sparsity.h:65
Definition activemsg.h:38
int NodeID
Definition nodeset.h:40
Definition indexspace.h:107
Definition indexspace.h:323
Definition partitions.h:230