summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/H5.c7
-rw-r--r--src/H5D.c22
-rw-r--r--src/H5Distore.c4
-rw-r--r--src/H5F.c6
-rw-r--r--src/H5Fistore.c4
-rw-r--r--src/H5I.c13
-rw-r--r--src/H5Smpio.c2
7 files changed, 39 insertions, 19 deletions
diff --git a/src/H5.c b/src/H5.c
index aefff9e..5ee2f26 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -101,8 +101,13 @@ H5_init_library(void)
/*
* Initialize interfaces that might not be able to initialize themselves
- * soon enough.
+ * soon enough. The file interface must be initialized because calling
+ * H5Pcreate() might require the H5F_access_dflt to be initialized.
*/
+ if (H5F_init()<0) {
+ HRETURN_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL,
+ "unable to initialize file interface");
+ }
if (H5T_init()<0) {
HRETURN_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL,
"unable to initialize type interface");
diff --git a/src/H5D.c b/src/H5D.c
index b299ec3..15c89fd 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -900,7 +900,7 @@ H5D_create(H5G_entry_t *loc, const char *name, const H5T_t *type,
#ifdef HAVE_PARALLEL
/* If MPIO is used, no filter support yet. */
- if (H5FD_MPIO==f->shared->fapl->driver_id &&
+ if (H5FD_MPIO==f->shared->driver_id &&
create_parms->pline.nfilters>0) {
HGOTO_ERROR (H5E_DATASET, H5E_UNSUPPORTED, NULL,
"Parallel IO does not support filters yet");
@@ -1277,7 +1277,7 @@ H5D_open_oid(H5G_entry_t *ent)
#ifdef HAVE_PARALLEL
/* If MPIO is used, no filter support yet. */
- if (H5FD_MPIO==dataset->ent.file->shared->fapl->driver_id &&
+ if (H5FD_MPIO==dataset->ent.file->shared->driver_id &&
dataset->create_parms->pline.nfilters>0){
HGOTO_ERROR (H5E_DATASET, H5E_UNSUPPORTED, NULL,
"Parallel IO does not support filters yet");
@@ -1511,8 +1511,9 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
{
/* Collective access is not permissible with the MPIO driver */
H5FD_mpio_dxpl_t *dx;
- if (H5FD_MPIO==dataset->ent.file->shared->fapl->driver_id &&
- (dx=dataset->ent.file->shared->fapl->driver_info) &&
+ if (H5FD_MPIO==dataset->ent.file->shared->driver_id &&
+ H5FD_MPIO==xfer_parms->driver_id &&
+ (dx=xfer_parms->driver_info) &&
H5FD_MPIO_COLLECTIVE==dx->xfer_mode) {
HGOTO_ERROR (H5E_DATASET, H5E_UNSUPPORTED, FAIL,
"collective access not permissible");
@@ -1556,7 +1557,7 @@ H5D_read(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
* (the latter in case the arguments to sconv_funcs
* turn out to be inappropriate for MPI-IO). */
if (H5_mpi_opt_types_g &&
- H5FD_MPIO==dataset->ent.file->shared->fapl->driver_id) {
+ H5FD_MPIO==dataset->ent.file->shared->driver_id) {
sconv->read = H5S_mpio_spaces_read;
}
#endif /*HAVE_PARALLEL*/
@@ -1867,7 +1868,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
/* If MPIO is used, no VL datatype support yet. */
/* This is because they use the global heap in the file and we don't */
/* support parallel access of that yet */
- if (H5FD_MPIO==dataset->ent.file->shared->fapl->driver_id &&
+ if (H5FD_MPIO==dataset->ent.file->shared->driver_id &&
H5T_get_class(mem_type)==H5T_VLEN) {
HGOTO_ERROR (H5E_DATASET, H5E_UNSUPPORTED, FAIL,
"Parallel IO does not support writing VL datatypes yet");
@@ -1877,7 +1878,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
/* If MPIO is used, no dataset region reference support yet. */
/* This is because they use the global heap in the file and we don't */
/* support parallel access of that yet */
- if (H5FD_MPIO==dataset->ent.file->shared->fapl->driver_id &&
+ if (H5FD_MPIO==dataset->ent.file->shared->driver_id &&
H5T_get_class(mem_type)==H5T_REFERENCE &&
H5T_get_ref_type(mem_type)==H5R_DATASET_REGION) {
HGOTO_ERROR (H5E_DATASET, H5E_UNSUPPORTED, FAIL,
@@ -1917,8 +1918,9 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
{
/* Collective access is not permissible with the MPIO driver */
H5FD_mpio_dxpl_t *dx;
- if (H5FD_MPIO==dataset->ent.file->shared->fapl->driver_id &&
- (dx=dataset->ent.file->shared->fapl->driver_info) &&
+ if (H5FD_MPIO==dataset->ent.file->shared->driver_id &&
+ H5FD_MPIO==xfer_parms->driver_id &&
+ (dx=xfer_parms->driver_info) &&
H5FD_MPIO_COLLECTIVE==dx->xfer_mode) {
HGOTO_ERROR (H5E_DATASET, H5E_UNSUPPORTED, FAIL,
"collective access not permissible");
@@ -1969,7 +1971,7 @@ H5D_write(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *mem_space,
* (the latter in case the arguments to sconv_funcs
* turn out to be inappropriate for MPI-IO). */
if (H5_mpi_opt_types_g &&
- H5FD_MPIO==dataset->ent.file->shared->fapl->driver_id) {
+ H5FD_MPIO==dataset->ent.file->shared->driver_id) {
sconv->write = H5S_mpio_spaces_write;
}
#endif /*HAVE_PARALLEL*/
diff --git a/src/H5Distore.c b/src/H5Distore.c
index eca1cd2..acbc4a2 100644
--- a/src/H5Distore.c
+++ b/src/H5Distore.c
@@ -1675,7 +1675,7 @@ H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
* MPI processes could be writing to other elements in the same chunk.
* Do a direct write-through of only the elements requested.
*/
- if (H5FD_MPIO==f->shared->fapl->driver_id) {
+ if (H5FD_MPIO==f->shared->driver_id) {
H5F_istore_ud1_t udata;
H5O_layout_t l; /* temporary layout */
@@ -1849,7 +1849,7 @@ H5F_istore_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
* MPI processes could be writing to other elements in the same chunk.
* Do a direct write-through of only the elements requested.
*/
- if (H5FD_MPIO==f->shared->fapl->driver_id) {
+ if (H5FD_MPIO==f->shared->driver_id) {
H5F_istore_ud1_t udata;
H5O_layout_t l; /* temporary layout */
if (H5F_istore_get_addr(f, layout, chunk_offset, &udata)<0){
diff --git a/src/H5F.c b/src/H5F.c
index 4a03a63..8003f71 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -719,9 +719,9 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id)
* does not permit caching. (maybe able to relax it for
* read only open.)
*/
- if (H5FD_MPIO==f->shared->fapl->driver_id){
- f->shared->fapl->rdcc_nbytes = 0;
- f->shared->fapl->mdc_nelmts = 0;
+ if (H5FD_MPIO==f->shared->driver_id){
+ f->shared->rdcc_nbytes = 0;
+ f->shared->mdc_nelmts = 0;
}
#endif
diff --git a/src/H5Fistore.c b/src/H5Fistore.c
index eca1cd2..acbc4a2 100644
--- a/src/H5Fistore.c
+++ b/src/H5Fistore.c
@@ -1675,7 +1675,7 @@ H5F_istore_read(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
* MPI processes could be writing to other elements in the same chunk.
* Do a direct write-through of only the elements requested.
*/
- if (H5FD_MPIO==f->shared->fapl->driver_id) {
+ if (H5FD_MPIO==f->shared->driver_id) {
H5F_istore_ud1_t udata;
H5O_layout_t l; /* temporary layout */
@@ -1849,7 +1849,7 @@ H5F_istore_write(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout,
* MPI processes could be writing to other elements in the same chunk.
* Do a direct write-through of only the elements requested.
*/
- if (H5FD_MPIO==f->shared->fapl->driver_id) {
+ if (H5FD_MPIO==f->shared->driver_id) {
H5F_istore_ud1_t udata;
H5O_layout_t l; /* temporary layout */
if (H5F_istore_get_addr(f, layout, chunk_offset, &udata)<0){
diff --git a/src/H5I.c b/src/H5I.c
index dbdfa97..ff3b6c6 100644
--- a/src/H5I.c
+++ b/src/H5I.c
@@ -368,6 +368,13 @@ H5I_nmembers(H5I_type_t grp)
* failed is not removed. This function returns failure if
* items could not be removed.
*
+ * Robb Matzke, 1999-08-17
+ * If the object reference count is larger than one then it must
+ * be because the library is using the object internally. This
+ * happens for instance for file driver ID's which are stored in
+ * things like property lists, files, etc. Objects that have a
+ * reference count larger than one are not affected unless FORCE
+ * is non-zero.
*-------------------------------------------------------------------------
*/
herr_t
@@ -407,6 +414,12 @@ H5I_clear_group(H5I_type_t grp, hbool_t force)
*/
for (i=0; i<grp_ptr->hash_size; i++) {
for (cur=grp_ptr->id_list[i]; cur; cur=next) {
+ /*
+ * Do nothing to the object if the reference count is larger than
+ * one and forcing is off.
+ */
+ if (!force && cur->count>1) continue;
+
/* Free the object regardless of reference count */
if (grp_ptr->free_func && (grp_ptr->free_func)(cur->obj_ptr)<0) {
if (force) {
diff --git a/src/H5Smpio.c b/src/H5Smpio.c
index e2c1375..d75c5cc 100644
--- a/src/H5Smpio.c
+++ b/src/H5Smpio.c
@@ -539,7 +539,7 @@ H5S_mpio_spaces_xfer(H5F_t *f, const struct H5O_layout_t *layout,
assert (file_space);
assert (mem_space);
assert (buf);
- assert (H5FD_MPIO==f->shared->fapl->driver_id);
+ assert (H5FD_MPIO==f->shared->driver_id);
/* INCOMPLETE!!! rky 980816 */
/* Currently can only handle H5D_CONTIGUOUS layout */