summaryrefslogtreecommitdiffstats
path: root/src/H5Dmpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5Dmpio.c')
-rw-r--r--src/H5Dmpio.c53
1 files changed, 25 insertions, 28 deletions
diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c
index cbad339..864215f 100644
--- a/src/H5Dmpio.c
+++ b/src/H5Dmpio.c
@@ -44,10 +44,9 @@
static int interface_initialize_g = 0;
static herr_t
-H5D_mpio_spaces_xfer(H5F_t *f, const H5D_t *dset, size_t elmt_size,
+H5D_mpio_spaces_xfer(H5D_io_info_t *io_info, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space,
- hid_t dxpl_id, void *buf/*out*/,
- const H5D_storage_t *store,
+ void *buf/*out*/,
hbool_t do_write);
@@ -95,11 +94,9 @@ H5D_mpio_spaces_xfer(H5F_t *f, const H5D_t *dset, size_t elmt_size,
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_mpio_spaces_xfer(H5F_t *f, const H5D_t *dset, size_t elmt_size,
+H5D_mpio_spaces_xfer(H5D_io_info_t *io_info, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space,
- hid_t dxpl_id, void *_buf /*out*/,
- const H5D_storage_t *store,
- hbool_t do_write )
+ void *_buf /*out*/, hbool_t do_write )
{
haddr_t addr; /* Address of dataset (or selection) within file */
size_t mpi_buf_count, mpi_file_count; /* Number of "objects" to transfer */
@@ -115,14 +112,14 @@ H5D_mpio_spaces_xfer(H5F_t *f, const H5D_t *dset, size_t elmt_size,
FUNC_ENTER_NOAPI_NOINIT(H5D_mpio_spaces_xfer);
/* Check args */
- assert (f);
- assert (dset);
+ assert (io_info);
+ assert (io_info->dset);
assert (file_space);
assert (mem_space);
assert (buf);
- assert (IS_H5FD_MPIO(f));
+ assert (IS_H5FD_MPIO(io_info->dset->ent.file));
/* Make certain we have the correct type of property list */
- assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER));
+ assert(TRUE==H5P_isa_class(io_info->dxpl_id,H5P_DATASET_XFER));
/* create the MPI buffer type */
if (H5S_mpio_space_type( mem_space, elmt_size,
@@ -143,21 +140,21 @@ H5D_mpio_spaces_xfer(H5F_t *f, const H5D_t *dset, size_t elmt_size,
HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't create MPI file type");
/* Get the base address of the contiguous dataset or the chunk */
- if(dset->shared->layout.type == H5D_CONTIGUOUS)
- addr = H5D_contig_get_addr(dset) + mpi_file_offset;
+ if(io_info->dset->shared->layout.type == H5D_CONTIGUOUS)
+ addr = H5D_contig_get_addr(io_info->dset) + mpi_file_offset;
else {
haddr_t chunk_addr; /* for collective chunk IO */
- assert(dset->shared->layout.type == H5D_CHUNKED);
- chunk_addr=H5D_istore_get_addr(f,dxpl_id,&(dset->shared->layout),store->chunk.offset,NULL);
- addr = H5F_BASE_ADDR(f) + chunk_addr + mpi_file_offset;
+ assert(io_info->dset->shared->layout.type == H5D_CHUNKED);
+ chunk_addr=H5D_istore_get_addr(io_info,NULL);
+ addr = H5F_BASE_ADDR(io_info->dset->ent.file) + chunk_addr + mpi_file_offset;
}
/*
* Pass buf type, file type to the file driver. Request an MPI type
* transfer (instead of an elementary byteblock transfer).
*/
- if(H5FD_mpi_setup_collective(dxpl_id, mpi_buf_type, mpi_file_type)<0)
+ if(H5FD_mpi_setup_collective(io_info->dxpl_id, mpi_buf_type, mpi_file_type)<0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O properties");
plist_is_setup=1;
@@ -166,17 +163,17 @@ H5D_mpio_spaces_xfer(H5F_t *f, const H5D_t *dset, size_t elmt_size,
/* transfer the data */
if (do_write) {
- if (H5F_block_write(f, H5FD_MEM_DRAW, addr, mpi_buf_count, dxpl_id, buf) <0)
+ if (H5F_block_write(io_info->dset->ent.file, H5FD_MEM_DRAW, addr, mpi_buf_count, io_info->dxpl_id, buf) <0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,"MPI write failed");
} else {
- if (H5F_block_read (f, H5FD_MEM_DRAW, addr, mpi_buf_count, dxpl_id, buf) <0)
+ if (H5F_block_read (io_info->dset->ent.file, H5FD_MEM_DRAW, addr, mpi_buf_count, io_info->dxpl_id, buf) <0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL,"MPI read failed");
}
done:
/* Reset the dxpl settings */
if(plist_is_setup) {
- if(H5FD_mpi_teardown_collective(dxpl_id)<0)
+ if(H5FD_mpi_teardown_collective(io_info->dxpl_id)<0)
HDONE_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "unable to reset dxpl values");
} /* end if */
@@ -215,8 +212,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5D_mpio_spaces_read(H5F_t *f, const H5D_dxpl_cache_t UNUSED *dxpl_cache, hid_t dxpl_id,
- H5D_t *dset, const H5D_storage_t *store,
+H5D_mpio_spaces_read(H5D_io_info_t *io_info,
+ H5O_layout_readvv_func_t UNUSED op,
size_t UNUSED nelmts, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space,
void *buf/*out*/)
@@ -225,8 +222,8 @@ H5D_mpio_spaces_read(H5F_t *f, const H5D_dxpl_cache_t UNUSED *dxpl_cache, hid_t
FUNC_ENTER_NOAPI(H5D_mpio_spaces_read, FAIL);
- ret_value = H5D_mpio_spaces_xfer(f, dset, elmt_size, file_space,
- mem_space, dxpl_id, buf, store, 0/*read*/);
+ ret_value = H5D_mpio_spaces_xfer(io_info, elmt_size, file_space,
+ mem_space, buf, 0/*read*/);
done:
FUNC_LEAVE_NOAPI(ret_value);
@@ -254,8 +251,8 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5D_mpio_spaces_write(H5F_t *f, const H5D_dxpl_cache_t UNUSED *dxpl_cache, hid_t dxpl_id,
- H5D_t *dset, const H5D_storage_t *store,
+H5D_mpio_spaces_write(H5D_io_info_t *io_info,
+ H5O_layout_writevv_func_t UNUSED op,
size_t UNUSED nelmts, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space,
const void *buf)
@@ -265,8 +262,8 @@ H5D_mpio_spaces_write(H5F_t *f, const H5D_dxpl_cache_t UNUSED *dxpl_cache, hid_t
FUNC_ENTER_NOAPI(H5D_mpio_spaces_write, FAIL);
/*OKAY: CAST DISCARDS CONST QUALIFIER*/
- ret_value = H5D_mpio_spaces_xfer(f, dset, elmt_size, file_space,
- mem_space, dxpl_id, (void*)buf, store, 1/*write*/);
+ ret_value = H5D_mpio_spaces_xfer(io_info, elmt_size, file_space,
+ mem_space, (void*)buf, 1/*write*/);
done:
FUNC_LEAVE_NOAPI(ret_value);