Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX] Fix particle selection for corner cases of morton index values #2575

Merged
merged 47 commits into from Jun 5, 2020
Merged
Changes from 5 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
c3ae3e0
First sketch of a particle selection tester
matthewturk May 4, 2020
0299776
Add in the smoothing length calculations
matthewturk May 4, 2020
073fbf9
Fix particle selection for sub-regions
matthewturk May 4, 2020
f3dd249
Had the logic for is_refined backwards
matthewturk May 5, 2020
7a99703
Updating tests to use particle selection comparison
matthewturk May 5, 2020
df4cf91
Update yt/geometry/particle_oct_container.pyx
matthewturk May 5, 2020
878e018
Update yt/geometry/particle_oct_container.pyx
matthewturk May 5, 2020
cc93f19
Update yt/geometry/particle_oct_container.pyx
matthewturk May 5, 2020
a8ef879
Updating from comments
matthewturk May 5, 2020
d22947e
Refine tests a bit
matthewturk May 7, 2020
934a4eb
Add tests for wrapping on right
matthewturk May 7, 2020
402afa0
Rework periodic smoothing length calculations
matthewturk May 7, 2020
2e39ef1
Rework periodic smoothing length calculations
matthewturk May 7, 2020
0b68faf
We need bounds[i][1] + 1 for inclusive loops
matthewturk May 7, 2020
a5642b6
Merge branch 'fix_select_mi1mi2' of github.com:matthewturk/yt into fi…
matthewturk May 7, 2020
6f6dadc
Merge branch 'test_particle_selections' into fix_select_mi1mi2
matthewturk May 7, 2020
b20c3ed
remove unused import
matthewturk May 8, 2020
8cdf546
First, not-quite-working, pass at refined stuff.
matthewturk May 9, 2020
af135de
Temporary commit, still not working
matthewturk May 13, 2020
0062a98
Merge branch 'fix_select_mi1mi2' of github.com:matthewturk/yt into fi…
matthewturk May 13, 2020
e626e25
another pass
matthewturk May 15, 2020
b1c0d74
try to short circuit, and fix cython bugs
matthewturk May 15, 2020
bc7121c
Use expanded morton for faster BIGMAX selection
matthewturk May 19, 2020
300fc4a
Give up on hiding the C++ in EWAH
matthewturk May 19, 2020
2164393
Intermediate commit on way to working
matthewturk May 21, 2020
e89bd59
Keep a semi-running tally of bool array collections
matthewturk May 21, 2020
09aacb9
Switch to using BoolArray
matthewturk May 22, 2020
c82a015
Switch to word adding for refined EWAH.
matthewturk May 22, 2020
5c30b9a
Fixing a flake8 error
matthewturk May 22, 2020
a66be30
remove unused unordered_set import
matthewturk May 22, 2020
017768b
Fix testing calls; not working yet.
matthewturk May 23, 2020
d99d87f
Missed a logic check
matthewturk May 25, 2020
c5da911
Use bounded_morton_split_dds in coarse indexing
matthewturk May 26, 2020
ac32bb0
Fencepost error
matthewturk May 26, 2020
e8ce92b
Check for None in append()
matthewturk May 26, 2020
588b50e
Changing to uint32_t for Clang
matthewturk May 26, 2020
6488e10
Try to be more careful with uint/int distinctions.
matthewturk May 26, 2020
26a4ed4
Explicitly cast to uword
matthewturk May 26, 2020
e29599d
Update EWAH to 88b25a3345b82353ccd97a7de6064e6c179a7cc2
matthewturk May 27, 2020
9e1f34e
This fixes a compilation error
jzuhone May 29, 2020
bd1fb35
Make this platform-dependent
jzuhone May 29, 2020
25304b3
Update order-of-include and C++11 for particle_oct_container.pyx
matthewturk May 29, 2020
1384a35
Merge branch 'yt-4.0' into fix_select_mi1mi2
matthewturk May 29, 2020
e5847d8
Update to Bionic as per Kacper's suggestion
matthewturk May 29, 2020
3baa1bc
Merge branch 'fix_select_mi1mi2' of github.com:matthewturk/yt into fi…
matthewturk May 29, 2020
c85827e
Fix a handful of lint and style issues
matthewturk Jun 2, 2020
59290f0
Updating to new answer-store rev
matthewturk Jun 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 13 additions & 17 deletions yt/geometry/particle_oct_container.pyx
Expand Up @@ -1532,11 +1532,10 @@ cdef class ParticleBitmapSelector:
@cython.cdivision(True)
@cython.initializedcheck(False)
cdef void add_coarse(self, np.uint64_t mi1, int bbox = 2):
cdef bint flag_ref = self.is_refined(mi1)
self.coarse_select_bool[mi1] = 1
# Neighbors
if (self.ngz > 0) and (flag_ref == 0):
if (bbox == 2):
if (self.ngz > 0) and (bbox == 2):
if not self.is_refined(mi1):
self.add_neighbors_coarse(mi1)

@cython.boundscheck(False)
Expand All @@ -1563,9 +1562,8 @@ cdef class ParticleBitmapSelector:
cdef int add_refined(self, np.uint64_t mi1, np.uint64_t mi2, int bbox = 2) except -1:
self.refined_select_bool[mi2] = 1
# Neighbors
if (self.ngz > 0):
if (bbox == 2):
self.add_neighbors_refined(mi1, mi2)
if (self.ngz > 0) and (bbox == 2):
self.add_neighbors_refined(mi1, mi2)

@cython.boundscheck(False)
@cython.wraparound(False)
Expand Down Expand Up @@ -1752,11 +1750,10 @@ cdef class ParticleBitmapSelector:
np.uint64_t ind1[3]) except -1:
cdef np.uint64_t imi, fmi
cdef np.uint64_t mi
cdef np.uint64_t indexgap = 1 << (self.bitmap.index_order1 - nlevel)
imi = encode_morton_64bit(ind1[0], ind1[1], ind1[2])
fmi = encode_morton_64bit(
ind1[0]+indexgap-1, ind1[1]+indexgap-1, ind1[2]+indexgap-1)
for mi in range(imi, fmi+1):
cdef np.uint64_t shift_by = 3 * (self.bitmap.index_order1 - nlevel)
imi = encode_morton_64bit(ind1[0], ind1[1], ind1[2]) << shift_by
fmi = imi + (1 << shift_by)
for mi in range(imi, fmi):
matthewturk marked this conversation as resolved.
Show resolved Hide resolved
self.add_coarse(mi, 1)

@cython.boundscheck(False)
Expand All @@ -1767,12 +1764,11 @@ cdef class ParticleBitmapSelector:
np.uint64_t mi1,
np.uint64_t ind2[3]) except -1:
cdef np.uint64_t imi, fmi
cdef np.uint64_t indexgap = 1 << (
self.bitmap.index_order2 - (nlevel - self.bitmap.index_order1))
imi = encode_morton_64bit(ind2[0], ind2[1], ind2[2])
fmi = encode_morton_64bit(
ind2[0]+indexgap-1, ind2[1]+indexgap-1, ind2[2]+indexgap-1)
for mi2 in range(imi, fmi+1):
cdef np.uint64_t shift_by = 3 * ((self.bitmap.index_order2 +
self.bitmap.index_order1) - nlevel)
imi = encode_morton_64bit(ind2[0], ind2[1], ind2[2]) << shift_by
fmi = imi + (1 << shift_by)
for mi2 in range(imi, fmi):
self.add_refined(mi1, mi2, 1)

@cython.boundscheck(False)
Expand Down