summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@lbl.gov>2020-09-02 13:14:54 (GMT)
committerQuincey Koziol <koziol@lbl.gov>2020-09-02 13:14:54 (GMT)
commit0f60e7e5761e376fafec6f379d548d1df6e1fcc3 (patch)
treec3cf31dc3c8c1ee49dc700863dd48e8be5214ddf
parent3a2fd099410acd486336824a17da99a8355fce79 (diff)
parent4b69577e10ed58bf6536599092390f02a49ff3f9 (diff)
downloadhdf5-0f60e7e5761e376fafec6f379d548d1df6e1fcc3.zip
hdf5-0f60e7e5761e376fafec6f379d548d1df6e1fcc3.tar.gz
hdf5-0f60e7e5761e376fafec6f379d548d1df6e1fcc3.tar.bz2
Merge pull request #2843 in HDFFV/hdf5 from vol_dataset_io_dxpl_fix to develop
* commit '4b69577e10ed58bf6536599092390f02a49ff3f9': Bug fix to allow pass-through VOL connectors to set DXPL properties (like requesting collective operations) on dataset I/O
-rw-r--r--src/H5Dio.c12
-rw-r--r--src/H5VLnative_dataset.c16
2 files changed, 13 insertions, 15 deletions
diff --git a/src/H5Dio.c b/src/H5Dio.c
index a972e00..63ae221 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -184,9 +184,6 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms")
- /* Set DXPL for operation */
- H5CX_set_dxpl(dxpl_id);
-
/* Read the data */
if ((ret_value = H5VL_dataset_read(vol_obj, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, H5_REQUEST_NULL)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data")
@@ -235,9 +232,6 @@ H5Dread_chunk(hid_t dset_id, hid_t dxpl_id, const hsize_t *offset, uint32_t *fil
if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "dxpl_id is not a dataset transfer property list ID")
- /* Set DXPL for operation */
- H5CX_set_dxpl(dxpl_id);
-
/* Read the raw chunk */
if(H5VL_dataset_optional(vol_obj, H5VL_NATIVE_DATASET_CHUNK_READ, dxpl_id, H5_REQUEST_NULL, offset, filters, buf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read unprocessed chunk data")
@@ -306,9 +300,6 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id,
if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not xfer parms")
- /* Set DXPL for operation */
- H5CX_set_dxpl(dxpl_id);
-
/* Write the data */
if ((ret_value = H5VL_dataset_write(vol_obj, mem_type_id, mem_space_id, file_space_id, dxpl_id, buf, H5_REQUEST_NULL)) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data")
@@ -363,9 +354,6 @@ H5Dwrite_chunk(hid_t dset_id, hid_t dxpl_id, uint32_t filters, const hsize_t *of
if (TRUE != H5P_isa_class(dxpl_id, H5P_DATASET_XFER))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "dxpl_id is not a dataset transfer property list ID")
- /* Set DXPL for operation */
- H5CX_set_dxpl(dxpl_id);
-
/* Write chunk */
if(H5VL_dataset_optional(vol_obj, H5VL_NATIVE_DATASET_CHUNK_WRITE, dxpl_id, H5_REQUEST_NULL, filters, offset, data_size_32, buf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write unprocessed chunk data")
diff --git a/src/H5VLnative_dataset.c b/src/H5VLnative_dataset.c
index 3f62e00..c3cfdcd 100644
--- a/src/H5VLnative_dataset.c
+++ b/src/H5VLnative_dataset.c
@@ -18,6 +18,7 @@
#define H5D_FRIEND /* Suppress error about including H5Dpkg */
#include "H5private.h" /* Generic Functions */
+#include "H5CXprivate.h" /* API Contexts */
#include "H5Dpkg.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
#include "H5Fprivate.h" /* Files */
@@ -142,7 +143,7 @@ done:
*/
herr_t
H5VL__native_dataset_read(void *obj, hid_t mem_type_id, hid_t mem_space_id,
- hid_t file_space_id, hid_t H5_ATTR_UNUSED dxpl_id, void *buf,
+ hid_t file_space_id, hid_t dxpl_id, void *buf,
void H5_ATTR_UNUSED **req)
{
H5D_t *dset = (H5D_t *)obj;
@@ -162,6 +163,9 @@ H5VL__native_dataset_read(void *obj, hid_t mem_type_id, hid_t mem_space_id,
if(H5S_get_validated_dataspace(file_space_id, &file_space) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not get a validated dataspace from file_space_id")
+ /* Set DXPL for operation */
+ H5CX_set_dxpl(dxpl_id);
+
/* Read raw data */
if(H5D__read(dset, mem_type_id, mem_space, file_space, buf/*out*/) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data")
@@ -182,7 +186,7 @@ done:
*/
herr_t
H5VL__native_dataset_write(void *obj, hid_t mem_type_id, hid_t mem_space_id,
- hid_t file_space_id, hid_t H5_ATTR_UNUSED dxpl_id, const void *buf,
+ hid_t file_space_id, hid_t dxpl_id, const void *buf,
void H5_ATTR_UNUSED **req)
{
H5D_t *dset = (H5D_t *)obj;
@@ -202,6 +206,9 @@ H5VL__native_dataset_write(void *obj, hid_t mem_type_id, hid_t mem_space_id,
if(H5S_get_validated_dataspace(file_space_id, &file_space) < 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "could not get a validated dataspace from file_space_id")
+ /* Set DXPL for operation */
+ H5CX_set_dxpl(dxpl_id);
+
/* Write the data */
if(H5D__write(dset, mem_type_id, mem_space, file_space, buf) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data")
@@ -377,7 +384,7 @@ done:
*/
herr_t
H5VL__native_dataset_optional(void *obj, H5VL_dataset_optional_t optional_type,
- hid_t H5_ATTR_UNUSED dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments)
+ hid_t dxpl_id, void H5_ATTR_UNUSED **req, va_list arguments)
{
H5D_t *dset = (H5D_t *)obj; /* Dataset */
herr_t ret_value = SUCCEED; /* Return value */
@@ -387,6 +394,9 @@ H5VL__native_dataset_optional(void *obj, H5VL_dataset_optional_t optional_type,
/* Sanity checks */
HDassert(dset);
+ /* Set DXPL for operation */
+ H5CX_set_dxpl(dxpl_id);
+
switch(optional_type) {
case H5VL_NATIVE_DATASET_FORMAT_CONVERT:
{ /* H5Dformat_convert */