Skip to content

Conversation

@manopapad
Copy link
Contributor

Without this change we could miss the unmapping of an inline-mapped RegionField, even after we recycle it for a different Store. This would cause a conflict if we then try to inline map the second Store, e.g. in the following example:

for _ in range(8):
    arr = lg.ones((5,5,5))[1:2,1:2,1:2]
    arr._thunk.__numpy_array__()

which would produce the following logging output:

attaching Region(tid: 1, is: 13, fs: 1, fid: 1048577) :: going to parent
attaching Region(tid: 1, is: 1, fs: 1, fid: 1048577) :: got to root, attaching
reducing inline ref count for RegionField(tid: 1, is: 13, fs: 1, fid: 1048577), count = 0
parent: RegionField(tid: 1, is: 1, fs: 1, fid: 1048577), count = 1
self.physical_region is None => fast exit
attaching Region(tid: 1, is: 13, fs: 1, fid: 1048578) :: going to parent
attaching Region(tid: 1, is: 1, fs: 1, fid: 1048578) :: got to root, attaching
reducing inline ref count for RegionField(tid: 1, is: 13, fs: 1, fid: 1048578), count = 0
parent: RegionField(tid: 1, is: 1, fs: 1, fid: 1048578), count = 1
self.physical_region is None => fast exit
attaching Region(tid: 1, is: 13, fs: 1, fid: 1048579) :: going to parent
attaching Region(tid: 1, is: 1, fs: 1, fid: 1048579) :: got to root, attaching
reducing inline ref count for RegionField(tid: 1, is: 13, fs: 1, fid: 1048579), count = 0
parent: RegionField(tid: 1, is: 1, fs: 1, fid: 1048579), count = 1
self.physical_region is None => fast exit
attaching Region(tid: 1, is: 13, fs: 1, fid: 1048580) :: going to parent
attaching Region(tid: 1, is: 1, fs: 1, fid: 1048580) :: got to root, attaching
reducing inline ref count for RegionField(tid: 1, is: 13, fs: 1, fid: 1048580), count = 0
parent: RegionField(tid: 1, is: 1, fs: 1, fid: 1048580), count = 1
self.physical_region is None => fast exit
attaching Region(tid: 1, is: 13, fs: 1, fid: 1048581) :: going to parent
attaching Region(tid: 1, is: 1, fs: 1, fid: 1048581) :: got to root, attaching
reducing inline ref count for RegionField(tid: 1, is: 13, fs: 1, fid: 1048581), count = 0
parent: RegionField(tid: 1, is: 1, fs: 1, fid: 1048581), count = 1
self.physical_region is None => fast exit
attaching Region(tid: 1, is: 13, fs: 1, fid: 1048582) :: going to parent
attaching Region(tid: 1, is: 1, fs: 1, fid: 1048582) :: got to root, attaching
reducing inline ref count for RegionField(tid: 1, is: 13, fs: 1, fid: 1048582), count = 0
parent: RegionField(tid: 1, is: 1, fs: 1, fid: 1048582), count = 1
self.physical_region is None => fast exit
attaching Region(tid: 1, is: 13, fs: 1, fid: 1048583) :: going to parent
attaching Region(tid: 1, is: 1, fs: 1, fid: 1048583) :: got to root, attaching
reducing inline ref count for RegionField(tid: 1, is: 13, fs: 1, fid: 1048583), count = 0
parent: RegionField(tid: 1, is: 1, fs: 1, fid: 1048583), count = 1
self.physical_region is None => fast exit
attaching Region(tid: 1, is: 13, fs: 1, fid: 1048577) :: going to parent
attaching Region(tid: 1, is: 1, fs: 1, fid: 1048577) :: got to root, attaching
[0 - 7f5bac551700]    2.738872 {5}{runtime}: [error 395] LEGION ERROR: Attempted an inline mapping of region (1,1,1) that conflicts with previous inline mapping in task legion_python_main (ID 1) that would ultimately result in deadlock.  Instead you
receive this error message. (from file /gpfs/fs1/mpapadakis/legate.core/legion/runtime/legion/legion_context.cc:6568)

…mapping

Without this change we could miss the unmapping of an inline-mapped RegionField,
even after we recycle it for a different Store. This would cause a conflict if
we then try to inline map the second Store, e.g. in the following example:

for _ in range(8):
    arr = lg.ones((5,5,5))[1:2,1:2,1:2]
    arr._thunk.__numpy_array__()
@manopapad manopapad merged commit b7ea64f into nv-legate:branch-21.10 Oct 12, 2021
@manopapad manopapad deleted the detach_child branch October 12, 2021 16:09
jjwilke pushed a commit to jjwilke/legate.core that referenced this pull request Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant