Skip to content

Commit

Permalink
legion: merge master into control replication and resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
lightsighter committed Dec 1, 2021
2 parents 9ef17bc + f315c9b commit 45d9999
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 13 deletions.
5 changes: 5 additions & 0 deletions runtime/legion/legion_allocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ namespace Legion {
VARIANT_IMPL_ALLOC,
LAYOUT_CONSTRAINTS_ALLOC,
COPY_FILL_AGGREGATOR_ALLOC,
UNION_EXPR_ALLOC,
INTERSECTION_EXPR_ALLOC,
DIFFERENCE_EXPR_ALLOC,
INSTANCE_EXPR_ALLOC,
REMOTE_EXPR_ALLOC,
LAST_ALLOC, // must be last
};

Expand Down
2 changes: 1 addition & 1 deletion runtime/legion/legion_analysis.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9852,7 +9852,7 @@ namespace Legion {
add_base_gc_ref(REMOTE_DID_REF);
#ifdef LEGION_GC
log_garbage.info("GC Equivalence Set %lld %d",
LEGION_DISTRIBUTED_ID_FILTER(id), local_space);
LEGION_DISTRIBUTED_ID_FILTER(this->did), local_space);
#endif
}

Expand Down
6 changes: 3 additions & 3 deletions runtime/legion/mapper_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3461,14 +3461,14 @@ namespace Legion {
{
pause_mapper_call(ctx);
Domain result = Domain::NO_DOMAIN;
const TypeTag type_tag = handle.get_type_tag();
switch (NT_TemplateHelper::get_dim(type_tag))
switch (NT_TemplateHelper::get_dim(handle.get_type_tag()))
{
#define DIMFUNC(DIM) \
case DIM: \
{ \
DomainT<DIM,coord_t> realm_is; \
runtime->get_index_space_domain(handle, &realm_is, type_tag); \
const TypeTag tag = NT_TemplateHelper::encode_tag<DIM,coord_t>(); \
runtime->get_index_space_domain(handle, &realm_is, tag); \
result = realm_is; \
break; \
}
Expand Down
8 changes: 8 additions & 0 deletions runtime/legion/region_tree.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7139,6 +7139,10 @@ namespace Legion {
{
// We always keep a reference on ourself until we get invalidated
add_expression_reference(1/*count*/, true/*expr tree*/);
#ifdef LEGION_GC
log_garbage.info("GC Index Expr %lld %d %lld",
LEGION_DISTRIBUTED_ID_FILTER(this->did), local_space, expr_id);
#endif
}

//--------------------------------------------------------------------------
Expand All @@ -7153,6 +7157,10 @@ namespace Legion {
{
#ifdef DEBUG_LEGION
assert(!is_owner());
#endif
#ifdef LEGION_GC
log_garbage.info("GC Index Expr %lld %d %lld",
LEGION_DISTRIBUTED_ID_FILTER(this->did), local_space, expr_id);
#endif
}

Expand Down
25 changes: 20 additions & 5 deletions runtime/legion/region_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -1554,7 +1554,10 @@ namespace Legion {
};

template<int DIM, typename T>
class IndexSpaceUnion : public IndexSpaceOperationT<DIM,T> {
class IndexSpaceUnion : public IndexSpaceOperationT<DIM,T>,
public LegionHeapify<IndexSpaceUnion<DIM,T> > {
public:
static const AllocationType alloc_type = UNION_EXPR_ALLOC;
public:
IndexSpaceUnion(const std::vector<IndexSpaceExpression*> &to_union,
RegionTreeForest *context);
Expand Down Expand Up @@ -1591,7 +1594,10 @@ namespace Legion {
};

template<int DIM, typename T>
class IndexSpaceIntersection : public IndexSpaceOperationT<DIM,T> {
class IndexSpaceIntersection : public IndexSpaceOperationT<DIM,T>,
public LegionHeapify<IndexSpaceIntersection<DIM,T> > {
public:
static const AllocationType alloc_type = INTERSECTION_EXPR_ALLOC;
public:
IndexSpaceIntersection(const std::vector<IndexSpaceExpression*> &to_inter,
RegionTreeForest *context);
Expand Down Expand Up @@ -1628,7 +1634,10 @@ namespace Legion {
};

template<int DIM, typename T>
class IndexSpaceDifference : public IndexSpaceOperationT<DIM,T> {
class IndexSpaceDifference : public IndexSpaceOperationT<DIM,T>,
public LegionHeapify<IndexSpaceDifference<DIM,T> > {
public:
static const AllocationType alloc_type = DIFFERENCE_EXPR_ALLOC;
public:
IndexSpaceDifference(IndexSpaceExpression *lhs,IndexSpaceExpression *rhs,
RegionTreeForest *context);
Expand Down Expand Up @@ -1672,7 +1681,10 @@ namespace Legion {
* rectangles that represent a physical instance
*/
template<int DIM, typename T>
class InstanceExpression : public IndexSpaceOperationT<DIM,T> {
class InstanceExpression : public IndexSpaceOperationT<DIM,T>,
public LegionHeapify<InstanceExpression<DIM,T> > {
public:
static const AllocationType alloc_type = INSTANCE_EXPR_ALLOC;
public:
InstanceExpression(const Rect<DIM,T> *rects, size_t num_rects,
RegionTreeForest *context);
Expand All @@ -1690,7 +1702,10 @@ namespace Legion {
* A copy of an expression that lives on a remote node.
*/
template<int DIM, typename T>
class RemoteExpression : public IndexSpaceOperationT<DIM,T> {
class RemoteExpression : public IndexSpaceOperationT<DIM,T>,
public LegionHeapify<RemoteExpression<DIM,T> > {
public:
static const AllocationType alloc_type = REMOTE_EXPR_ALLOC;
public:
RemoteExpression(RegionTreeForest *context, IndexSpaceExprID eid,
DistributedID did, AddressSpaceID own, IndexSpaceOperation *op,
Expand Down
10 changes: 10 additions & 0 deletions runtime/legion/runtime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28665,6 +28665,16 @@ namespace Legion {
return "Layout Constraints";
case COPY_FILL_AGGREGATOR_ALLOC:
return "Copy Fill Aggregator";
case UNION_EXPR_ALLOC:
return "Union Index Space Expression";
case INTERSECTION_EXPR_ALLOC:
return "Intersection Index Space Expression";
case DIFFERENCE_EXPR_ALLOC:
return "Difference Index Space Expression";
case INSTANCE_EXPR_ALLOC:
return "Instance Index Space Expression";
case REMOTE_EXPR_ALLOC:
return "Remote Index Space Expression";
default:
assert(false); // should never get here
}
Expand Down
24 changes: 20 additions & 4 deletions tools/legion_gc.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,22 +538,22 @@ def check_for_cycles_by_kind(self, assert_on_error, stack, kind):
self.on_stack = True
if kind == GC_REF_KIND and self.nested_gc_refs:
for src,refs in iteritems(self.nested_gc_refs):
if refs is 0:
if refs == 0:
continue
src.check_for_cycles_by_kind(assert_on_error, stack, kind)
if kind == VALID_REF_KIND and self.nested_valid_refs:
for src,refs in iteritems(self.nested_valid_refs):
if refs is 0:
if refs == 0:
continue
src.check_for_cycles_by_kind(assert_on_error, stack, kind)
if kind == REMOTE_REF_KIND and self.nested_remote_refs:
for src,refs in iteritems(self.nested_remote_refs):
if refs is 0:
if refs == 0:
continue
src.check_for_cycles_by_kind(assert_on_error, stack, kind)
if kind == RESOURCE_REF_KIND and self.nested_resource_refs:
for src,refs in iteritems(self.nested_resource_refs):
if refs is 0:
if refs == 0:
continue
src.check_for_cycles_by_kind(assert_on_error, stack, kind)
stack.pop()
Expand Down Expand Up @@ -880,6 +880,8 @@ def post_parse(self):
index_space.update_nested_references(self)
for index_part in itervalues(self.index_partitions):
index_part.update_nested_references(self)
for index_expr in itervalues(self.index_expressions):
index_expr.update_nested_references(self)
for field_space in itervalues(self.field_spaces):
field_space.update_nested_references(self)
for region in itervalues(self.regions):
Expand Down Expand Up @@ -1110,6 +1112,8 @@ def get_obj(self, did, node):
return self.index_spaces[key]
if key in self.index_partitions:
return self.index_partitions[key]
if key in self.index_expressions:
return self.index_expressions[key]
if key in self.field_spaces:
return self.field_spaces[key]
if key in self.regions:
Expand Down Expand Up @@ -1146,6 +1150,9 @@ def check_for_cycles(self, assert_on_error):
for did,index_part in iteritems(self.index_partitions):
print("Checking for cycles in "+repr(index_part))
index_part.check_for_cycles(assert_on_error)
for did,index_expr in iteritems(self.index_expressions):
print("Checking for cycles in "+repr(index_expr))
index_expr.check_for_cycles(assert_on_error)
for did,field_space in iteritems(self.field_spaces):
print("Checking for cycles in "+repr(field_space))
field_space.check_for_cycles(assert_on_error)
Expand All @@ -1166,6 +1173,7 @@ def check_for_leaks(self, assert_on_error, verbose):
leaked_eq_sets = 0
leaked_index_spaces = 0
leaked_index_partitions = 0
leaked_index_expressions = 0
leaked_field_spaces = 0
leaked_regions = 0
leaked_partitions = 0
Expand Down Expand Up @@ -1197,6 +1205,9 @@ def check_for_leaks(self, assert_on_error, verbose):
for index_part in itervalues(self.index_partitions):
if not index_part.check_for_leaks(assert_on_error, verbose):
leaked_index_partitions += 1
for index_expr in itervalues(self.index_expressions):
if not index_expr.check_for_leaks(assert_on_error, verbose):
leaked_index_expressions += 1
for field_space in itervalues(self.field_spaces):
if not field_space.check_for_leaks(assert_on_error, verbose):
leaked_field_spaces += 1
Expand Down Expand Up @@ -1252,6 +1263,11 @@ def check_for_leaks(self, assert_on_error, verbose):
if assert_on_error: assert False
else:
print(" Leaked Index Partitions: "+str(leaked_index_partitions))
if leaked_index_expressions > 0:
print(" LEAKED INDEX EXPRESSIONS: "+str(leaked_index_expressions))
if assert_on_error: assert False
else:
print(" Leaked Index Expressions: "+str(leaked_index_expressions))
if leaked_field_spaces > 0:
print(" LEAKED FIELD SPACES: "+str(leaked_field_spaces))
if assert_on_error: assert False
Expand Down

0 comments on commit 45d9999

Please sign in to comment.