summaryrefslogtreecommitdiffstats
path: root/src/H5Smpio.c
diff options
context:
space:
mode:
authorRobert Kim Yates <rkyates@llnl.gov>1998-08-26 17:51:19 (GMT)
committerRobert Kim Yates <rkyates@llnl.gov>1998-08-26 17:51:19 (GMT)
commit9124be67f68ec427f66cd0fe9a8c624d787560fc (patch)
tree2f2070b96266006a8785fff20fd4c695323f5c29 /src/H5Smpio.c
parent8fc352b7cd35ff3456860431e18a4a2f53aefb31 (diff)
downloadhdf5-9124be67f68ec427f66cd0fe9a8c624d787560fc.zip
hdf5-9124be67f68ec427f66cd0fe9a8c624d787560fc.tar.gz
hdf5-9124be67f68ec427f66cd0fe9a8c624d787560fc.tar.bz2
[svn-r617] Added optimization to coalesce outer dims of hyperslab,
and changed error return of H5S_mpio_spaces_xfer to simple FAIL in case file layout is not contiguous (so that the xfer will still be done, but in the old chunk-by-chunk method).
Diffstat (limited to 'src/H5Smpio.c')
-rw-r--r--src/H5Smpio.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/H5Smpio.c b/src/H5Smpio.c
index 122e322..dd58f27 100644
--- a/src/H5Smpio.c
+++ b/src/H5Smpio.c
@@ -25,7 +25,7 @@
* them.
*/
/* const hbool_t H5S_mpio_avail = FALSE; */
-#else /* HAVE_PARALLEL */
+#else /* HAVE_PARALLEL */
/* Interface initialization */
#define PABLO_MASK H5S_all_mask
#define INTERFACE_INIT NULL
@@ -197,11 +197,13 @@ H5S_mpio_hyper_type( const H5S_t *space, const hsize_t elmt_size,
/* d[rank-i-1].start stays unchanged */
/* d[rank-i-1].count stays unchanged */
}
- /* check for possibility to coalesce blocks of the innermost dimension */
- if (d[new_rank-1].strid == d[new_rank-1].block) {
- /* transform the smaller blocks to 1 larger block of combined size */
- d[new_rank-1].block *= d[new_rank-1].count;
- d[new_rank-1].count = 1;
+ /* check for possibility to coalesce blocks of the uncoalesced dimensions */
+ for (i=0; i<new_rank; ++i) {
+ if (d[i].strid == d[i].block) {
+ /* transform smaller blocks to 1 larger block of combined size */
+ d[i].block *= d[i].count;
+ d[i].count = 1;
+ }
}
/* initialize induction variables */
@@ -412,6 +414,7 @@ H5S_mpio_spaces_xfer (H5F_t *f, const struct H5O_layout_t *layout,
const H5D_transfer_t xfer_mode, void *buf /*out*/,
const hbool_t do_write )
{
+ herr_t ret_value = SUCCEED;
int err;
haddr_t disp, addr;
size_t mpi_count;
@@ -433,7 +436,11 @@ H5S_mpio_spaces_xfer (H5F_t *f, const struct H5O_layout_t *layout,
/* INCOMPLETE!!! rky 980816 */
/* Currently can only handle H5D_CONTIGUOUS layout */
if (layout->type != H5D_CONTIGUOUS) {
- HRETURN_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL,"can only handle contiguous layout");
+#ifdef H5S_DEBUG
+ fprintf (stderr, "H5S: can only create MPI datatype for hyperslab selection when layout is contiguous.\n" );
+#endif
+ ret_value = FAIL;
+ goto done;
}
/* create the MPI buffer type */
@@ -503,7 +510,8 @@ H5S_mpio_spaces_xfer (H5F_t *f, const struct H5O_layout_t *layout,
}
}
- FUNC_LEAVE (SUCCEED);
+ done:
+ FUNC_LEAVE (ret_value);
} /* H5S_mpio_spaces_xfer() */
/*-------------------------------------------------------------------------
@@ -568,4 +576,4 @@ H5S_mpio_spaces_write(H5F_t *f, const struct H5O_layout_t *layout,
FUNC_LEAVE (ret_value);
} /* H5S_mpio_spaces_write() */
-#endif /* HAVE_PARALLEL */
+#endif /* HAVE_PARALLEL */