diff options
Diffstat (limited to 'src/H5FDmpiposix.c')
-rw-r--r-- | src/H5FDmpiposix.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/H5FDmpiposix.c b/src/H5FDmpiposix.c index f66b244..4d2a6cf 100644 --- a/src/H5FDmpiposix.c +++ b/src/H5FDmpiposix.c @@ -1378,8 +1378,17 @@ H5FD_mpiposix_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closi if(-1 == HDlseek(file->fd, (HDoff_t)0, SEEK_SET)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") #endif /* H5_VMS */ - if(-1 == HDftruncate(file->fd, (HDoff_t)file->eoa)) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") + // Suren modification to disable file_truncate + // Original code: two lines commented out + // if(-1 == HDftruncate(file->fd, (HDoff_t)file->eoa)) + // HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") + // Modified code: The following 5 lines + if (getenv("HDF5_TRUNCATE")) { + printf("I: HDF5: MPI-POSIX VFD: ftruncate()\n"); + if(-1 == HDftruncate(file->fd, (HDoff_t)file->eoa)) + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") + } + // End modified code #endif /* H5_HAVE_WIN32_API */ } /* end if */ |