summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2004-08-02 17:56:37 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2004-08-02 17:56:37 (GMT)
commit34cbb564af98b82c9b9f392fa33787094be4c74f (patch)
treed86ac0112734470cec82b4b26eacf2d798f61a3d /src
parentaf7def1357e2e8fa43e6abe1adc768219c2df620 (diff)
downloadhdf5-34cbb564af98b82c9b9f392fa33787094be4c74f.zip
hdf5-34cbb564af98b82c9b9f392fa33787094be4c74f.tar.gz
hdf5-34cbb564af98b82c9b9f392fa33787094be4c74f.tar.bz2
[svn-r8989] Purpose:
Backport feature Description: Backport Kent's collective chunk I/O work to date into the release branch. Also, minor code cleanups, etc. Platforms tested: FreeBSD 4.10 (sleipnir) w/parallel IRIX64 6.5 (modi4) h5committested
Diffstat (limited to 'src')
-rw-r--r--src/Dependencies92
-rw-r--r--src/H5Dio.c57
-rw-r--r--src/H5Distore.c4
-rw-r--r--src/H5Dmpio.c10
-rw-r--r--src/H5Dpkg.h2
-rw-r--r--src/H5Dprivate.h31
-rw-r--r--src/H5S.c50
-rw-r--r--src/H5Shyper.c62
-rw-r--r--src/H5Smpio.c355
-rw-r--r--src/H5Spkg.h18
-rw-r--r--src/H5Sprivate.h14
-rw-r--r--src/H5config.h.in10
-rw-r--r--src/Makefile.in26
13 files changed, 366 insertions, 365 deletions
diff --git a/src/Dependencies b/src/Dependencies
index 80d76d4..0d4a162 100644
--- a/src/Dependencies
+++ b/src/Dependencies
@@ -430,6 +430,49 @@ H5Distore.lo: \
$(srcdir)/H5MFprivate.h \
$(srcdir)/H5MMprivate.h \
$(srcdir)/H5Vprivate.h
+H5Dmpio.lo: \
+ $(srcdir)/H5Dmpio.c \
+ $(srcdir)/H5private.h \
+ $(srcdir)/H5public.h \
+ H5pubconf.h \
+ $(srcdir)/H5api_adpt.h \
+ $(srcdir)/H5MPprivate.h \
+ $(srcdir)/H5Dpkg.h \
+ $(srcdir)/H5Dprivate.h \
+ $(srcdir)/H5Dpublic.h \
+ $(srcdir)/H5Ipublic.h \
+ $(srcdir)/H5FDprivate.h \
+ $(srcdir)/H5FDpublic.h \
+ $(srcdir)/H5Fpublic.h \
+ $(srcdir)/H5FDmpi.h \
+ $(srcdir)/H5FDmpio.h \
+ $(srcdir)/H5FDmpiposix.h \
+ $(srcdir)/H5Oprivate.h \
+ $(srcdir)/H5Opublic.h \
+ $(srcdir)/H5Spublic.h \
+ $(srcdir)/H5HGprivate.h \
+ $(srcdir)/H5HGpublic.h \
+ $(srcdir)/H5Fprivate.h \
+ $(srcdir)/H5RCprivate.h \
+ $(srcdir)/H5Tprivate.h \
+ $(srcdir)/H5Tpublic.h \
+ $(srcdir)/H5MMpublic.h \
+ $(srcdir)/H5Gprivate.h \
+ $(srcdir)/H5Gpublic.h \
+ $(srcdir)/H5Bprivate.h \
+ $(srcdir)/H5Bpublic.h \
+ $(srcdir)/H5ACprivate.h \
+ $(srcdir)/H5ACpublic.h \
+ $(srcdir)/H5RSprivate.h \
+ $(srcdir)/H5Rprivate.h \
+ $(srcdir)/H5Rpublic.h \
+ $(srcdir)/H5Zprivate.h \
+ $(srcdir)/H5Zpublic.h \
+ $(srcdir)/H5Sprivate.h \
+ $(srcdir)/H5Pprivate.h \
+ $(srcdir)/H5Ppublic.h \
+ $(srcdir)/H5Eprivate.h \
+ $(srcdir)/H5Epublic.h
H5Dseq.lo: \
$(srcdir)/H5Dseq.c \
$(srcdir)/H5private.h \
@@ -2468,8 +2511,8 @@ H5S.lo: \
$(srcdir)/H5Eprivate.h \
$(srcdir)/H5Epublic.h \
$(srcdir)/H5Ipublic.h \
- $(srcdir)/H5Iprivate.h \
$(srcdir)/H5FLprivate.h \
+ $(srcdir)/H5Iprivate.h \
$(srcdir)/H5MMprivate.h \
$(srcdir)/H5MMpublic.h \
$(srcdir)/H5Oprivate.h \
@@ -2602,46 +2645,43 @@ H5Smpio.lo: \
H5pubconf.h \
$(srcdir)/H5api_adpt.h \
$(srcdir)/H5MPprivate.h \
- $(srcdir)/H5Eprivate.h \
- $(srcdir)/H5Epublic.h \
+ $(srcdir)/H5Dprivate.h \
+ $(srcdir)/H5Dpublic.h \
$(srcdir)/H5Ipublic.h \
- $(srcdir)/H5Fpkg.h \
- $(srcdir)/H5Fprivate.h \
- $(srcdir)/H5Fpublic.h \
- $(srcdir)/H5FDpublic.h \
- $(srcdir)/H5Bpublic.h \
- $(srcdir)/H5FOprivate.h \
- $(srcdir)/H5TBprivate.h \
- $(srcdir)/H5Gprivate.h \
- $(srcdir)/H5Gpublic.h \
- $(srcdir)/H5Opublic.h \
- $(srcdir)/H5Bprivate.h \
- $(srcdir)/H5ACprivate.h \
- $(srcdir)/H5ACpublic.h \
- $(srcdir)/H5RCprivate.h \
- $(srcdir)/H5RSprivate.h \
$(srcdir)/H5FDprivate.h \
+ $(srcdir)/H5FDpublic.h \
+ $(srcdir)/H5Fpublic.h \
$(srcdir)/H5FDmpi.h \
$(srcdir)/H5FDmpio.h \
$(srcdir)/H5FDmpiposix.h \
- $(srcdir)/H5Iprivate.h \
- $(srcdir)/H5Pprivate.h \
- $(srcdir)/H5Ppublic.h \
- $(srcdir)/H5Dpublic.h \
- $(srcdir)/H5MMpublic.h \
- $(srcdir)/H5Zpublic.h \
$(srcdir)/H5Oprivate.h \
+ $(srcdir)/H5Opublic.h \
$(srcdir)/H5Spublic.h \
$(srcdir)/H5HGprivate.h \
$(srcdir)/H5HGpublic.h \
+ $(srcdir)/H5Fprivate.h \
+ $(srcdir)/H5RCprivate.h \
$(srcdir)/H5Tprivate.h \
$(srcdir)/H5Tpublic.h \
+ $(srcdir)/H5MMpublic.h \
+ $(srcdir)/H5Gprivate.h \
+ $(srcdir)/H5Gpublic.h \
+ $(srcdir)/H5Bprivate.h \
+ $(srcdir)/H5Bpublic.h \
+ $(srcdir)/H5ACprivate.h \
+ $(srcdir)/H5ACpublic.h \
+ $(srcdir)/H5RSprivate.h \
$(srcdir)/H5Rprivate.h \
$(srcdir)/H5Rpublic.h \
$(srcdir)/H5Zprivate.h \
+ $(srcdir)/H5Zpublic.h \
+ $(srcdir)/H5Eprivate.h \
+ $(srcdir)/H5Epublic.h \
+ $(srcdir)/H5Iprivate.h \
+ $(srcdir)/H5Pprivate.h \
+ $(srcdir)/H5Ppublic.h \
$(srcdir)/H5Spkg.h \
- $(srcdir)/H5Sprivate.h \
- $(srcdir)/H5Dprivate.h
+ $(srcdir)/H5Sprivate.h
H5Snone.lo: \
$(srcdir)/H5Snone.c \
$(srcdir)/H5private.h \
diff --git a/src/H5Dio.c b/src/H5Dio.c
index 32e6a28..b59a11f 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -21,7 +21,6 @@
#include "H5private.h" /* Generic Functions */
#include "H5Dpkg.h" /* Dataset functions */
#include "H5Eprivate.h" /* Error handling */
-#include "H5FDprivate.h" /* File drivers */
#include "H5FLprivate.h" /* Free Lists */
#include "H5Iprivate.h" /* IDs */
#include "H5MMprivate.h" /* Memory management */
@@ -644,6 +643,8 @@ H5D_read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
hbool_t use_par_opt_io=FALSE; /* Whether the 'optimized' I/O routines with be parallel */
#ifdef H5_HAVE_PARALLEL
hbool_t xfer_mode_changed=FALSE; /* Whether the transfer mode was changed */
+ int prop_value,new_value;
+ htri_t check_prop;
#endif /*H5_HAVE_PARALLEL*/
H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */
H5D_dxpl_cache_t *dxpl_cache=&_dxpl_cache; /* Data transfer property cache */
@@ -756,10 +757,33 @@ H5D_read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
} /* end switch */
/* Get dataspace functions */
- if (NULL==(sconv=H5S_find(mem_space, file_space, sconv_flags, &use_par_opt_io)))
+ if (NULL==(sconv=H5S_find(dataset->ent.file, mem_space, file_space, sconv_flags, &use_par_opt_io, &dataset->layout)))
HGOTO_ERROR (H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert from file to memory data space")
#ifdef H5_HAVE_PARALLEL
+#ifdef H5_HAVE_INSTRUMENTED_LIBRARY
+ /**** Test for collective chunk IO
+ notice the following code should be removed after
+ a more general collective chunk IO algorithm is applied.
+ */
+
+ if(dataset->layout.type == H5D_CHUNKED) { /*only check for chunking storage */
+ check_prop = H5Pexist(dxpl_id,H5D_XFER_COLL_CHUNK_NAME);
+ if(check_prop < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to check property list");
+ if(check_prop > 0) {
+ if(H5Pget(dxpl_id,H5D_XFER_COLL_CHUNK_NAME,&prop_value)<0)
+ HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to get property value");
+ if(!use_par_opt_io) {
+ new_value = 0;
+ if(H5Pset(dxpl_id,H5D_XFER_COLL_CHUNK_NAME,&new_value)<0)
+ HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to set property value");
+ }
+ }
+ }
+ /* end Test for collective chunk IO */
+#endif /* H5_HAVE_INSTRUMENTED_LIBRARY */
+
/* Don't reset the transfer mode if we can't or won't use it */
if(!use_par_opt_io || !H5T_path_noop(tpath))
H5D_io_assist_mpio(dxpl_id, dxpl_cache, &xfer_mode_changed);
@@ -846,6 +870,8 @@ H5D_write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
hbool_t use_par_opt_io=FALSE; /* Whether the 'optimized' I/O routines with be parallel */
#ifdef H5_HAVE_PARALLEL
hbool_t xfer_mode_changed=FALSE; /* Whether the transfer mode was changed */
+ int prop_value,new_value;
+ htri_t check_prop;
#endif /*H5_HAVE_PARALLEL*/
H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */
H5D_dxpl_cache_t *dxpl_cache=&_dxpl_cache; /* Data transfer property cache */
@@ -978,10 +1004,33 @@ H5D_write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space,
} /* end switch */
/* Get dataspace functions */
- if (NULL==(sconv=H5S_find(mem_space, file_space, sconv_flags, &use_par_opt_io)))
+ if (NULL==(sconv=H5S_find(dataset->ent.file, mem_space, file_space, sconv_flags, &use_par_opt_io, &dataset->layout)))
HGOTO_ERROR (H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to convert from memory to file data space")
#ifdef H5_HAVE_PARALLEL
+#ifdef H5_HAVE_INSTRUMENTED_LIBRARY
+ /**** Test for collective chunk IO
+ notice the following code should be removed after
+ a more general collective chunk IO algorithm is applied.
+ */
+
+ if(dataset->layout.type == H5D_CHUNKED) { /*only check for chunking storage */
+
+ check_prop = H5Pexist(dxpl_id,H5D_XFER_COLL_CHUNK_NAME);
+ if(check_prop < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to check property list");
+ if(check_prop > 0) {
+ if(H5Pget(dxpl_id,H5D_XFER_COLL_CHUNK_NAME,&prop_value)<0)
+ HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to get property value");
+ if(!use_par_opt_io) {
+ new_value = 0;
+ if(H5Pset(dxpl_id,H5D_XFER_COLL_CHUNK_NAME,&new_value)<0)
+ HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to set property value");
+ }
+ }
+ }
+#endif /* H5_HAVE_INSTRUMENTED_LIBRARY */
+
/* Don't reset the transfer mode if we can't or won't use it */
if(!use_par_opt_io || !H5T_path_noop(tpath))
H5D_io_assist_mpio(dxpl_id, dxpl_cache, &xfer_mode_changed);
@@ -2494,7 +2543,7 @@ H5D_create_chunk_map(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *file_sp
} /* end if */
} /* end else */
-#ifdef QAK
+#ifdef QAK
{
int mpi_rank;
double time;
diff --git a/src/H5Distore.c b/src/H5Distore.c
index 136ed69..daa2582 100644
--- a/src/H5Distore.c
+++ b/src/H5Distore.c
@@ -146,8 +146,6 @@ typedef struct H5D_istore_ud1_t {
#define H5D_HASH(D,ADDR) H5F_addr_hash(ADDR,(D)->cache.chunk.nslots)
/* Private prototypes */
-static haddr_t H5D_istore_get_addr(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
- const hssize_t offset[], H5D_istore_ud1_t *_udata);
static void *H5D_istore_chunk_alloc(size_t size, const H5O_pline_t *pline);
static void *H5D_istore_chunk_xfree(void *chk, const H5O_pline_t *pline);
static herr_t H5D_istore_shared_free (void *page);
@@ -2164,7 +2162,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-static haddr_t
+haddr_t
H5D_istore_get_addr(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
const hssize_t offset[], H5D_istore_ud1_t *_udata)
{
diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c
index 581a20a..e8da931 100644
--- a/src/H5Dmpio.c
+++ b/src/H5Dmpio.c
@@ -39,6 +39,10 @@
#ifdef H5_HAVE_PARALLEL
+/* Interface initialization */
+#define INTERFACE_INIT NULL
+static int interface_initialize_g = 0;
+
static herr_t
H5D_mpio_spaces_xfer(H5F_t *f, const H5D_t *dset, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space,
@@ -219,11 +223,12 @@ H5D_mpio_spaces_read(H5F_t *f, const H5D_dxpl_cache_t UNUSED *dxpl_cache, hid_t
{
herr_t ret_value;
- FUNC_ENTER_NOAPI_NOFUNC(H5D_mpio_spaces_read);
+ 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*/);
+done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5D_mpio_spaces_read() */
@@ -257,12 +262,13 @@ H5D_mpio_spaces_write(H5F_t *f, const H5D_dxpl_cache_t UNUSED *dxpl_cache, hid_t
{
herr_t ret_value;
- FUNC_ENTER_NOAPI_NOFUNC(H5D_mpio_spaces_write);
+ 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*/);
+done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5D_mpio_spaces_write() */
#endif /* H5_HAVE_PARALLEL */
diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h
index e1d4b71..30183c3 100644
--- a/src/H5Dpkg.h
+++ b/src/H5Dpkg.h
@@ -33,7 +33,7 @@
/* Other private headers needed by this file */
#include "H5Gprivate.h" /* Groups */
#include "H5Oprivate.h" /* Object headers */
-#include "H5Sprivate.h" /* Dataspace functions */
+#include "H5Sprivate.h" /* Dataspaces */
#include "H5Tprivate.h" /* Datatype functions */
/**************************/
diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h
index 163c1a6..f8fef09 100644
--- a/src/H5Dprivate.h
+++ b/src/H5Dprivate.h
@@ -154,6 +154,12 @@
#define H5D_XFER_FILTER_CB_NAME "filter_cb"
#define H5D_XFER_FILTER_CB_SIZE sizeof(H5Z_cb_t)
#define H5D_XFER_FILTER_CB_DEF {NULL,NULL}
+#ifdef H5_HAVE_INSTRUMENTED_LIBRARY
+/* Definitions for collective chunk I/O property */
+#define H5D_XFER_COLL_CHUNK_NAME "coll_chunk"
+#define H5D_XFER_COLL_CHUNK_SIZE sizeof(unsigned)
+#define H5D_XFER_COLL_CHUNK_DEF 1
+#endif /* H5_HAVE_INSTRUMENTED_LIBRARY */
/****************************/
/* Library Private Typedefs */
@@ -247,6 +253,9 @@ H5_DLL ssize_t H5D_compact_writevv(H5F_t *f, hid_t dxpl_id, H5D_t *dset,
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[],
const void *buf);
+/* forward reference for collective-chunk IO use */
+struct H5D_istore_ud1_t; /*define at H5Distore.c*/
+
/* Functions that operate on indexed storage */
H5_DLL herr_t H5D_istore_delete(H5F_t *f, hid_t dxpl_id,
const H5O_layout_t *layout);
@@ -260,7 +269,29 @@ H5_DLL ssize_t H5D_istore_writevv(H5F_t *f, const H5D_dxpl_cache_t *dxpl_cache,
size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[], hsize_t chunk_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[],
const void *buf);
+H5_DLL haddr_t H5D_istore_get_addr(H5F_t *f, hid_t dxpl_id,
+ const H5O_layout_t *layout, const hssize_t offset[],
+ struct H5D_istore_ud1_t *_udata);
H5_DLL herr_t H5D_istore_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream,
int indent, int fwidth, int ndims);
+#ifdef H5_HAVE_PARALLEL
+/* Forward references */
+struct H5S_t;
+
+/* MPI-IO function to read directly from app buffer to file rky980813 */
+H5_DLL herr_t H5D_mpio_spaces_read(H5F_t *f, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id,
+ H5D_t *dset, const H5D_storage_t *store,
+ size_t nelmts, size_t elmt_size,
+ const struct H5S_t *file_space, const struct H5S_t *mem_space,
+ void *buf/*out*/);
+
+/* MPI-IO function to write directly from app buffer to file rky980813 */
+H5_DLL herr_t H5D_mpio_spaces_write(H5F_t *f, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id,
+ H5D_t *dset, const H5D_storage_t *store,
+ size_t nelmts, size_t elmt_size,
+ const struct H5S_t *file_space, const struct H5S_t *mem_space,
+ const void *buf);
+#endif /* H5_HAVE_PARALLEL */
+
#endif
diff --git a/src/H5S.c b/src/H5S.c
index 5c42787..3ad61f8 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -14,14 +14,18 @@
#define H5S_PACKAGE /*suppress error about including H5Spkg */
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5S_mask
+
#define _H5S_IN_H5S_C
-#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Error handling */
-#include "H5Iprivate.h" /* ID Functions */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5MMprivate.h" /* Memory Management functions */
-#include "H5Oprivate.h" /* object headers */
-#include "H5Spkg.h" /* Dataspace functions */
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free lists */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Oprivate.h" /* Object headers */
+#include "H5Spkg.h" /* Dataspaces */
/* Local static function prototypes */
static H5S_t * H5S_create(H5S_class_t type);
@@ -30,7 +34,6 @@ static herr_t H5S_set_extent_simple (H5S_t *space, unsigned rank,
static htri_t H5S_is_simple(const H5S_t *sdim);
/* Interface initialization */
-#define PABLO_MASK H5S_mask
#define INTERFACE_INIT H5S_init_interface
static int interface_initialize_g = 0;
static herr_t H5S_init_interface(void);
@@ -1403,7 +1406,12 @@ done:
*-------------------------------------------------------------------------
*/
H5S_conv_t *
-H5S_find (const H5S_t *mem_space, const H5S_t *file_space, unsigned
+H5S_find (const H5F_t
+#ifndef H5_HAVE_PARALLEL
+UNUSED
+#endif/* H5_HAVE_PARALLEL*/
+*file,
+const H5S_t *mem_space, const H5S_t *file_space, unsigned
#ifndef H5_HAVE_PARALLEL
UNUSED
#endif /* H5_HAVE_PARALLEL */
@@ -1411,7 +1419,13 @@ flags, hbool_t
#ifndef H5_HAVE_PARALLEL
UNUSED
#endif /* H5_HAVE_PARALLEL */
-*use_par_opt_io)
+*use_par_opt_io,
+#ifndef H5_HAVE_PARALLEL
+UNUSED
+#endif
+const H5O_layout_t *layout
+
+)
{
H5S_conv_t *path=NULL; /* Space conversion path */
#ifdef H5_HAVE_PARALLEL
@@ -1441,15 +1455,15 @@ UNUSED
/*
* Check if we can set direct MPI-IO read/write functions
*/
- opt=H5S_mpio_opt_possible(mem_space,file_space,flags);
+ opt=H5S_mpio_opt_possible(file,mem_space,file_space,flags,layout);
if(opt==FAIL)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, NULL, "invalid check for contiguous dataspace ");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, NULL, "invalid check for direct IO dataspace ");
/* Check if we can use the optimized parallel I/O routines */
if(opt==TRUE) {
/* Set the pointers to the MPI-specific routines */
- H5S_conv_g[i]->read = H5S_mpio_spaces_read;
- H5S_conv_g[i]->write = H5S_mpio_spaces_write;
+ H5S_conv_g[i]->read = H5D_mpio_spaces_read;
+ H5S_conv_g[i]->write = H5D_mpio_spaces_write;
/* Indicate that the I/O will be parallel */
*use_par_opt_io=TRUE;
@@ -1483,15 +1497,15 @@ UNUSED
/*
* Check if we can set direct MPI-IO read/write functions
*/
- opt=H5S_mpio_opt_possible(mem_space,file_space,flags);
+ opt=H5S_mpio_opt_possible(file,mem_space,file_space,flags,layout);
if(opt==FAIL)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, NULL, "invalid check for contiguous dataspace ");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, NULL, "invalid check for direct IO dataspace ");
/* Check if we can use the optimized parallel I/O routines */
if(opt==TRUE) {
/* Set the pointers to the MPI-specific routines */
- path->read = H5S_mpio_spaces_read;
- path->write = H5S_mpio_spaces_write;
+ path->read = H5D_mpio_spaces_read;
+ path->write = H5D_mpio_spaces_write;
/* Indicate that the I/O will be parallel */
*use_par_opt_io=TRUE;
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index f468db0..735a339 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -2295,7 +2295,7 @@ H5S_hyper_span_blocklist(H5S_hyper_span_info_t *spans, hssize_t start[], hssize_
hsize_t u; /* Index variable */
herr_t ret_value=SUCCEED; /* return value */
- FUNC_ENTER_NOAPI(H5S_hyper_span_blocklist, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_span_blocklist);
/* Sanity checks */
assert(spans);
@@ -2389,7 +2389,7 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-herr_t
+static herr_t
H5S_get_select_hyper_blocklist(H5S_t *space, hbool_t internal, hsize_t startblock, hsize_t numblocks, hsize_t *buf)
{
H5S_hyper_dim_t *diminfo; /* Alias for dataspace's diminfo information */
@@ -2621,16 +2621,15 @@ H5S_hyper_bounds_helper (const H5S_hyper_span_info_t *spans, const hssize_t *off
/* Recurse if this node has down spans */
if(curr->down!=NULL) {
- if(H5S_hyper_bounds_helper(curr->down,offset,rank+1,start,end)<0) {
- ret_value=FAIL;
- break;
- } /* end if */
+ if(H5S_hyper_bounds_helper(curr->down,offset,rank+1,start,end)<0)
+ HGOTO_DONE(FAIL)
} /* end if */
/* Advance to next node */
curr=curr->next;
} /* end while */
+done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5S_hyper_bounds_helper() */
@@ -2913,7 +2912,7 @@ H5S_hyper_is_single(const H5S_t *space)
H5S_hyper_span_info_t *spans; /* Hyperslab span info node */
H5S_hyper_span_t *span; /* Hyperslab span node */
unsigned u; /* index variable */
- htri_t ret_value=FALSE; /* return value */
+ htri_t ret_value=TRUE; /* return value */
FUNC_ENTER_NOAPI(H5S_hyper_is_single, FAIL);
@@ -2926,24 +2925,16 @@ H5S_hyper_is_single(const H5S_t *space)
* block (i.e. count==1 in all dimensions)
*/
- /* Initialize flags */
- ret_value=TRUE; /* assume true and reset if the dimensions don't match */
-
/* Check for a single block */
for(u=0; u<space->extent.rank; u++) {
- if(space->select.sel_info.hslab->opt_diminfo[u].count>1) {
- ret_value=FALSE;
- break;
- } /* end if */
+ if(space->select.sel_info.hslab->opt_diminfo[u].count>1)
+ HGOTO_DONE(FALSE)
} /* end for */
} /* end if */
else {
/*
* For a region to be single, it must have only one block
*/
- /* Initialize flags */
- ret_value=TRUE; /* assume true and reset if the dimensions don't match */
-
/* Get information for slowest changing information */
spans=space->select.sel_info.hslab->span_lst;
@@ -2952,14 +2943,11 @@ H5S_hyper_is_single(const H5S_t *space)
span=spans->head;
/* Check that this is the only span and it spans the entire dimension */
- if(span->next!=NULL) {
- ret_value=FALSE;
- break;
- } /* end if */
- else {
+ if(span->next!=NULL)
+ HGOTO_DONE(FALSE)
+ else
/* Walk down to the next span */
spans=span->down;
- } /* end else */
} /* end while */
} /* end else */
@@ -3809,7 +3797,6 @@ static herr_t
H5S_hyper_adjust_helper (H5S_hyper_span_info_t *spans, const hssize_t *offset)
{
H5S_hyper_span_t *span; /* Pointer to current span in span tree */
- herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_adjust_helper);
@@ -3834,18 +3821,15 @@ H5S_hyper_adjust_helper (H5S_hyper_span_info_t *spans, const hssize_t *offset)
assert(span->high>=0);
/* Recursively adjust spans in next dimension down */
- if(span->down!=NULL) {
- if(H5S_hyper_adjust_helper(span->down,offset+1)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab adjustment");
- } /* end if */
+ if(span->down!=NULL)
+ H5S_hyper_adjust_helper(span->down,offset+1);
/* Advance to next span in this dimension */
span=span->next;
} /* end while */
} /* end if */
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* H5S_hyper_adjust_helper() */
@@ -3924,7 +3908,6 @@ static herr_t
H5S_hyper_move_helper (H5S_hyper_span_info_t *spans, const hssize_t *offset)
{
H5S_hyper_span_t *span; /* Pointer to current span in span tree */
- herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_move_helper);
@@ -3949,18 +3932,15 @@ H5S_hyper_move_helper (H5S_hyper_span_info_t *spans, const hssize_t *offset)
assert(span->low>=0);
/* Recursively move spans in next dimension down */
- if(span->down!=NULL) {
- if(H5S_hyper_move_helper(span->down,offset+1)<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab movement");
- } /* end if */
+ if(span->down!=NULL)
+ H5S_hyper_move_helper(span->down,offset+1);
/* Advance to next span in this dimension */
span=span->next;
} /* end while */
} /* end if */
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* H5S_hyper_move_helper() */
@@ -5280,7 +5260,6 @@ H5S_hyper_rebuild (H5S_t *space)
H5S_hyper_dim_t *app_diminfo; /* "Application view" per-dimension for the selection */
H5S_hyper_span_t *span; /* Current hyperslab span */
unsigned curr_dim; /* Current dimension being worked on */
- herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_rebuild);
@@ -5321,7 +5300,7 @@ H5S_hyper_rebuild (H5S_t *space)
space->select.sel_info.hslab->diminfo_valid=TRUE;
} /* end if */
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* H5S_hyper_rebuild() */
@@ -6828,14 +6807,14 @@ H5S_hyper_get_seq_list_opt(const H5S_t *space,H5S_sel_iter_t *iter,
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-herr_t
+static herr_t
H5S_hyper_get_seq_list(const H5S_t *space, unsigned UNUSED flags, H5S_sel_iter_t *iter,
size_t maxseq, size_t maxelem, size_t *nseq, size_t *nelem,
hsize_t *off, size_t *len)
{
herr_t ret_value; /* return value */
- FUNC_ENTER_NOAPI (H5S_hyper_get_seq_list, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_get_seq_list);
/* Check args */
assert(space);
@@ -6855,7 +6834,6 @@ H5S_hyper_get_seq_list(const H5S_t *space, unsigned UNUSED flags, H5S_sel_iter_t
/* Call the general sequence generator routine */
ret_value=H5S_hyper_get_seq_list_gen(space,iter,maxseq,maxelem,nseq,nelem,off,len);
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5S_hyper_get_seq_list() */
diff --git a/src/H5Smpio.c b/src/H5Smpio.c
index c8aab2d..bf8f717 100644
--- a/src/H5Smpio.c
+++ b/src/H5Smpio.c
@@ -21,7 +21,6 @@
* I didn't make them portable.
*/
-#define H5F_PACKAGE /*suppress error about including H5Fpkg */
#define H5S_PACKAGE /*suppress error about including H5Spkg */
/* Pablo information */
@@ -29,10 +28,12 @@
#define PABLO_MASK H5S_mpio_mask
#include "H5private.h" /* Generic Functions */
+#include "H5Dprivate.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
-#include "H5Fpkg.h" /* Files */
+#include "H5Fprivate.h" /* File access */
#include "H5FDprivate.h" /* File drivers */
#include "H5Iprivate.h" /* IDs */
+#include "H5Oprivate.h" /* Object headers */
#include "H5Pprivate.h" /* Property lists */
#include "H5Spkg.h" /* Dataspaces */
@@ -63,17 +64,6 @@ H5S_mpio_hyper_type( const H5S_t *space, size_t elmt_size,
size_t *count,
hsize_t *extra_offset,
hbool_t *is_derived_type );
-static herr_t
-H5S_mpio_space_type( const H5S_t *space, size_t elmt_size,
- /* out: */
- MPI_Datatype *new_type,
- size_t *count,
- hsize_t *extra_offset,
- hbool_t *is_derived_type );
-static herr_t
-H5S_mpio_spaces_xfer(H5F_t *f, const H5D_t *dset, size_t elmt_size,
- const H5S_t *file_space, const H5S_t *mem_space,
- hid_t dxpl_id, void *buf/*out*/, hbool_t do_write);
/*-------------------------------------------------------------------------
@@ -522,7 +512,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-static herr_t
+herr_t
H5S_mpio_space_type( const H5S_t *space, size_t elmt_size,
/* out: */
MPI_Datatype *new_type,
@@ -586,221 +576,6 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5S_mpio_spaces_xfer
- *
- * Purpose: Use MPI-IO to transfer data efficiently
- * directly between app buffer and file.
- *
- * Return: non-negative on success, negative on failure.
- *
- * Programmer: rky 980813
- *
- * Notes:
- * For collective data transfer only since this would eventually call
- * H5FD_mpio_setup to do setup to eveually call MPI_File_set_view in
- * H5FD_mpio_read or H5FD_mpio_write. MPI_File_set_view is a collective
- * call. Letting independent data transfer use this route would result in
- * hanging.
- *
- * The preconditions for calling this routine are located in the
- * H5S_mpio_opt_possible() routine, which determines whether this routine
- * can be called for a given dataset transfer.
- *
- * Modifications:
- * rky 980918
- * Added must_convert parameter to let caller know we can't optimize
- * the xfer.
- *
- * Albert Cheng, 001123
- * Include the MPI_type freeing as part of cleanup code.
- *
- * QAK - 2002/04/02
- * Removed the must_convert parameter and move preconditions to
- * H5S_mpio_opt_possible() routine
- *
- * QAK - 2002/06/17
- * Removed 'disp' parameter from H5FD_mpio_setup routine and use the
- * address of the dataset in MPI_File_set_view() calls, as necessary.
- *
- * QAK - 2002/06/18
- * Removed 'dc_plist' parameter, since it was not used. Also, switch to
- * getting the 'extra_offset' setting for each selection.
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5S_mpio_spaces_xfer(H5F_t *f, const H5D_t *dset, size_t elmt_size,
- const H5S_t *file_space, const H5S_t *mem_space,
- hid_t dxpl_id, 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 */
- hsize_t mpi_buf_offset, mpi_file_offset; /* Offset within dataset where selection (ie. MPI type) begins */
- MPI_Datatype mpi_buf_type, mpi_file_type; /* MPI types for buffer (memory) and file */
- hbool_t mbt_is_derived=0, /* Whether the buffer (memory) type is derived and needs to be free'd */
- mft_is_derived=0; /* Whether the file type is derived and needs to be free'd */
- hbool_t plist_is_setup=0; /* Whether the dxpl has been customized */
- uint8_t *buf=(uint8_t *)_buf; /* Alias for pointer arithmetic */
- int mpi_code; /* MPI return code */
- herr_t ret_value = SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI_NOINIT(H5S_mpio_spaces_xfer);
-
- /* Check args */
- assert (f);
- assert (dset);
- assert (file_space);
- assert (mem_space);
- assert (buf);
- assert (IS_H5FD_MPIO(f));
- /* Make certain we have the correct type of property list */
- assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER));
-
- /* create the MPI buffer type */
- if (H5S_mpio_space_type( mem_space, elmt_size,
- /* out: */
- &mpi_buf_type,
- &mpi_buf_count,
- &mpi_buf_offset,
- &mbt_is_derived )<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't create MPI buf type");
-
- /* create the MPI file type */
- if ( H5S_mpio_space_type( file_space, elmt_size,
- /* out: */
- &mpi_file_type,
- &mpi_file_count,
- &mpi_file_offset,
- &mft_is_derived )<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't create MPI file type");
-
- addr = H5D_contig_get_addr(dset) + mpi_file_offset;
-#ifdef H5Smpi_DEBUG
- HDfprintf(stderr, "spaces_xfer: relative addr=%a\n", addr );
-#endif
-
- /*
- * 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)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O properties");
- plist_is_setup=1;
-
- /* Adjust the buffer pointer to the beginning of the selection */
- buf+=mpi_buf_offset;
-
- /* transfer the data */
- if (do_write) {
- if (H5F_block_write(f, H5FD_MEM_DRAW, addr, mpi_buf_count, 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)
- 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)
- HDONE_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "unable to reset dxpl values");
- } /* end if */
-
- /* free the MPI buf and file types */
- if (mbt_is_derived) {
- if (MPI_SUCCESS != (mpi_code= MPI_Type_free( &mpi_buf_type )))
- HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code);
- }
- if (mft_is_derived) {
- if (MPI_SUCCESS != (mpi_code= MPI_Type_free( &mpi_file_type )))
- HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code);
- }
-
- FUNC_LEAVE_NOAPI(ret_value);
-} /* end H5S_mpio_spaces_xfer() */
-
-
-/*-------------------------------------------------------------------------
- * Function: H5S_mpio_spaces_read
- *
- * Purpose: MPI-IO function to read directly from app buffer to file.
- *
- * Return: non-negative on success, negative on failure.
- *
- * Programmer: rky 980813
- *
- * Modifications:
- *
- * rky 980918
- * Added must_convert parameter to let caller know we can't optimize the xfer.
- *
- * QAK - 2002/04/02
- * Removed the must_convert parameter and move preconditions to
- * H5S_mpio_opt_possible() routine
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5S_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 UNUSED *store,
- size_t UNUSED nelmts, size_t elmt_size,
- const H5S_t *file_space, const H5S_t *mem_space,
- void *buf/*out*/)
-{
- herr_t ret_value;
-
- FUNC_ENTER_NOAPI(H5S_mpio_spaces_read, FAIL);
-
- ret_value = H5S_mpio_spaces_xfer(f, dset, elmt_size, file_space,
- mem_space, dxpl_id, buf, 0/*read*/);
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
-} /* end H5S_mpio_spaces_read() */
-
-
-/*-------------------------------------------------------------------------
- * Function: H5S_mpio_spaces_write
- *
- * Purpose: MPI-IO function to write directly from app buffer to file.
- *
- * Return: non-negative on success, negative on failure.
- *
- * Programmer: rky 980813
- *
- * Modifications:
- *
- * rky 980918
- * Added must_convert parameter to let caller know we can't optimize the xfer.
- *
- * QAK - 2002/04/02
- * Removed the must_convert parameter and move preconditions to
- * H5S_mpio_opt_possible() routine
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5S_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 UNUSED *store,
- size_t UNUSED nelmts, size_t elmt_size,
- const H5S_t *file_space, const H5S_t *mem_space,
- const void *buf)
-{
- herr_t ret_value;
-
- FUNC_ENTER_NOAPI(H5S_mpio_spaces_write, FAIL);
-
- /*OKAY: CAST DISCARDS CONST QUALIFIER*/
- ret_value = H5S_mpio_spaces_xfer(f, dset, elmt_size, file_space,
- mem_space, dxpl_id, (void*)buf, 1/*write*/);
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
-} /* end H5S_mpio_spaces_write() */
-
-
-/*-------------------------------------------------------------------------
* Function: H5S_mpio_opt_possible
*
* Purpose: Checks if an direct I/O transfer is possible between memory and
@@ -817,7 +592,7 @@ done:
*-------------------------------------------------------------------------
*/
htri_t
-H5S_mpio_opt_possible( const H5S_t *mem_space, const H5S_t *file_space, const unsigned flags)
+H5S_mpio_opt_possible( const H5F_t *file, const H5S_t *mem_space, const H5S_t *file_space, const unsigned flags,const H5O_layout_t *layout)
{
htri_t c1,c2; /* Flags whether a selection is optimizable */
htri_t ret_value=TRUE;
@@ -849,12 +624,126 @@ H5S_mpio_opt_possible( const H5S_t *mem_space, const H5S_t *file_space, const un
if (H5S_SEL_POINTS==H5S_GET_SELECT_TYPE(mem_space) || H5S_SEL_POINTS==H5S_GET_SELECT_TYPE(file_space))
HGOTO_DONE(FALSE);
- /* Dataset storage must be contiguous currently */
- if ((flags&H5S_CONV_STORAGE_MASK)!=H5S_CONV_STORAGE_CONTIGUOUS)
+ /* Dataset storage must be contiguous or chunked */
+ if ((flags&H5S_CONV_STORAGE_MASK)!=H5S_CONV_STORAGE_CONTIGUOUS &&
+ (flags&H5S_CONV_STORAGE_MASK)!=H5S_CONV_STORAGE_CHUNKED)
HGOTO_DONE(FALSE);
+ if ((flags&H5S_CONV_STORAGE_MASK)==H5S_CONV_STORAGE_CHUNKED) {
+ hsize_t chunk_dim[H5O_LAYOUT_NDIMS]; /* Chunk dimensions */
+ hssize_t startf[H5S_MAX_RANK], /* Selection start bounds */
+ endf[H5S_MAX_RANK]; /* Selection end bounds */
+ unsigned dim_rankf; /* Number of dimensions of file dataspace */
+ int pcheck_hyper,check_hyper, /* Flags for checking if selection is in one chunk */
+ tnum_chunkf, /* Number of chunks selection overlaps */
+ max_chunkf, /* Maximum number of chunks selection overlaps */
+ min_chunkf, /* Minimum number of chunks selection overlaps */
+ num_chunks_same; /* Flag indicating whether all processes have the same # of chunks to operate on */
+ unsigned dim_chunks; /* Temporary number of chunks in a dimension */
+ MPI_Comm comm; /* MPI communicator for file */
+ int mpi_rank; /* Rank in MPI communicator */
+ int mpi_code; /* MPI return code */
+ unsigned u; /* Local index variable */
+
+ /* Getting MPI communicator and rank */
+ if((comm = H5F_mpi_get_comm(file))==MPI_COMM_NULL)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve MPI communicator")
+ if((mpi_rank = H5F_mpi_get_rank(file))<0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve MPI rank")
+
+ /* Currently collective chunking storage
+ inside HDF5 is supported for either one of the following two cases:
+ 1. All the hyperslabs for one process is inside one chunk.
+ 2. For single hyperslab selection, the number of chunks that covered
+ the single selection for all processes should be equal.
+ KY, 2004/7/14
+ */
+
+ /* Quincey, please read.
+ This is maybe redundant, I think only when both memory and file space be SCALAR
+ space, the collective IO can work. Otherwise, SELECT_POINT will be reached,collective
+ IO shouldn't work.
+ Please clarify and correct the code on the following,
+ Quincey said that it was probably okay if only one data space is SCALAR,
+ Still keep the code here until we added more tests later.
+ Kent */
+ if(H5S_SCALAR==mem_space->extent.type || H5S_SCALAR ==file_space->extent.type) {
+ if(!(H5S_SCALAR==mem_space->extent.type && H5S_SCALAR ==file_space->extent.type))
+ HGOTO_DONE(FALSE)
+ else
+ HGOTO_DONE(TRUE)
+ } /* end if */
+
+ dim_rankf = file_space->extent.rank;
+
+ if(H5S_SELECT_BOUNDS(file_space,startf,endf)==FAIL)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE,FAIL, "invalid check for single selection blocks");
+
+ for(u=0; u < layout->u.chunk.ndims; u++)
+ chunk_dim[u] = layout->u.chunk.dim[u];
+
+ /* Case 1: check whether all hyperslab in this process is inside one chunk.
+ Note: we don't handle when starting point is less than zero since that may cover
+ two chunks. */
+
+ /*for file space checking*/
+ pcheck_hyper = 1;
+ for (u=0; u<dim_rankf; u++)
+ if(endf[u]/chunk_dim[u]!=startf[u]/chunk_dim[u]) {
+ pcheck_hyper = 0;
+ break;
+ }
+
+ if (MPI_SUCCESS != (mpi_code= MPI_Reduce(&pcheck_hyper,&check_hyper,1,MPI_INT,MPI_LAND,0,comm)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Reduce failed", mpi_code)
+ if (MPI_SUCCESS != (mpi_code= MPI_Bcast(&check_hyper,1,MPI_INT,0,comm)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_code)
+
+ /*if check_hyper is true, condition for collective IO case is fulfilled, no
+ need to do further test. */
+ if(check_hyper)
+ HGOTO_DONE(TRUE);
+
+ /* Case 2:Check whether the number of chunks that covered the single hyperslab is the same.
+ If not,no collective chunk IO.
+ KY, 2004/7/14
+ */
+
+ c1 = H5S_SELECT_IS_SINGLE(file_space);
+ c2 = H5S_SELECT_IS_SINGLE(mem_space);
+
+ if(c1==FAIL || c2 ==FAIL)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "invalid check for single selection blocks");
+ if(c1==FALSE || c2 ==FALSE)
+ HGOTO_DONE(FALSE);
+
+ /* Compute the number of chunks covered by the selection on this process */
+ tnum_chunkf = 1;
+ for (u=0; u<dim_rankf; u++) {
+ dim_chunks = (endf[u]/chunk_dim[u]-startf[u]/chunk_dim[u])+1;
+ tnum_chunkf = dim_chunks*tnum_chunkf;
+ }
+
+ /* Determine the minimum and maximum # of chunks for all processes */
+ if (MPI_SUCCESS != (mpi_code= MPI_Reduce(&tnum_chunkf,&max_chunkf,1,MPI_INT,MPI_MAX,0,comm)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Reduce failed", mpi_code)
+ if (MPI_SUCCESS != (mpi_code= MPI_Reduce(&tnum_chunkf,&min_chunkf,1,MPI_INT,MPI_MIN,0,comm)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Reduce failed", mpi_code)
+
+ /* Let the rank==0 process determine if the same number of chunks will be operated on by all processes */
+ if(mpi_rank == 0)
+ num_chunks_same = (max_chunkf==min_chunkf);
+
+ /* Broadcast the flag indicating the number of chunks are the same */
+ if (MPI_SUCCESS != (mpi_code= MPI_Bcast(&num_chunks_same,1,MPI_INT,0,comm)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_code)
+
+ /* Can't handle case when number of chunks is different (yet) */
+ if(!num_chunks_same)
+ HGOTO_DONE(FALSE);
+ }
+
done:
FUNC_LEAVE_NOAPI(ret_value);
} /* H5S_mpio_opt_possible() */
-
#endif /* H5_HAVE_PARALLEL */
diff --git a/src/H5Spkg.h b/src/H5Spkg.h
index 82bfec2..ce93770 100644
--- a/src/H5Spkg.h
+++ b/src/H5Spkg.h
@@ -224,24 +224,10 @@ H5_DLL herr_t H5S_extent_copy(H5S_extent_t *dst, const H5S_extent_t *src);
/* Operations on selections */
#ifdef H5_HAVE_PARALLEL
-/* MPI-IO function to read directly from app buffer to file rky980813 */
-H5_DLL herr_t H5S_mpio_spaces_read(H5F_t *f, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id,
- H5D_t *dset, const H5D_storage_t *store,
- size_t nelmts, size_t elmt_size,
- const H5S_t *file_space, const H5S_t *mem_space,
- void *buf/*out*/);
-
-/* MPI-IO function to write directly from app buffer to file rky980813 */
-H5_DLL herr_t H5S_mpio_spaces_write(H5F_t *f, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id,
- H5D_t *dset, const H5D_storage_t *store,
- size_t nelmts, size_t elmt_size,
- const H5S_t *file_space, const H5S_t *mem_space,
- const void *buf);
-
/* MPI-IO function to check if a direct I/O transfer is possible between
* memory and the file */
-H5_DLL htri_t H5S_mpio_opt_possible(const H5S_t *mem_space,
- const H5S_t *file_space, const unsigned flags);
+H5_DLL htri_t H5S_mpio_opt_possible(const H5F_t *file, const H5S_t *mem_space,
+ const H5S_t *file_space, const unsigned flags, const H5O_layout_t *layout);
#endif /* H5_HAVE_PARALLEL */
diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h
index 7de895a..efa9b30 100644
--- a/src/H5Sprivate.h
+++ b/src/H5Sprivate.h
@@ -206,8 +206,8 @@ typedef struct H5S_conv_t {
/* Operations on dataspaces */
H5_DLL H5S_t *H5S_copy(const H5S_t *src, hbool_t share_selection);
H5_DLL herr_t H5S_close(H5S_t *ds);
-H5_DLL H5S_conv_t *H5S_find(const H5S_t *mem_space, const H5S_t *file_space,
- unsigned flags, hbool_t *use_par_opt_io);
+H5_DLL H5S_conv_t *H5S_find(const H5F_t *file,const H5S_t *mem_space, const H5S_t *file_space,
+ unsigned flags, hbool_t *use_par_opt_io,const H5O_layout_t *layout );
H5_DLL H5S_class_t H5S_get_simple_extent_type(const H5S_t *ds);
H5_DLL hssize_t H5S_get_simple_extent_npoints(const H5S_t *ds);
H5_DLL hsize_t H5S_get_npoints_max(const H5S_t *ds);
@@ -287,8 +287,6 @@ H5_DLL herr_t H5S_select_elements (H5S_t *space, H5S_seloper_t op,
/* Operations on hyperslab selections */
H5_DLL herr_t H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, const hssize_t start[],
const hsize_t *stride, const hsize_t count[], const hsize_t *block);
-H5_DLL herr_t H5S_get_select_hyper_blocklist(H5S_t *space, hbool_t internal,
- hsize_t startblock, hsize_t numblocks, hsize_t *buf);
H5_DLL herr_t H5S_hyper_add_span_element(H5S_t *space, unsigned rank,
hssize_t *coords);
H5_DLL herr_t H5S_hyper_reset_scratch(H5S_t *space);
@@ -314,6 +312,14 @@ H5_DLL herr_t H5S_select_iter_release(H5S_sel_iter_t *sel_iter);
/* (Defined in H5S.c) */
H5_DLLVAR hbool_t H5S_mpi_opt_types_g;
#endif /* _H5S_IN_H5S_C */
+
+H5_DLL herr_t
+H5S_mpio_space_type( const H5S_t *space, size_t elmt_size,
+ /* out: */
+ MPI_Datatype *new_type,
+ size_t *count,
+ hsize_t *extra_offset,
+ hbool_t *is_derived_type );
#endif /* H5_HAVE_PARALLEL */
#endif /* _H5Sprivate_H */
diff --git a/src/H5config.h.in b/src/H5config.h.in
index f91986b..365122d 100644
--- a/src/H5config.h.in
+++ b/src/H5config.h.in
@@ -7,6 +7,9 @@
/* Define if `dev_t' is a scalar */
#undef DEV_T_IS_SCALAR
+/* Define if gettimeofday() populates the tz pointer passed in */
+#undef GETTIMEOFDAY_GIVES_TZ
+
/* Define if the __attribute__(()) extension is present */
#undef HAVE_ATTRIBUTE
@@ -88,6 +91,10 @@
/* Define to 1 if you have the <gpfs.h> header file. */
#undef HAVE_GPFS_H
+/* Define if library will contain instrumentation to detect correct
+ optimization operation */
+#undef HAVE_INSTRUMENTED_LIBRARY
+
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
@@ -356,9 +363,6 @@
/* Define if `__tm_gmtoff' is a member of `struct tm' */
#undef HAVE___TM_GMTOFF
-/* Define if gettimeofday() populates the tz pointer passed in */
-#undef GETTIMEOFDAY_GIVES_TZ
-
/* Define if your system's `MPI_File_set_size' function works for files over
2GB. */
#undef MPI_FILE_SET_SIZE_BIG
diff --git a/src/Makefile.in b/src/Makefile.in
index 96fe515..0458936 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -31,19 +31,19 @@ DISTCLEAN=libhdf5.settings
## Source and object files for the library (lexicographically)...
LIB_SRC=H5.c H5A.c H5AC.c H5B.c H5D.c H5Dcontig.c H5Dcompact.c H5Dio.c \
- H5Distore.c H5Dseq.c H5Dtest.c H5E.c H5F.c H5FD.c H5FDcore.c \
- H5FDfamily.c H5FDgass.c H5FDlog.c H5FDmpi.c H5FDmpio.c H5FDmpiposix.c \
- H5FDmulti.c H5FDsec2.c H5FDsrb.c H5FDstdio.c H5FDstream.c H5FL.c \
- H5FO.c H5FS.c H5G.c H5Gent.c H5Gnode.c H5Gstab.c H5HG.c H5HL.c H5HP.c \
- H5I.c H5MF.c H5MM.c H5O.c H5Oattr.c H5Obogus.c H5Ocont.c H5Odtype.c \
- H5Oefl.c H5Ofill.c H5Olayout.c H5Omtime.c H5Oname.c H5Onull.c \
- H5Opline.c H5Osdspace.c H5Oshared.c H5Ostab.c H5P.c H5Pdcpl.c \
- H5Pdxpl.c H5Pfapl.c H5Pfcpl.c H5Ptest.c H5R.c H5RC.c H5RS.c H5S.c \
- H5Sall.c H5Shyper.c H5Smpio.c H5Snone.c H5Spoint.c H5Sselect.c \
- H5Stest.c H5ST.c H5T.c H5Tarray.c H5Tbit.c H5Tcommit.c H5Tcompound.c \
- H5Tconv.c H5Tcset.c H5Tenum.c H5Tfields.c H5Tfixed.c H5Tfloat.c \
- H5Tinit.c H5Tnative.c H5Toffset.c H5Topaque.c H5Torder.c H5Tpad.c \
- H5Tprecis.c H5Tstrpad.c H5Tvlen.c H5TB.c H5TS.c H5V.c H5Z.c \
+ H5Distore.c H5Dmpio.c H5Dseq.c H5Dtest.c H5E.c H5F.c H5FD.c \
+ H5FDcore.c H5FDfamily.c H5FDgass.c H5FDlog.c H5FDmpi.c H5FDmpio.c \
+ H5FDmpiposix.c H5FDmulti.c H5FDsec2.c H5FDsrb.c H5FDstdio.c \
+ H5FDstream.c H5FL.c H5FO.c H5FS.c H5G.c H5Gent.c H5Gnode.c H5Gstab.c \
+ H5HG.c H5HL.c H5HP.c H5I.c H5MF.c H5MM.c H5O.c H5Oattr.c H5Obogus.c \
+ H5Ocont.c H5Odtype.c H5Oefl.c H5Ofill.c H5Olayout.c H5Omtime.c \
+ H5Oname.c H5Onull.c H5Opline.c H5Osdspace.c H5Oshared.c H5Ostab.c \
+ H5P.c H5Pdcpl.c H5Pdxpl.c H5Pfapl.c H5Pfcpl.c H5Ptest.c H5R.c H5RC.c \
+ H5RS.c H5S.c H5Sall.c H5Shyper.c H5Smpio.c H5Snone.c H5Spoint.c \
+ H5Sselect.c H5Stest.c H5ST.c H5T.c H5Tarray.c H5Tbit.c H5Tcommit.c \
+ H5Tcompound.c H5Tconv.c H5Tcset.c H5Tenum.c H5Tfields.c H5Tfixed.c \
+ H5Tfloat.c H5Tinit.c H5Tnative.c H5Toffset.c H5Topaque.c H5Torder.c \
+ H5Tpad.c H5Tprecis.c H5Tstrpad.c H5Tvlen.c H5TB.c H5TS.c H5V.c H5Z.c \
H5Zdeflate.c H5Zfletcher32.c H5Zshuffle.c H5Zszip.c
LIB_OBJ=$(LIB_SRC:.c=.lo)