summaryrefslogtreecommitdiffstats
path: root/src/H5S.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-04-02 21:21:13 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-04-02 21:21:13 (GMT)
commit8005e831a03dcceec4b3333b5c5483a4cea3707c (patch)
tree56d38aa6109b69870f8283d9589cc5982dd02719 /src/H5S.c
parentd2232a345f36988f4a60034d63ddca25c476fc08 (diff)
downloadhdf5-8005e831a03dcceec4b3333b5c5483a4cea3707c.zip
hdf5-8005e831a03dcceec4b3333b5c5483a4cea3707c.tar.gz
hdf5-8005e831a03dcceec4b3333b5c5483a4cea3707c.tar.bz2
[svn-r5131] Purpose:
Code cleanup Description: The function pointer for doing parallel I/O was being set in the H5D_read and H5D_write routines instead of in H5S_conv, where it belongs. Solution: Added an extra 'flags' parameter to H5S_find to allow the function to determine when to set the MPIO functions instead of the regular optimized I/O routines and get rid of code messing with the function pointer in the H5D routines. Platforms tested: IRIX64 6.5 (modi4)
Diffstat (limited to 'src/H5S.c')
-rw-r--r--src/H5S.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/src/H5S.c b/src/H5S.c
index 43547db..16ff07d 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -1494,7 +1494,7 @@ H5S_set_extent_simple (H5S_t *space, unsigned rank, const hsize_t *dims,
*-------------------------------------------------------------------------
*/
H5S_conv_t *
-H5S_find (const H5S_t *mem_space, const H5S_t *file_space)
+H5S_find (const H5S_t *mem_space, const H5S_t *file_space, unsigned flags)
{
H5S_conv_t *path; /* Space conversion path */
htri_t c1,c2; /* Flags whether a selection is contiguous */
@@ -1531,8 +1531,19 @@ H5S_find (const H5S_t *mem_space, const H5S_t *file_space)
HRETURN_ERROR(H5E_DATASPACE, H5E_BADRANGE, NULL, "invalid check for contiguous dataspace ");
if (c1==TRUE && c2==TRUE) {
+#ifdef H5_HAVE_PARALLEL
+ if(flags&H5S_CONV_PAR_IO_POSSIBLE) {
+ H5S_conv_g[i]->read = H5S_mpio_spaces_read;
+ H5S_conv_g[i]->write = H5S_mpio_spaces_write;
+ } /* end if */
+ else {
+ H5S_conv_g[i]->read = H5S_all_read;
+ H5S_conv_g[i]->write = H5S_all_write;
+ } /* end else */
+#else /* H5_HAVE_PARALLEL */
H5S_conv_g[i]->read = H5S_all_read;
H5S_conv_g[i]->write = H5S_all_write;
+#endif /* H5_HAVE_PARALLEL */
}
else {
H5S_conv_g[i]->read = NULL;
@@ -1569,8 +1580,19 @@ H5S_find (const H5S_t *mem_space, const H5S_t *file_space)
HRETURN_ERROR(H5E_DATASPACE, H5E_BADRANGE, NULL, "invalid check for contiguous dataspace ");
if (c1==TRUE && c2==TRUE) {
- path->read = H5S_all_read;
- path->write = H5S_all_write;
+#ifdef H5_HAVE_PARALLEL
+ if(flags&H5S_CONV_PAR_IO_POSSIBLE) {
+ H5S_conv_g[i]->read = H5S_mpio_spaces_read;
+ H5S_conv_g[i]->write = H5S_mpio_spaces_write;
+ } /* end if */
+ else {
+ H5S_conv_g[i]->read = H5S_all_read;
+ H5S_conv_g[i]->write = H5S_all_write;
+ } /* end else */
+#else /* H5_HAVE_PARALLEL */
+ H5S_conv_g[i]->read = H5S_all_read;
+ H5S_conv_g[i]->write = H5S_all_write;
+#endif /* H5_HAVE_PARALLEL */
} /* end if */
/*