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

Support H5Dset_extent #49

Merged
merged 3 commits into from
Nov 9, 2023

Conversation

mattjala
Copy link
Collaborator

@mattjala mattjala commented Aug 4, 2023

In order to keep track of whether two open datasets reference the same dataset, and should share information about their dataspace, I introduced RV_type_info_array_g, a global array keeping track of opened objects in the REST VOL, similar to the library's H5I_type_info_array_g.

Addresses #44.

@mattjala mattjala added the enhancement New feature or request label Aug 4, 2023
@@ -1473,8 +1473,6 @@ test_unused_file_API_calls(void)

if (H5Fflush(file_id, H5F_SCOPE_GLOBAL) >= 0)
TEST_ERROR
if (H5Fget_obj_count(file_id, H5F_OBJ_DATASET) >= 0)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is supported now, so it's no longer expected to fail. Actual tests for it are in h5vl_test.

@mattjala mattjala force-pushed the set_extent_get_object_count branch from f41abd2 to 054aa91 Compare August 7, 2023 16:02
mattjala added a commit to mattjala/vol-rest that referenced this pull request Sep 25, 2023
This implementation doesn't use RV_type_info_array_g, unlike the proposed version in HDFGroup#49.

H5Fget_obj_count, when file_id = H5F_OBJ_ALL, erroneously counts copied transient datatypes as open objects. This is especially noticeable since the VOL copies the datatype whenever it creates an attribute or a dataset. This is an inherited issue from the HDF5 library itself and needs to be fixed there (see HDFGroup/hdf5#3316).
@mattjala mattjala marked this pull request as draft September 25, 2023 15:23
mattjala added a commit to mattjala/vol-rest that referenced this pull request Sep 25, 2023
This implementation doesn't use RV_type_info_array_g, unlike the proposed version in HDFGroup#49.

H5Fget_obj_count, when file_id = H5F_OBJ_ALL, erroneously counts copied transient datatypes as open objects. This is especially noticeable since the VOL copies the datatype whenever it creates an attribute or a dataset. This is an inherited issue from the HDF5 library itself and needs to be fixed there (see HDFGroup/hdf5#3316).
mattjala added a commit to mattjala/vol-rest that referenced this pull request Sep 28, 2023
This implementation doesn't use RV_type_info_array_g, unlike the proposed version in HDFGroup#49.

H5Fget_obj_count, when file_id = H5F_OBJ_ALL, erroneously counts copied transient datatypes as open objects. This is especially noticeable since the VOL copies the datatype whenever it creates an attribute or a dataset. This is an inherited issue from the HDF5 library itself and needs to be fixed there (see HDFGroup/hdf5#3316).
@mattjala mattjala changed the title Support H5Dset_extent, H5Fget_obj_count Support H5Dset_extent Oct 2, 2023
@mattjala mattjala marked this pull request as ready for review October 2, 2023 16:53
/* If this is another view of an already-opened dataset, make them share the same dataspace
* so that changes to it (e.g. resizes) are visible to both views */
while (rv_hash_table_iter_has_more(&iterator)) {
other_dataset = (RV_object_t *)rv_hash_table_iter_next(&iterator);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine for now functionality wise, but we need a better solution for this rather than iterating through the hash table on each dataset open. I'd suggest refactoring this whole PR later where rather than inserting each object pointer into a hash table for the ID type, we hash the object's URI and insert that hashed value into the hash table for the ID type. Then, on each dataset (of other object) open, you only need to hash the URI here and do a single lookup to see if an object with this URI is already open.

if (CURLE_OK != curl_easy_setopt(curl, CURLOPT_URL, request_url))
FUNC_GOTO_ERROR(H5E_SYM, H5E_CANTSET, FAIL, "can't set cURL request URL: %s", curl_err_buf);

/* First, make a GET request for the dataset's dataspace to do some checks */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd assume we should already have this information locally as a result of the create/open request? Is there a case where we need updated information from the server?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This call (and the later once to get DCPL) were redundant - removed in #99

@jhendersonHDF jhendersonHDF merged commit afccfc9 into HDFGroup:master Nov 9, 2023
10 checks passed
@mattjala mattjala mentioned this pull request Nov 9, 2023
@mattjala mattjala deleted the set_extent_get_object_count branch November 13, 2023 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants