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

Integrate shared chunk cache (H5SC) package with upper layers of library #5246

Open
wants to merge 12 commits into
base: feature/sparse_data
Choose a base branch
from

Conversation

fortnern
Copy link
Member

Also some updates to shared chunk cache interface, and other general fixes. Non functional currently since the shared chunk cache hasn't been implemented.

src/H5Dio.c Outdated Show resolved Hide resolved
src/H5Dio.c Show resolved Hide resolved
if (dset->shared->layout.sc_ops) {
H5D_chunk_scc_udata_t udata;
size_t buf_size = SIZE_MAX;
assert(0 && "set up the buf size from API when available. Either point directly into args "
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this hardcoded assertion failure supposed to be left in for now?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. We should be updating the API soon and will be able to get rid of this assertion.

@@ -2900,6 +2900,40 @@ H5CX_set_mpio_actual_chunk_opt(H5D_mpio_actual_chunk_opt_mode_t mpio_actual_chun
FUNC_LEAVE_NOAPI_VOID
} /* end H5CX_set_mpio_actual_chunk_opt() */

/*-------------------------------------------------------------------------
Copy link
Member Author

Choose a reason for hiding this comment

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

Added these since this should be more convenient than get/or/set. I think we could possibly use these in a few more places instead of tracking the property in a separate variable.

@@ -8222,20 +8234,16 @@ H5D__chunk_iter(H5D_t *dset, H5D_chunk_iter_op_t op, void *op_data)
} /* end H5D__chunk_iter() */

/*-------------------------------------------------------------------------
* Function: H5D__chunk_get_offset_copy
* Function: H5D__chunk_verify_offset
Copy link
Member Author

Choose a reason for hiding this comment

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

Turns out nothing in the direct chunk code modifes the offset array so there's no need to copy it and we can just pass it directly from the user qualified as const. Added this function to perform verification.

/* Perform second phase of type info initialization */
if (H5D__typeinfo_init_phase2(&io_info) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set up type info (second phase)");
/* Initialize type info differently depending on if weŕe using the shared chunk cache or not */
Copy link
Member Author

Choose a reason for hiding this comment

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

The shared chunk cache will need to perform its own type conversion initialization.

@@ -115,6 +115,13 @@
/* Package Private Typedefs */
/****************************/

/* Typedef for cached dataset creation property list information */
typedef struct H5D_dcpl_cache_t {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is not used outside of the H5D package so I demoted it to this header to minimize issues with circular dependencies

0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read unprocessed chunk data");
/* Read the raw chunk */
if (H5D__chunk_direct_read(dset, chunk_read_args->offset, &chunk_read_args->filters,
Copy link
Member Author

Choose a reason for hiding this comment

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

Checking the validity of the offset is layout specific and has been moved to H5Dchunk.c for the chunked non-SCC case.

@@ -235,6 +235,9 @@ test_sparse_direct_chunk(hid_t fapl)

TESTING("APIs for direct chunk I/O on structured chunks");

SKIPPED();
Copy link
Member Author

Choose a reason for hiding this comment

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

Skipped since struct chunk direct I/O requires a shared chunk cache client implementation, which we don't have yet.

src/H5SCprivate.h Outdated Show resolved Hide resolved
src/H5SCprivate.h Outdated Show resolved Hide resolved
@mattjala mattjala added Merge - Develop Only This cannot be merged to previous versions of HDF5 (file format or breaking API changes) Priority - 2. Medium ⏹ It would be nice to have this in the next release Component - C Library Core C library issues (usually in the src directory) Type - New Feature Add a new API call, functionality, or tool labels Jan 23, 2025
@qkoziol
Copy link
Contributor

qkoziol commented Jan 31, 2025

@fortnern - Is this ready (enough :-) to review?

@fortnern
Copy link
Member Author

fortnern commented Feb 4, 2025

@fortnern - Is this ready (enough :-) to review?

You're welcome to review it if you like. It's nowhere near production ready yet though - just part of the machinery for the shared chunk cache (designed to support sparse chunks), which hasn't been implemented yet. Note the PR is to a feature branch not develop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - C Library Core C library issues (usually in the src directory) Merge - Develop Only This cannot be merged to previous versions of HDF5 (file format or breaking API changes) Priority - 2. Medium ⏹ It would be nice to have this in the next release Type - New Feature Add a new API call, functionality, or tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants