Skip to content

Commit

Permalink
Implementation of the mpio driver with selection I/O. (#3222)
Browse files Browse the repository at this point in the history
* This changes the default selection I/O to on for MPIO.
  • Loading branch information
vchoi-hdfgroup authored Aug 7, 2023
1 parent fb38a8b commit 291b2f7
Show file tree
Hide file tree
Showing 12 changed files with 4,182 additions and 295 deletions.
30 changes: 16 additions & 14 deletions src/H5Dio.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,14 @@ H5D__read(size_t count, H5D_dset_io_info_t *dset_info)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode");

/* Only report the collective I/O mode if we're actually performing collective I/O */
if (xfer_mode == H5FD_MPIO_COLLECTIVE)
if (xfer_mode == H5FD_MPIO_COLLECTIVE) {
H5CX_set_mpio_actual_io_mode(io_info.actual_io_mode);

/* If we did selection I/O, report that we used "link chunk" mode, since that's the most
* analogous to what selection I/O does */
if (io_info.use_select_io == H5D_SELECTION_IO_MODE_ON)
H5CX_set_mpio_actual_chunk_opt(H5D_MPIO_LINK_CHUNK);
}
}
#endif /* H5_HAVE_PARALLEL */
}
Expand Down Expand Up @@ -1131,20 +1137,16 @@ H5D__typeinfo_init_phase2(H5D_io_info_t *io_info)
assert(io_info);

/* If selection I/O mode is default (auto), enable it here if the VFD supports it (it will be turned off
* later if something else conflicts), otherwise disable it. If we're using the MPIO VFD, the automatic
* selection will happen in H5D__mpio_opt_possible() inside H5D__ioinfo_adjust(). */
#ifdef H5_HAVE_PARALLEL
if (!io_info->using_mpi_vfd)
#endif /* H5_HAVE_PARALLEL */
if (io_info->use_select_io == H5D_SELECTION_IO_MODE_DEFAULT) {
if (H5F_has_vector_select_io(io_info->dsets_info[0].dset->oloc.file,
io_info->op_type == H5D_IO_OP_WRITE))
io_info->use_select_io = H5D_SELECTION_IO_MODE_ON;
else {
io_info->use_select_io = H5D_SELECTION_IO_MODE_OFF;
io_info->no_selection_io_cause |= H5D_SEL_IO_DEFAULT_OFF;
}
* later if something else conflicts), otherwise disable it */
if (io_info->use_select_io == H5D_SELECTION_IO_MODE_DEFAULT) {
if (H5F_has_vector_select_io(io_info->dsets_info[0].dset->oloc.file,
io_info->op_type == H5D_IO_OP_WRITE))
io_info->use_select_io = H5D_SELECTION_IO_MODE_ON;
else {
io_info->use_select_io = H5D_SELECTION_IO_MODE_OFF;
io_info->no_selection_io_cause |= H5D_SEL_IO_DEFAULT_OFF;
}
}

/* If we're doing type conversion and we might be doing selection I/O, check if the buffers are large
* enough to handle the whole I/O */
Expand Down
22 changes: 3 additions & 19 deletions src/H5Dmpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,9 @@ H5D__mpio_opt_possible(H5D_io_info_t *io_info)
if (!H5FD_mpi_opt_types_g)
local_cause[0] |= H5D_MPIO_MPI_OPT_TYPES_ENV_VAR_DISABLED;

/* Decision on whether to use selection I/O should have been made by now */
assert(io_info->use_select_io != H5D_SELECTION_IO_MODE_DEFAULT);

/* Datatype conversions and transformations are allowed with selection I/O. If the selection I/O mode
* is auto (default), disable collective for now and re-enable later if we can */
if (io_info->use_select_io != H5D_SELECTION_IO_MODE_ON) {
Expand Down Expand Up @@ -731,25 +734,6 @@ H5D__mpio_opt_possible(H5D_io_info_t *io_info)
HMPI_GOTO_ERROR(FAIL, "MPI_Allreduce failed", mpi_code)
} /* end else */

/* If the selection I/O mode is default (auto), decide here whether it should be on or off */
if (io_info->use_select_io == H5D_SELECTION_IO_MODE_DEFAULT) {
/* If the only reason(s) we've disabled collective are type conversions and/or transforms, enable
* selection I/O and re-enable collective I/O since it's supported by selection I/O */
if (global_cause[0] && !(global_cause[0] & ~((unsigned)H5D_MPIO_DATATYPE_CONVERSION |
(unsigned)H5D_MPIO_DATA_TRANSFORMS))) {
assert(!(local_cause[0] &
~((unsigned)H5D_MPIO_DATATYPE_CONVERSION | (unsigned)H5D_MPIO_DATA_TRANSFORMS)));
local_cause[0] = 0;
global_cause[0] = 0;
io_info->use_select_io = H5D_SELECTION_IO_MODE_ON;
}
else {
/* Otherwise, there's currently no benefit to selection I/O, so leave it off */
io_info->use_select_io = H5D_SELECTION_IO_MODE_OFF;
io_info->no_selection_io_cause |= H5D_SEL_IO_DEFAULT_OFF;
}
}

/* Set the local & global values of no-collective-cause in the API context */
H5CX_set_mpio_local_no_coll_cause(local_cause[0]);
H5CX_set_mpio_global_no_coll_cause(global_cause[0]);
Expand Down
Loading

0 comments on commit 291b2f7

Please sign in to comment.