diff options
Diffstat (limited to 'src/H5Faccum.c')
-rw-r--r-- | src/H5Faccum.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/H5Faccum.c b/src/H5Faccum.c index 0e549fa..529384b 100644 --- a/src/H5Faccum.c +++ b/src/H5Faccum.c @@ -413,6 +413,11 @@ done: * koziol@hdfgroup.org * Jan 10 2008 * + * Modifications: + * Vailin Choi; June 2013 + * This is a fix for SWMR: + * For a large write that is >= than H5F_ACCUM_MAX_SIZE, + * flush the metadata in the accumulator first before the write. *------------------------------------------------------------------------- */ herr_t @@ -726,6 +731,12 @@ HDmemset(f->shared->accum.buf + size, 0, (f->shared->accum.alloc_size - size)); } /* end else */ } /* end if */ else { + if((f->intent & H5F_ACC_SWMR_WRITE) > 0) { + /* Flush if dirty and reset accumulator */ + if(H5F_accum_reset(f, dxpl_id, TRUE) < 0) + HGOTO_ERROR(H5E_IO, H5E_CANTRESET, FAIL, "can't reset accumulator") + } + /* Write the data */ if(H5FD_write(f->shared->lf, dxpl_id, map_type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") |