mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-12-27 08:01:04 +08:00
Fix bugs in test/vfd.c (#1538)
* Added support for vector I/O calls to the VFD layer, and associated test code. Note that this includes the optimization to allow shortened sizes and types arrays to allow more space efficient representations of vectors in which all entries are of the same size and/or type. See the Selection I/o RFC for further details. Tested serial and parallel, debug and production on Charis. serial and parallel debug only on Jelly. * ran code formatter quick serial build and test on jelly * Add H5FD_read_selection() and H5FD_write_selection(). Currently only translate to scalar calls. Fix const buf in H5FD_write_vector(). * Format source * Fix comments * Added vector read / write support to the MPIO VFD, with associated test code (see testpar/t_vfd.c). Note that this implementation does NOT support vector entries of size greater than 2 GB. This must be repaired before release, but it should be good enough for correctness testing. As MPIO requires vector I/O requests to be sorted in increasing address order, also added a vector sort utility in H5FDint.c This function is tested in passing by the MPIO vector I/O extension. In passing, repaired a bug in size / type vector extension management in H5FD_read/write_vector() Tested parallel debug and production on charis and Jelly. * Ran source code formatter * Minor optimization to vector I/O request sort routine. Tested parallel / debug on Jelly. * Add selection I/O to chunk code, used when: not using chunk cache, no datatype conversion, no I/O filters, no page buffer, not using collective I/O. Requires global variable H5_use_selection_io_g be set to TRUE. Implemented selection to vector I/O transaltion at the file driver layer. * Fix formatting unrelated to previous change to stop github from complaining. * Add full API support for selection I/O. Add tests for this. * Added "ctl" callback to the VFD interfance, and the associated H5FDctl() and H5FD_ctl() calls. Modified the MPIO VFD accordingly -- specifically: Added ctl() call with op-code support to expose rank, size, and communicator. Modified H5FD_mpi_get_rank(), H5FD_mpi_get_size(), and H5FD_mpi_get_comm() to use the new ctl() callback. In passing removed the const qualifier from the file parameter of these functions, as the file parameter of the ctl callback is not const. Deleted the old H5FD__mpio_mpi_rank(), H5FD__mpio_mpi_size(), and H5FD__mpio_communicator() calls from the MPIO VFD. Deleted H5FD_class_mpi_t from H5FDprivate.h, and modified the MPIO VFD accordingly. Note that all VFDs now use H5FD_class_t, with no special class for VFDs that that support MPI. Some minor touch ups to the Neil's selection I/O mods in passing. Tested serial and parallel, debug and production on charis and jelly. * Implement selection I/O for contiguous datasets. Fix bug in selection I/O translation. Add const qualifiers to some internal selection I/O routines to maintain const-correctness while avoiding memcpys. * Add support for independent parallel I/O with selection I/O. Add HDF5_USE_SELECTION_IO env var to control selection I/O (default off). * Implement parallel collective support for selection I/O. * Fix comments and run formatter. * Committing clang-format changes * Run formatter * Update selection IO branch with develop (#1215) Merged branch 'develop' into selection_io * Sync with develop (#1262) Updated the branch with develop changes. * Committing clang-format changes * fixed spelling (#1353) * Implement big I/O support for vector I/O requests in the MPIO file driver. * Committing clang-format changes * Update dummy file driver in h5test.c to match new struct. * Fix another outdated H5FD_class_t struct. * Free arrays in H5FD__mpio_read/write_vector() as soon as they're not needed, to cut down on memory usage during I/O. * Committing clang-format changes * Address comments from code review. Fix const warnings with H5S_SEL_ITER_INIT(). * Committing clang-format changes * Fix warnings in selection I/O code * Refactor H5FD__mpio_read/write_vector() to bring common code for constructing MPI Datatype into a shared function. * Committing clang-format changes * Fix bugs in selection I/O code. * Fix bugs in selection I/O code * Address comments from review. Add "version" field to H5FD_class_t struct and accompanying H5FD_CLASS_VERSION macro. * Committing clang-format changes * Committing clang-format changes * Address comments from selection I/O PR * Committing clang-format changes * Fix spelling * Fix bugs int test/vfd.c Co-authored-by: mainzer <mainzer#hdfgroup.org> Co-authored-by: jrmainzer <72230804+jrmainzer@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Scot Breitenfeld <brtnfld@hdfgroup.org>
This commit is contained in:
parent
80f9af144c
commit
0d3182c7da
11
test/vfd.c
11
test/vfd.c
@ -4399,7 +4399,6 @@ test_vector_io__verify_v(uint32_t count, H5FD_mem_t types[], size_t sizes[], voi
|
|||||||
hbool_t verbose = TRUE;
|
hbool_t verbose = TRUE;
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
size_t j;
|
size_t j;
|
||||||
uint32_t buf_size;
|
|
||||||
char * w_buf;
|
char * w_buf;
|
||||||
char * r_buf;
|
char * r_buf;
|
||||||
const char *mem_type_names[7] = {"H5FD_MEM_DEFAULT", "H5FD_MEM_SUPER", "H5FD_MEM_BTREE", "H5FD_MEM_DRAW",
|
const char *mem_type_names[7] = {"H5FD_MEM_DEFAULT", "H5FD_MEM_SUPER", "H5FD_MEM_BTREE", "H5FD_MEM_DRAW",
|
||||||
@ -4429,7 +4428,7 @@ test_vector_io__verify_v(uint32_t count, H5FD_mem_t types[], size_t sizes[], voi
|
|||||||
|
|
||||||
HDfprintf(stdout, "\n\nread/write buf mismatch in vector/entry");
|
HDfprintf(stdout, "\n\nread/write buf mismatch in vector/entry");
|
||||||
HDfprintf(stdout, "\"%s\"/%u at offset %llu/%llu w/r = %c/%c type = %s\n\n", name,
|
HDfprintf(stdout, "\"%s\"/%u at offset %llu/%llu w/r = %c/%c type = %s\n\n", name,
|
||||||
(unsigned)i, (long long unsigned)j, (long long unsigned)buf_size, w_buf[j],
|
(unsigned)i, (long long unsigned)j, (long long unsigned)size, w_buf[j],
|
||||||
r_buf[j], mem_type_names[type]);
|
r_buf[j], mem_type_names[type]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5521,6 +5520,7 @@ test_selection_io(const char *vfd_name)
|
|||||||
/* Update file buf */
|
/* Update file buf */
|
||||||
for (i = 0, i2 = 1, j2 = 0; i < SEL_IO_DIM0; i++)
|
for (i = 0, i2 = 1, j2 = 0; i < SEL_IO_DIM0; i++)
|
||||||
for (j = 1; j < SEL_IO_DIM1; j += 2) {
|
for (j = 1; j < SEL_IO_DIM1; j += 2) {
|
||||||
|
HDassert(i2 < SEL_IO_DIM0);
|
||||||
fbuf2[i2][j2] = wbuf2[i][j];
|
fbuf2[i2][j2] = wbuf2[i][j];
|
||||||
if (++j2 == SEL_IO_DIM1) {
|
if (++j2 == SEL_IO_DIM1) {
|
||||||
i2 += 2;
|
i2 += 2;
|
||||||
@ -5582,9 +5582,10 @@ test_selection_io(const char *vfd_name)
|
|||||||
|
|
||||||
/* Update file buf */
|
/* Update file buf */
|
||||||
for (i = 1, i2 = 0, j2 = 1; i < (SEL_IO_DIM0 * SEL_IO_DIM1); i += 2) {
|
for (i = 1, i2 = 0, j2 = 1; i < (SEL_IO_DIM0 * SEL_IO_DIM1); i += 2) {
|
||||||
|
HDassert(i2 < SEL_IO_DIM0);
|
||||||
fbuf2[i2][j2] = wbuf1[i];
|
fbuf2[i2][j2] = wbuf1[i];
|
||||||
j2 += 2;
|
j2 += 2;
|
||||||
if (j2 == SEL_IO_DIM1) {
|
if (j2 >= SEL_IO_DIM1) {
|
||||||
i2++;
|
i2++;
|
||||||
j2 = 1;
|
j2 = 1;
|
||||||
}
|
}
|
||||||
@ -5643,6 +5644,7 @@ test_selection_io(const char *vfd_name)
|
|||||||
/* Update file buf */
|
/* Update file buf */
|
||||||
for (i = 0, i2 = 0; i < SEL_IO_DIM0; i += 2)
|
for (i = 0, i2 = 0; i < SEL_IO_DIM0; i += 2)
|
||||||
for (j = 0; j < SEL_IO_DIM1; j++) {
|
for (j = 0; j < SEL_IO_DIM1; j++) {
|
||||||
|
HDassert(i2 < (SEL_IO_DIM0 * SEL_IO_DIM1));
|
||||||
fbuf1[i2] = wbuf2[i][j];
|
fbuf1[i2] = wbuf2[i][j];
|
||||||
i2 += 2;
|
i2 += 2;
|
||||||
}
|
}
|
||||||
@ -5726,6 +5728,7 @@ test_selection_io(const char *vfd_name)
|
|||||||
fbuf1[(2 * i) + 1] = wbuf1[2 * i];
|
fbuf1[(2 * i) + 1] = wbuf1[2 * i];
|
||||||
for (i = 1, i2 = 0, j2 = 1; i < SEL_IO_DIM0; i += 2)
|
for (i = 1, i2 = 0, j2 = 1; i < SEL_IO_DIM0; i += 2)
|
||||||
for (j = 0; j < SEL_IO_DIM1; j++) {
|
for (j = 0; j < SEL_IO_DIM1; j++) {
|
||||||
|
HDassert(i2 < SEL_IO_DIM0);
|
||||||
fbuf2[i2][j2] = wbuf2[i][j];
|
fbuf2[i2][j2] = wbuf2[i][j];
|
||||||
j2 += 2;
|
j2 += 2;
|
||||||
if (j2 >= SEL_IO_DIM1) {
|
if (j2 >= SEL_IO_DIM1) {
|
||||||
@ -5834,6 +5837,7 @@ test_selection_io(const char *vfd_name)
|
|||||||
* find 1D index into 2D array */
|
* find 1D index into 2D array */
|
||||||
for (i = 0, i2 = 0, j2 = 0; i < SEL_IO_DIM0; i += 2)
|
for (i = 0, i2 = 0, j2 = 0; i < SEL_IO_DIM0; i += 2)
|
||||||
for (j = 0; j < SEL_IO_DIM1; j++) {
|
for (j = 0; j < SEL_IO_DIM1; j++) {
|
||||||
|
HDassert(i2 < SEL_IO_DIM0);
|
||||||
fbuf1[(i2 * SEL_IO_DIM1) + j2] = wbuf2[i][j];
|
fbuf1[(i2 * SEL_IO_DIM1) + j2] = wbuf2[i][j];
|
||||||
j2 += 2;
|
j2 += 2;
|
||||||
if (j2 >= SEL_IO_DIM1) {
|
if (j2 >= SEL_IO_DIM1) {
|
||||||
@ -5843,6 +5847,7 @@ test_selection_io(const char *vfd_name)
|
|||||||
}
|
}
|
||||||
for (i = 1, i2 = 0, j2 = 1; i < SEL_IO_DIM0; i += 2)
|
for (i = 1, i2 = 0, j2 = 1; i < SEL_IO_DIM0; i += 2)
|
||||||
for (j = 0; j < SEL_IO_DIM1; j++) {
|
for (j = 0; j < SEL_IO_DIM1; j++) {
|
||||||
|
HDassert(i2 < SEL_IO_DIM0);
|
||||||
fbuf2[i2][j2] = wbuf2[i][j];
|
fbuf2[i2][j2] = wbuf2[i][j];
|
||||||
j2 += 2;
|
j2 += 2;
|
||||||
if (j2 >= SEL_IO_DIM1) {
|
if (j2 >= SEL_IO_DIM1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user