From afd08f752393a264a4647829cefcb666d1797a3c Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 9 Sep 2013 15:03:36 -0500 Subject: [svn-r24117] Description: Revert accidental checkin of a patch that disables file truncation for parallel I/O. Tested on: MacOSX/64 10.8.4 (amazon) --- src/H5FDmpio.c | 14 ++------------ src/H5FDmpiposix.c | 13 ++----------- src/H5Fsuper_cache.c | 4 +--- 3 files changed, 5 insertions(+), 26 deletions(-) diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 067d4f4..2d73ec0 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -1985,18 +1985,8 @@ H5FD_mpio_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing) HGOTO_ERROR(H5E_INTERNAL, H5E_BADRANGE, FAIL, "cannot convert from haddr_t to MPI_Offset") /* Extend the file's size */ - // Suren's modifications to disable truncate - // Original code: commented out the following 2 lines - // if(MPI_SUCCESS != (mpi_code = MPI_File_set_size(file->f, mpi_off))) - // HMPI_GOTO_ERROR(FAIL, "MPI_File_set_size failed", mpi_code) - // Modified code: The following 6 lines - if (getenv("HDF5_TRUNCATE")) { - if(0 == file->mpi_rank) - printf("I: HDF5: MPI-IO VFD: MPI_File_set_size()"); - if(MPI_SUCCESS != (mpi_code = MPI_File_set_size(file->f, mpi_off))) - HMPI_GOTO_ERROR(FAIL, "MPI_File_set_size failed", mpi_code) - } - // End of modified code + if(MPI_SUCCESS != (mpi_code = MPI_File_set_size(file->f, mpi_off))) + HMPI_GOTO_ERROR(FAIL, "MPI_File_set_size failed", mpi_code) #else /* H5_MPI_FILE_SET_SIZE_BIG */ /* Wait until all processes are here before reading/writing the byte at * process 0's end of address space. The window for corruption is diff --git a/src/H5FDmpiposix.c b/src/H5FDmpiposix.c index 4d2a6cf..f66b244 100644 --- a/src/H5FDmpiposix.c +++ b/src/H5FDmpiposix.c @@ -1378,17 +1378,8 @@ 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 */ - // 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 + if(-1 == HDftruncate(file->fd, (HDoff_t)file->eoa)) + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") #endif /* H5_HAVE_WIN32_API */ } /* end if */ diff --git a/src/H5Fsuper_cache.c b/src/H5Fsuper_cache.c index 9839d0f..a437451 100644 --- a/src/H5Fsuper_cache.c +++ b/src/H5Fsuper_cache.c @@ -468,9 +468,7 @@ H5F_sblock_load(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, void *_udata) /* (Account for the stored EOA being absolute offset -QAK) */ if((eof + sblock->base_addr) < stored_eoa) - if((shared->flags & H5F_ACC_RDWR) || getenv("HDF5_TRUNCATE")) { - HGOTO_ERROR(H5E_FILE, H5E_TRUNCATED, NULL, "truncated file: eof = %llu, sblock->base_addr = %llu, stored_eoa = %llu", (unsigned long long)eof, (unsigned long long)sblock->base_addr, (unsigned long long)stored_eoa) - } + HGOTO_ERROR(H5E_FILE, H5E_TRUNCATED, NULL, "truncated file: eof = %llu, sblock->base_addr = %llu, stored_eoa = %llu", (unsigned long long)eof, (unsigned long long)sblock->base_addr, (unsigned long long)stored_eoa) /* * Tell the file driver how much address space has already been -- cgit v0.12