summaryrefslogtreecommitdiffstats
path: root/src/H5Smpio.c
diff options
context:
space:
mode:
authorRobert Kim Yates <rkyates@llnl.gov>1998-09-18 23:08:09 (GMT)
committerRobert Kim Yates <rkyates@llnl.gov>1998-09-18 23:08:09 (GMT)
commit8718c53e6b8ca3d64b2e129a0b4401e124aef116 (patch)
tree302b7916e23e173227c855a2faa06cddf6d5f944 /src/H5Smpio.c
parentd3c8def6aa7e19e0005b6392f41a9d4bd4bb14af (diff)
downloadhdf5-8718c53e6b8ca3d64b2e129a0b4401e124aef116.zip
hdf5-8718c53e6b8ca3d64b2e129a0b4401e124aef116.tar.gz
hdf5-8718c53e6b8ca3d64b2e129a0b4401e124aef116.tar.bz2
[svn-r706] Added must_convert parameter to sconv->read and sconv->write functions
so that reads/writes can proceed in the unoptimized way if necessary, rather than simply failing if they can't be optimized.
Diffstat (limited to 'src/H5Smpio.c')
-rw-r--r--src/H5Smpio.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/src/H5Smpio.c b/src/H5Smpio.c
index 2275120..2610f94 100644
--- a/src/H5Smpio.c
+++ b/src/H5Smpio.c
@@ -55,6 +55,7 @@ H5S_mpio_spaces_xfer (H5F_t *f, const struct H5O_layout_t *layout,
const struct H5O_efl_t __unused__ *efl, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space,
const H5D_transfer_t xfer_mode, void *buf /*out*/,
+ hbool_t *must_convert /*out*/,
const hbool_t do_write );
/*-------------------------------------------------------------------------
@@ -434,6 +435,9 @@ H5S_mpio_space_type( const H5S_t *space, const size_t elmt_size,
*
* Modifications:
*
+ * rky 980918
+ * Added must_convert parameter to let caller know we can't optimize the xfer.
+ *
*-------------------------------------------------------------------------
*/
herr_t
@@ -442,6 +446,7 @@ H5S_mpio_spaces_xfer (H5F_t *f, const struct H5O_layout_t *layout,
const struct H5O_efl_t __unused__ *efl, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space,
const H5D_transfer_t xfer_mode, void *buf /*out*/,
+ hbool_t *must_convert /*out*/,
const hbool_t do_write )
{
herr_t ret_value = SUCCEED;
@@ -454,6 +459,8 @@ H5S_mpio_spaces_xfer (H5F_t *f, const struct H5O_layout_t *layout,
FUNC_ENTER (H5S_mpio_spaces_xfer, FAIL);
+ *must_convert = 0; /* means we at least tried to do optimized xfer */
+
/* Check args */
assert (f);
assert (layout);
@@ -466,9 +473,11 @@ H5S_mpio_spaces_xfer (H5F_t *f, const struct H5O_layout_t *layout,
/* Currently can only handle H5D_CONTIGUOUS layout */
if (layout->type != H5D_CONTIGUOUS) {
#ifdef H5S_DEBUG
- fprintf (stderr, "H5S: can only create MPI datatype for hyperslab selection when layout is contiguous.\n" );
+ if (H5DEBUG(S)) {
+ fprintf (H5DEBUG(S), "H5S: can only create MPI datatype for hyperslab when layout is contiguous.\n" );
+ }
#endif
- ret_value = FAIL;
+ *must_convert = 1; /* can't do optimized xfer; do the old way */
goto done;
}
@@ -555,6 +564,9 @@ H5S_mpio_spaces_xfer (H5F_t *f, const struct H5O_layout_t *layout,
*
* Modifications:
*
+ * rky 980918
+ * Added must_convert parameter to let caller know we can't optimize the xfer.
+ *
*-------------------------------------------------------------------------
*/
herr_t
@@ -562,7 +574,8 @@ H5S_mpio_spaces_read (H5F_t *f, const struct H5O_layout_t *layout,
const struct H5O_pline_t *pline,
const struct H5O_efl_t *efl, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space,
- const H5D_transfer_t xfer_mode, void *buf /*out*/ )
+ const H5D_transfer_t xfer_mode, void *buf /*out*/,
+ hbool_t *must_convert /*out*/ )
{
herr_t ret_value = FAIL;
@@ -570,7 +583,7 @@ H5S_mpio_spaces_read (H5F_t *f, const struct H5O_layout_t *layout,
ret_value = H5S_mpio_spaces_xfer( f, layout, pline, efl, elmt_size,
file_space, mem_space, xfer_mode, (void*)buf,
- 0 /*read*/ );
+ must_convert /*out*/, 0 /*read*/ );
FUNC_LEAVE (ret_value);
} /* H5S_mpio_spaces_read() */
@@ -586,6 +599,9 @@ H5S_mpio_spaces_read (H5F_t *f, const struct H5O_layout_t *layout,
*
* Modifications:
*
+ * rky 980918
+ * Added must_convert parameter to let caller know we can't optimize the xfer.
+ *
*-------------------------------------------------------------------------
*/
herr_t
@@ -593,7 +609,8 @@ H5S_mpio_spaces_write(H5F_t *f, const struct H5O_layout_t *layout,
const struct H5O_pline_t *pline,
const struct H5O_efl_t *efl, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space,
- const H5D_transfer_t xfer_mode, const void *buf )
+ const H5D_transfer_t xfer_mode, const void *buf,
+ hbool_t *must_convert /*out*/ )
{
herr_t ret_value = FAIL;
@@ -601,7 +618,7 @@ H5S_mpio_spaces_write(H5F_t *f, const struct H5O_layout_t *layout,
ret_value = H5S_mpio_spaces_xfer( f, layout, pline, efl, elmt_size,
file_space, mem_space, xfer_mode, (void*)buf,
- 1 /*write*/ );
+ must_convert /*out*/, 1 /*write*/ );
FUNC_LEAVE (ret_value);
} /* H5S_mpio_spaces_write() */