diff options
author | Robb Matzke <matzke@llnl.gov> | 1998-09-28 14:20:21 (GMT) |
---|---|---|
committer | Robb Matzke <matzke@llnl.gov> | 1998-09-28 14:20:21 (GMT) |
commit | c0941f01e38812435e8dd2052d3d7b5deab045dc (patch) | |
tree | 0d8a314e12f0f26ebb1cb1326ed5169fa09fab53 /src/H5F.c | |
parent | b1df4a74cd6a4e620a7f73cedce611988ca151d8 (diff) | |
download | hdf5-c0941f01e38812435e8dd2052d3d7b5deab045dc.zip hdf5-c0941f01e38812435e8dd2052d3d7b5deab045dc.tar.gz hdf5-c0941f01e38812435e8dd2052d3d7b5deab045dc.tar.bz2 |
[svn-r726] Changes since 19980924
----------------------
./MANIFEST
./src/H5B.c
./src/H5Bprivate.h
./src/H5G.c
./src/H5Gnode.c
./src/H5Gprivate.h
./test/Makefile.in
./test/unlink.c [NEW]
Finished H5Gunlink() and H5Grename().
./src/H5F.c
./src/H5Fistore.c
./src/H5Fprivate.h
Removed the last memcpy() from the chunk cache.
./src/H5Fistore.c
The offset of a chunk within a dataset is an 8-byte quantity
per dimension instead of 4 bytes.
./src/H5HL.c
Fixed infinite loops in H5HL_remove().
Diffstat (limited to 'src/H5F.c')
-rw-r--r-- | src/H5F.c | 35 |
1 files changed, 23 insertions, 12 deletions
@@ -1449,7 +1449,7 @@ H5F_flush(H5F_t *f, hbool_t invalidate) } /* flush the entire raw data cache */ - if (H5F_istore_flush (f)<0) { + if (H5F_istore_flush (f, invalidate)<0) { HRETURN_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush raw data cache"); } @@ -1493,7 +1493,7 @@ H5F_flush(H5F_t *f, hbool_t invalidate) /* write the boot block to disk */ #ifdef HAVE_PARALLEL - H5F_mpio_tas_allsame( f->shared->lf, TRUE ); /* only p0 will write */ + H5F_mpio_tas_allsame(f->shared->lf, TRUE); /* only p0 will write */ #endif if (H5F_low_write(f->shared->lf, f->shared->access_parms, H5D_XFER_DFLT, @@ -1507,6 +1507,7 @@ H5F_flush(H5F_t *f, hbool_t invalidate) } FUNC_LEAVE(SUCCEED); } + /*------------------------------------------------------------------------- * Function: H5F_close @@ -1532,18 +1533,17 @@ H5F_close(H5F_t *f) /* Close all current working groups */ while (H5G_pop(f)>=0) /*void*/; - /* Flush the boot block and caches */ - if (H5F_flush(f, FALSE) < 0) { - HRETURN_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, - "unable to flush cache"); - } - /* * If object headers are still open then delay deletion of resources until - * they have all been closed. The file is in a consistent state now, so - * forgetting to close everything is not a major problem. + * they have all been closed. Flush all caches and update the object + * header anyway so that failing to close all objects isn't a major + * problem. */ if (f->nopen>0) { + if (H5F_flush(f, FALSE)<0) { + HRETURN_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, + "unable to flush cache"); + } #ifdef H5F_DEBUG if (H5DEBUG(F)) { fprintf(H5DEBUG(F), "H5F: H5F_close(%s): %u object header%s still " @@ -1559,7 +1559,7 @@ H5F_close(H5F_t *f) } else if (f->close_pending) { #ifdef H5F_DEBUG if (H5DEBUG(F)) { - fprintf(H5DEBUG(F), "H5F: H5F_close: operation completed\n"); + fprintf(H5DEBUG(F), "H5F: H5F_close: operation completing\n"); } #endif } @@ -1569,7 +1569,7 @@ H5F_close(H5F_t *f) * close it also. */ if (1==f->shared->nrefs) { - /* Flush again just to be safe, but this time clean up the cache */ + /* Flush and destroy all caches */ if (H5F_flush (f, TRUE)<0) { HRETURN_ERROR (H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache"); @@ -1581,7 +1581,18 @@ H5F_close(H5F_t *f) /* Close files and release resources */ H5F_low_close(f->shared->lf, f->shared->access_parms); + } else { + /* + * Flush all caches but do not destroy. As long as all handles for + * this file are closed the flush isn't really necessary, but lets + * just be safe. + */ + if (H5F_flush(f, TRUE)<0) { + HRETURN_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, + "unable to flush cache"); + } } + if (H5F_dest(f)<0) { HRETURN_ERROR (H5E_FILE, H5E_CANTINIT, FAIL, "problems closing file"); |