mp_file_get_size Subroutine

public subroutine mp_file_get_size(fh, file_size)

Returns the file size

MPI-I/O mapping mpi_file_get_size

STREAM-I/O mapping INQUIRE

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: fh

file handle (file storage unit)

integer(kind=file_offset), intent(out) :: file_size

the file size


Contents

Source Code


Source Code

   SUBROUTINE mp_file_get_size(fh, file_size)
      !! Returns the file size
      !!
      !! MPI-I/O mapping   mpi_file_get_size
      !!
      !! STREAM-I/O mapping   INQUIRE

      INTEGER, INTENT(IN)                                :: fh
         !! file handle (file storage unit)
      INTEGER(kind=file_offset), INTENT(OUT)             :: file_size
         !! the file size

      INTEGER                                            :: ierr

      ierr = 0
#if defined(__parallel)
      CALL mpi_file_set_errhandler(fh, MPI_ERRORS_RETURN, ierr)
      CALL mpi_file_get_size(fh, file_size, ierr)
      IF (ierr .NE. 0) CALL mp_stop(ierr, "mpi_file_set_errhandler @ mp_file_get_size")
#else
      INQUIRE (UNIT=fh, SIZE=file_size)
#endif
   END SUBROUTINE mp_file_get_size