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

Implementation of the mpio driver with selection I/O. #3222

Merged
merged 30 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
25c434e
Implementation of the mpio driver with selection I/O.
vchoi-hdfgroup Jul 3, 2023
45e0709
Committing clang-format changes
github-actions[bot] Jul 3, 2023
a8c0351
Add comments for the changes. Minor modifications to the mpio driver …
vchoi-hdfgroup Jul 6, 2023
c3fee29
Committing clang-format changes
github-actions[bot] Jul 6, 2023
f75cbd3
Correct spelling error.
vchoi-hdfgroup Jul 6, 2023
db37097
Merge branch 'HDFGroup:develop' into new_mpio_develop
vchoi-hdfgroup Jul 11, 2023
d1d5abf
Merge branch 'HDFGroup:develop' into new_mpio_develop
vchoi-hdfgroup Jul 14, 2023
b6cc695
Merge branch 'HDFGroup:develop' into new_mpio_develop
vchoi-hdfgroup Jul 17, 2023
a39f805
Merge branch 'HDFGroup:develop' into new_mpio_develop
vchoi-hdfgroup Jul 19, 2023
56e0ca3
Add tests for the three bugs found when setting H5D_SELECTION_IO_MODE…
vchoi-hdfgroup Jul 19, 2023
41f68d4
Committing clang-format changes
github-actions[bot] Jul 19, 2023
eddb315
Correct spelling error.
vchoi-hdfgroup Jul 19, 2023
6604ad4
Merge branch 'HDFGroup:develop' into new_mpio_develop
vchoi-hdfgroup Jul 24, 2023
accb22f
Merge branch 'HDFGroup:develop' into new_mpio_develop
vchoi-hdfgroup Jul 26, 2023
8b080ec
Merge branch 'HDFGroup:develop' into new_mpio_develop
vchoi-hdfgroup Jul 27, 2023
5f20722
Add tests for selection I/O which are derived from test/vfd.c and mod…
vchoi-hdfgroup Jul 27, 2023
efbe96c
Committing clang-format changes
github-actions[bot] Jul 27, 2023
40c3d64
Correct spelling errors.
vchoi-hdfgroup Jul 27, 2023
83ab87d
Committing clang-format changes
github-actions[bot] Jul 27, 2023
ab7746c
Merge branch 'HDFGroup:develop' into new_mpio_develop
vchoi-hdfgroup Aug 1, 2023
eeb29b2
Merge branch 'develop' into new_mpio_develop
vchoi-hdfgroup Aug 3, 2023
1fadf80
Committing clang-format changes
github-actions[bot] Aug 3, 2023
340cf6b
Merge branch 'HDFGroup:develop' into new_mpio_develop
vchoi-hdfgroup Aug 3, 2023
a1fd1f4
Fix CI failures due ot ";" after macros.
vchoi-hdfgroup Aug 3, 2023
de6a7fd
Committing clang-format changes
github-actions[bot] Aug 3, 2023
8e42490
This changes the default selection I/O to on for MPIO.
vchoi-hdfgroup Aug 4, 2023
dc886ee
Merge branch 'HDFGroup:develop' into new_mpio_develop
vchoi-hdfgroup Aug 5, 2023
d61facc
Fixes for the two issues in PR review:
vchoi-hdfgroup Aug 5, 2023
2621bbb
Committing clang-format changes
github-actions[bot] Aug 5, 2023
3bf430f
Address spelling/grammar errors from PR review.
vchoi-hdfgroup Aug 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
402 changes: 398 additions & 4 deletions src/H5FD.c

Large diffs are not rendered by default.

20 changes: 16 additions & 4 deletions src/H5FDdevelop.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,12 @@ typedef struct H5FD_class_t {
size_t sizes[], void *bufs[]);
herr_t (*write_vector)(H5FD_t *file, hid_t dxpl, uint32_t count, H5FD_mem_t types[], haddr_t addrs[],
size_t sizes[], const void *bufs[]);
herr_t (*read_selection)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, size_t count, hid_t mem_spaces[],
Copy link
Member

Choose a reason for hiding this comment

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

I understand we want to keep things consistent but if we're going to change the API to keep the count parameter the same type we should change it to size_t. I think we should just lave it alone for now though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So I will keep as size_t for read_selection() and write_selection()? But as uint32_t for write_vector and read_vector?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah I don't think we should change it now, it's already part of the API

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just want to double-check:
as size_t will be used for all APIs and the related intermediate routines:
H5FDread/write_selection(), H5FDread/write_vector_from_selection(), H5FDread/write_from_selection()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

