summaryrefslogtreecommitdiffstats
path: root/src/H5Dmpio.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2011-10-01 01:37:23 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2011-10-01 01:37:23 (GMT)
commit3d15d9d6814b700bb19b2cd18bb934be00c259dc (patch)
tree21463fe77c01e88d0a293de4777fbee11775e8ea /src/H5Dmpio.c
parent8f6ec57f06a1b451bb55ecda5c5e72527832322e (diff)
downloadhdf5-3d15d9d6814b700bb19b2cd18bb934be00c259dc.zip
hdf5-3d15d9d6814b700bb19b2cd18bb934be00c259dc.tar.gz
hdf5-3d15d9d6814b700bb19b2cd18bb934be00c259dc.tar.bz2
[svn-r21442] Description:
Check in "actual I/O mode" feature to trunk. Will merge back to 1.8 branch after it bakes over the weekend. Tested on: FreeBSD/32 8.2 (loyalty) w/gcc4.6, w/C++ & FORTRAN, in debug mode FreeBSD/64 8.2 (freedom) w/gcc4.6, w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (koala) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, w/threadsafe, in production mode Linux/PPC 2.6 (heiwa) w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-ia64 2.6 (ember) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode Mac OS X/32 10.6.8 (amazon) in debug mode Mac OS X/32 10.6.8 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'src/H5Dmpio.c')
-rw-r--r--src/H5Dmpio.c77
1 files changed, 77 insertions, 0 deletions
diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c
index 1c69305..8c78af2 100644
--- a/src/H5Dmpio.c
+++ b/src/H5Dmpio.c
@@ -471,6 +471,8 @@ H5D_contig_collective_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_i
hsize_t UNUSED nelmts, const H5S_t *file_space, const H5S_t *mem_space,
H5D_chunk_map_t UNUSED *fm)
{
+ H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_CONTIGUOUS_COLLECTIVE;
+ H5P_genplist_t *dx_plist; /* Pointer to DXPL */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5D_contig_collective_read, FAIL)
@@ -483,6 +485,16 @@ H5D_contig_collective_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_i
if(H5D_inter_collective_io(io_info, type_info, file_space, mem_space) < 0)
HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "couldn't finish shared collective MPI-IO")
+ /* Obtain the data transfer properties */
+ if(NULL == (dx_plist = H5I_object(io_info->dxpl_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list")
+
+ /* Set the actual I/O mode property. internal_collective_io will not break to
+ * independent I/O, so we set it here.
+ */
+ if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, &actual_io_mode) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual io mode property")
+
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_contig_collective_read() */
@@ -506,6 +518,8 @@ H5D_contig_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_
hsize_t UNUSED nelmts, const H5S_t *file_space, const H5S_t *mem_space,
H5D_chunk_map_t UNUSED *fm)
{
+ H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_CONTIGUOUS_COLLECTIVE;
+ H5P_genplist_t *dx_plist; /* Pointer to DXPL */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5D_contig_collective_write, FAIL)
@@ -518,6 +532,16 @@ H5D_contig_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_
if(H5D_inter_collective_io(io_info, type_info, file_space, mem_space) < 0)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "couldn't finish shared collective MPI-IO")
+ /* Obtain the data transfer properties */
+ if(NULL == (dx_plist = H5I_object(io_info->dxpl_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list")
+
+ /* Set the actual I/O mode property. internal_collective_io will not break to
+ * independent I/O, so we set it here.
+ */
+ if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, &actual_io_mode) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual io mode property")
+
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_contig_collective_write() */
@@ -559,6 +583,8 @@ H5D_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info
{
H5P_genplist_t *dx_plist; /* Pointer to DXPL */
H5FD_mpio_chunk_opt_t chunk_opt_mode;
+ H5D_mpio_actual_chunk_opt_mode_t actual_chunk_opt_mode;
+ H5D_mpio_actual_io_mode_t actual_io_mode;
int io_option = H5D_MULTI_CHUNK_IO_MORE_OPT;
int sum_chunk = -1;
#ifdef H5_HAVE_INSTRUMENTED_LIBRARY
@@ -646,15 +672,38 @@ H5D_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info
/* step 2: Go ahead to do IO.*/
if(io_option == H5D_ONE_LINK_CHUNK_IO || io_option == H5D_ONE_LINK_CHUNK_IO_MORE_OPT) {
+ /* set the actual io mode properties to the correct values for link chunk io.
+ * Link chunk I/O does not break to independent, so we can set the actual_io mode
+ * as well as the optimisation mode. */
+ actual_chunk_opt_mode = H5D_MPIO_LINK_CHUNK;
+ actual_io_mode = H5D_MPIO_CHUNK_COLLECTIVE;
+
+ /* Set the actual chunk opt mode property. */
+ if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, &actual_chunk_opt_mode) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual chunk opt mode property")
+
if(H5D_link_chunk_collective_io(io_info, type_info, fm, sum_chunk) < 0)
HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish linked chunk MPI-IO")
+
+ /* Set the actual io mode property. */
+ if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, &actual_io_mode) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual io mode property")
} /* end if */
else
if(io_option == H5D_MULTI_CHUNK_IO) {
+ /* Set the actual chunk opt mode property */
+ actual_chunk_opt_mode = H5D_MPIO_MULTI_CHUNK_NO_OPT;
+ if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, &actual_chunk_opt_mode) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual chunk opt mode property")
+
if(H5D_multi_chunk_collective_io_no_opt(io_info, type_info, fm, dx_plist) < 0)
HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish multiple chunk MPI-IO")
} /* end if */
else { /*multiple chunk IOs with opt */
+ actual_chunk_opt_mode = H5D_MPIO_MULTI_CHUNK;
+ if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, &actual_chunk_opt_mode) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual chunk opt mode property")
+
if(H5D_multi_chunk_collective_io(io_info, type_info, fm, dx_plist) < 0)
HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish optimized multiple chunk MPI-IO")
} /* end else */
@@ -1036,6 +1085,7 @@ H5D_multi_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *typ
int mpi_rank;
#endif
size_t u; /* Local index variable */
+ H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_NO_COLLECTIVE; /* Local variable for tracking the I/O mode used. */
herr_t ret_value = SUCCEED;
FUNC_ENTER_NOAPI_NOINIT(H5D_multi_chunk_collective_io)
@@ -1115,6 +1165,15 @@ if(H5DEBUG(D))
if(chunk_info) {
fspace = chunk_info->fspace;
mspace = chunk_info->mspace;
+
+ /* Update the local variable tracking the dxpl's actual io mode property.
+ *
+ * Note: H5D_MPIO_COLLECTIVE_MULTI | H5D_MPIO_INDEPENDENT = H5D_MPIO_MIXED
+ * to ease switching between to mixed I/O without checking the current
+ * value of the property. You can see the definition in H5Ppublic.h
+ */
+ actual_io_mode = actual_io_mode | H5D_MPIO_CHUNK_COLLECTIVE;
+
} /* end if */
else {
fspace = mspace = NULL;
@@ -1151,6 +1210,9 @@ if(H5DEBUG(D))
if(chunk_info) {
fspace = chunk_info->fspace;
mspace = chunk_info->mspace;
+
+ /* Update the local variable tracking the dxpl's actual io mode. */
+ actual_io_mode = actual_io_mode | H5D_MPIO_CHUNK_INDEPENDENT;
} /* end if */
else {
fspace = mspace = NULL;
@@ -1176,6 +1238,10 @@ if(H5DEBUG(D))
} /* end else */
} /* end for */
+ /* Write the local value of actual io mode to the DXPL. */
+ if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, &actual_io_mode) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual io mode property")
+
done:
if(chunk_io_option)
H5MM_xfree(chunk_io_option);
@@ -1226,6 +1292,7 @@ H5D_multi_chunk_collective_io_no_opt(H5D_io_info_t *io_info,
int min_chunk = -1; /* Minimum # of chunks all processes will operate on */
int count_chunk; /* How many chunks have we operated on? */
H5D_storage_t store; /* union of EFL and chunk pointer in file space */
+ H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_NO_COLLECTIVE; /*Local variable for tracking the I/O modes used. */
herr_t ret_value = SUCCEED;
FUNC_ENTER_NOAPI_NOINIT(H5D_multi_chunk_collective_io_no_opt)
@@ -1308,6 +1375,9 @@ if(H5DEBUG(D)) {
if(H5D_ioinfo_xfer_mode(io_info, dx_plist, H5FD_MPIO_INDEPENDENT) < 0)
HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to independent I/O")
+ /* Update the local variable tracking the dxpl's actual io mode */
+ actual_io_mode = actual_io_mode | H5D_MPIO_CHUNK_INDEPENDENT;
+
/* Load the chunk into cache and lock it. */
if((cacheable = H5D_chunk_cacheable(io_info, udata.addr,
io_info->op_type == H5D_IO_OP_WRITE)) < 0)
@@ -1364,6 +1434,9 @@ if(H5DEBUG(D)) {
/* Set up the storage address information for this chunk */
ctg_store.contig.dset_addr = udata.addr;
+ /* Update the local variable tracking the dxpl's actual io Mode. */
+ actual_io_mode = actual_io_mode | H5D_MPIO_CHUNK_COLLECTIVE;
+
if(H5D_inter_collective_io(&ctg_io_info, type_info, chunk_info->fspace, chunk_info->mspace) < 0)
HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL,"couldn't finish shared collective MPI-IO")
} /* end else */
@@ -1376,6 +1449,10 @@ if(H5DEBUG(D)) {
chunk_node = H5SL_next(chunk_node);
} /* end while */
+ /* Write the local value of actual io mode to the DXPL. */
+ if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_IO_MODE_NAME, &actual_io_mode) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual io mode property")
+
done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_multi_chunk_collective_io_no_opt */