mp_file_get_position Subroutine

public subroutine mp_file_get_position(fh, pos)

Returns the file position

MPI-I/O mapping mpi_file_get_position

STREAM-I/O mapping INQUIRE

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: fh

file handle (file storage unit)

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

the file position


Contents

Source Code


Source Code

   SUBROUTINE mp_file_get_position(fh, pos)
      !! Returns the file position
      !!
      !! MPI-I/O mapping   mpi_file_get_position
      !!
      !! STREAM-I/O mapping   INQUIRE

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

      INTEGER                                            :: ierr

      ierr = 0
#if defined(__parallel)
      CALL mpi_file_set_errhandler(fh, MPI_ERRORS_RETURN, ierr)
      CALL mpi_file_get_position(fh, pos, ierr)
      IF (ierr .NE. 0) CALL mp_stop(ierr, "mpi_file_set_errhandler @ mp_file_get_position")
#else
      INQUIRE (UNIT=fh, POS=pos)
#endif
   END SUBROUTINE mp_file_get_position