correction to previous comment: "count" as size_t

Copy link
Member

Choose a reason for hiding this comment

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

Don't change any APIs right now, thanks, just revert the type change to the H5FD_class_t struct

herr_t (*read_selection)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uint32_t count, hid_t mem_spaces[],
hid_t file_spaces[], haddr_t offsets[], size_t element_sizes[],
void *bufs[] /*out*/);
herr_t (*write_selection)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, size_t count, hid_t mem_spaces[],
hid_t file_spaces[], haddr_t offsets[], size_t element_sizes[],
const void *bufs[] /*in*/);
herr_t (*write_selection)(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uint32_t count,
hid_t mem_spaces[], hid_t file_spaces[], haddr_t offsets[],
size_t element_sizes[], const void *bufs[] /*in*/);
herr_t (*flush)(H5FD_t *file, hid_t dxpl_id, hbool_t closing);
herr_t (*truncate)(H5FD_t *file, hid_t dxpl_id, hbool_t closing);
herr_t (*lock)(H5FD_t *file, hbool_t rw);
Expand Down Expand Up @@ -281,6 +281,18 @@ H5_DLL herr_t H5FDread_selection(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id,
H5_DLL herr_t H5FDwrite_selection(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uint32_t count,
hid_t mem_spaces[], hid_t file_spaces[], haddr_t offsets[],
size_t element_sizes[], const void *bufs[]);
H5_DLL herr_t H5FDread_vector_from_selection(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uint32_t count,
hid_t mem_spaces[], hid_t file_spaces[], haddr_t offsets[],
size_t element_sizes[], void *bufs[] /* out */);
H5_DLL herr_t H5FDwrite_vector_from_selection(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uint32_t count,
hid_t mem_spaces[], hid_t file_spaces[], haddr_t offsets[],
size_t element_sizes[], const void *bufs[] /* in */);
H5_DLL herr_t H5FDread_from_selection(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uint32_t count,
hid_t mem_space_ids[], hid_t file_space_ids[], haddr_t offsets[],
size_t element_sizes[], void *bufs[] /* out */);
H5_DLL herr_t H5FDwrite_from_selection(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, uint32_t count,
hid_t mem_space_ids[], hid_t file_space_ids[], haddr_t offsets[],
size_t element_sizes[], const void *bufs[] /* in */);
H5_DLL herr_t H5FDflush(H5FD_t *file, hid_t dxpl_id, hbool_t closing);
H5_DLL herr_t H5FDtruncate(H5FD_t *file, hid_t dxpl_id, hbool_t closing);
H5_DLL herr_t H5FDlock(H5FD_t *file, hbool_t rw);
Expand Down
709 changes: 592 additions & 117 deletions src/H5FDint.c

Large diffs are not rendered by default.

1,025 changes: 980 additions & 45 deletions src/H5FDmpio.c

Large diffs are not rendered by default.

36 changes: 31 additions & 5 deletions src/H5FDprivate.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ typedef struct {
} \
}

#define SKIP_NO_CB 0x00u
#define SKIP_SELECTION_CB 0x01u
#define SKIP_VECTOR_CB 0x02u

/* Define structure to hold driver ID, info & configuration string for FAPLs */
typedef struct {
hid_t driver_id; /* Driver's ID */
Expand Down Expand Up @@ -149,12 +153,27 @@ H5_DLL herr_t H5FD_read_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count
H5_DLL herr_t H5FD_write_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, struct H5S_t **mem_spaces,
struct H5S_t **file_spaces, haddr_t offsets[], size_t element_sizes[],
const void *bufs[]);
H5_DLL herr_t H5FD_read_selection_id(H5FD_t *file, H5FD_mem_t type, uint32_t count, hid_t mem_space_ids[],
hid_t file_space_ids[], haddr_t offsets[], size_t element_sizes[],
void *bufs[] /* out */);
H5_DLL herr_t H5FD_write_selection_id(H5FD_t *file, H5FD_mem_t type, uint32_t count, hid_t mem_space_ids[],
H5_DLL herr_t H5FD_read_selection_id(uint32_t skip_cb, H5FD_t *file, H5FD_mem_t type, uint32_t count,
hid_t mem_space_ids[], hid_t file_space_ids[], haddr_t offsets[],
size_t element_sizes[], void *bufs[] /* out */);
H5_DLL herr_t H5FD_write_selection_id(uint32_t skip_cb, H5FD_t *file, H5FD_mem_t type, uint32_t count,
hid_t mem_space_ids[], hid_t file_space_ids[], haddr_t offsets[],
size_t element_sizes[], const void *bufs[]);
H5_DLL herr_t H5FD_read_vector_from_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count,
hid_t mem_space_ids[], hid_t file_space_ids[],
haddr_t offsets[], size_t element_sizes[], void *bufs[]);

