-
-
Notifications
You must be signed in to change notification settings - Fork 307
Add internal spatial tree #5800
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
Conversation
adaa2c7
to
b8620f9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CMake changes looks good.
src/H5private.h
Outdated
void *wrapper_arg, | ||
#endif | ||
const void *a, const void *b | ||
#if !defined(H5_HAVE_WIN32_API) && !defined(H5_HAVE_DARWIN) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little messy, but seems to be about what we need to do this portably.
It seems you don't need this section of #ifdefs due to this wrapper only being needed for platforms where the ordering is the same (void *, const void *, const void *
), so this can probably be simplified to just HDqsort_r_wrapper_func(void *, const void *, const void *)
.
This section of code looks good, though should probably follow our usual conventions for portability wrappers:
- All the actual code here (struct definition,
HDqsort_r_wrapper_func()
andHDqsort_r()
) should be moved to H5system.c, just to keep as much non-macro code out of H5private.h as possible.HDqsort_r_wrapper_func()
can remain static there, butHDqsort_r()
should be made available and probably named differently since we want a single macro calledHDqsort_r
that just wrapsqsort_r()
on GNU systems and points to theHDqsort_r()
function (named differently) on other systems that need the swapping. Don't worry about addinginline
to the functions; it probably won't make much of a difference. - There should be a section in H5win32defs.h which defines a
HDqsort_r
macro and maps it to the differently-named function in H5system.c - The macro in this file should be surrounded by an
#ifndef HDqsort_r
/#endif
pair - The macro in this file can retain the logic for
#ifdef H5_HAVE_DARWIN
, where it will map to the function in H5system.c and otherwise just map toqsort_r
on GNU systems as it currently does - Also note that
qsort_r
on some BSDs also appears to have the flipped arguments, which is something we'll probably want to deal with. For example, the argument order is flipped up to FreeBSD 13.5, but appears to have been changed to GNU ordering in FreeBSD 14.0 (see https://cgit.freebsd.org/src/commit/?id=af3c78886fd8). More research would be needed on OpenBSD and others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on that commit, I wonder if we can get away with using generics here since we require C11 now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last minor comment; thanks for the changes to give us a generic qsort_r
-like macro! We can make improvements with C11 generics later.
Implement an r-tree data structure in a new module. It has three exposed methods: creation, destruction, and search.
The STR algorithm used during creation is based on the one described here.
This will be used to optimize VDS operations in an upcoming PR.
Important
Introduces an R-tree data structure with creation, search, and destruction methods, integrated into the build system and validated with new tests.
H5RT.c
with methodsH5RT_create()
,H5RT_search()
, andH5RT_free()
.CMakeLists.txt
to includeH5RT.c
and related headers.rtree.c
test file to validate R-tree creation and search functionalities.test/CMakeLists.txt
to includertree
in test suite.This description was created by
for 1b8ba58. You can customize this summary. It will automatically update as commits are pushed.