mp_file_write_at_zv Subroutine

private subroutine mp_file_write_at_zv(fh, offset, msg, msglen)

(parallel) Blocking individual file write using explicit offsets (serial) Unformatted stream write

MPI-I/O mapping mpi_file_write_at

STREAM-I/O mapping WRITE

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: fh

file handle (file storage unit)

integer(kind=file_offset), intent(in) :: offset

file offset (position)

complex(kind=real_8), intent(in) :: msg(:)

data to be written to the file

integer, intent(in), optional :: msglen

number of the elements of data


Contents

Source Code


Source Code

      SUBROUTINE mp_file_write_at_zv(fh, offset, msg, msglen)
      !! (parallel) Blocking individual file write using explicit offsets
      !! (serial) Unformatted stream write
      !!
      !! MPI-I/O mapping   mpi_file_write_at
      !!
      !! STREAM-I/O mapping   WRITE

         COMPLEX(kind=real_8), INTENT(IN)                      :: msg(:)
         !! data to be written to the file
         INTEGER, INTENT(IN)                        :: fh
         !! file handle (file storage unit)
         INTEGER, INTENT(IN), OPTIONAL              :: msglen
         !! number of the elements of data
         INTEGER(kind=file_offset), INTENT(IN)      :: offset
         !! file offset (position)

         INTEGER                                    :: msg_len

         msg_len = SIZE(msg)
         IF (PRESENT(msglen)) msg_len = msglen

#if defined(__parallel)
         BLOCK
            CHARACTER(LEN=*), PARAMETER :: routineN = 'mp_file_write_at_zv'
            INTEGER :: ierr
            ierr = 0
            CALL MPI_FILE_WRITE_AT(fh, offset, msg, msg_len, MPI_DOUBLE_COMPLEX, MPI_STATUS_IGNORE, ierr)
            IF (ierr .NE. 0) &
               DBCSR_ABORT("mpi_file_write_at_zv @ "//routineN)
         END BLOCK
#else
         WRITE (UNIT=fh, POS=offset + 1) msg(1:msg_len)
#endif
      END SUBROUTINE mp_file_write_at_zv