H5_DLL herr_t H5FD_write_vector_from_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count,
hid_t mem_space_ids[], hid_t file_space_ids[],
haddr_t offsets[], size_t element_sizes[], const void *bufs[]);

H5_DLL herr_t H5FD_read_from_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, hid_t mem_space_ids[],
hid_t file_space_ids[], haddr_t offsets[], size_t element_sizes[],
const void *bufs[]);
void *bufs[]);

H5_DLL herr_t H5FD_write_from_selection(H5FD_t *file, H5FD_mem_t type, uint32_t count, hid_t mem_space_ids[],
hid_t file_space_ids[], haddr_t offsets[], size_t element_sizes[],
const void *bufs[]);
H5_DLL herr_t H5FD_flush(H5FD_t *file, hbool_t closing);
H5_DLL herr_t H5FD_truncate(H5FD_t *file, hbool_t closing);
H5_DLL herr_t H5FD_lock(H5FD_t *file, hbool_t rw);
Expand All @@ -171,6 +190,13 @@ H5_DLL herr_t H5FD_sort_vector_io_req(hbool_t *vector_was_sorted, uint32_t count
haddr_t addrs[], size_t sizes[], H5_flexible_const_ptr_t bufs[],
H5FD_mem_t **s_types_ptr, haddr_t **s_addrs_ptr, size_t **s_sizes_ptr,
H5_flexible_const_ptr_t **s_bufs_ptr);

H5_DLL herr_t H5FD_sort_selection_io_req(hbool_t *selection_was_sorted, uint32_t _count,
hid_t mem_space_ids[], hid_t file_space_ids[], haddr_t offsets[],
size_t element_sizes[], H5_flexible_const_ptr_t bufs[],
hid_t **s_mem_space_ids, hid_t **s_file_space_ids,
haddr_t **s_offsets_ptr, size_t **s_element_sizes_ptr,
H5_flexible_const_ptr_t **s_bufs_ptr);
H5_DLL herr_t H5FD_init(void);

/* Function prototypes for MPI based VFDs*/
Expand Down
24 changes: 20 additions & 4 deletions test/select_io_dset.c
Original file line number Diff line number Diff line change
Expand Up @@ -2751,9 +2751,6 @@ test_set_get_select_io_mode(hid_t fid)
if (H5Pget_selection_io(dxpl, &selection_io_mode) < 0)
TEST_ERROR;

if (selection_io_mode != H5D_SELECTION_IO_MODE_DEFAULT)
TEST_ERROR;

/* Disable case */
if (H5Pset_selection_io(dxpl, H5D_SELECTION_IO_MODE_OFF) < 0)
TEST_ERROR;
Expand Down Expand Up @@ -3063,11 +3060,29 @@ static herr_t
test_get_no_selection_io_cause(const char *filename, hid_t fapl)
{

int errs = 0;
hid_t dxpl = H5I_INVALID_HID;
H5D_selection_io_mode_t selection_io_mode;
int errs = 0;

printf("\n");
TESTING("H5Pget_no_selection_io_cause()");

if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0)
FAIL_STACK_ERROR;

if (H5Pget_selection_io(dxpl, &selection_io_mode) < 0)
TEST_ERROR;

if (H5Pclose(dxpl) < 0)
FAIL_STACK_ERROR;

/* The following tests are based on H5D_SELECTION_IO_MODE_DEFAULT as the
default setting in the library; skip the tests if that is not true */
if (selection_io_mode != H5D_SELECTION_IO_MODE_DEFAULT) {
SKIPPED();
return SUCCEED;
}

errs += test_no_selection_io_cause_mode(filename, fapl, TEST_DISABLE_BY_API);
errs += test_no_selection_io_cause_mode(filename, fapl, TEST_NOT_CONTIGUOUS_OR_CHUNKED_DATASET);
errs += test_no_selection_io_cause_mode(filename, fapl, TEST_CONTIGUOUS_SIEVE_BUFFER);
Expand All @@ -3083,6 +3098,7 @@ test_get_no_selection_io_cause(const char *filename, hid_t fapl)
errs += test_no_selection_io_cause_mode(filename, fapl, TEST_PAGE_BUFFER);
#endif

error:
if (errs) {
printf(" FAILED\n");
return FAIL;
Expand Down
Loading