mp_file_write_at_all_dv Subroutine

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

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

MPI-I/O mapping mpi_file_write_at_all

STREAM-I/O mapping WRITE

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: fh
integer(kind=file_offset), intent(in) :: offset
real(kind=real_8), intent(in) :: msg(:)
integer, intent(in), optional :: msglen

Contents


Source Code

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

         REAL(kind=real_8), INTENT(IN)                      :: msg(:)
         INTEGER, INTENT(IN)                        :: fh
         INTEGER, INTENT(IN), OPTIONAL              :: msglen
         INTEGER                                    :: msg_len
         INTEGER(kind=file_offset), INTENT(IN)      :: offset

         msg_len = SIZE(msg)
         IF (PRESENT(msglen)) msg_len = msglen
#if defined(__parallel)
         BLOCK
            CHARACTER(LEN=*), PARAMETER :: routineN = 'mp_file_write_at_all_dv'
            INTEGER                                    :: ierr
            ierr = 0

            CALL MPI_FILE_WRITE_AT_ALL(fh, offset, msg, msg_len, MPI_DOUBLE_PRECISION, MPI_STATUS_IGNORE, ierr)
            IF (ierr .NE. 0) &
               DBCSR_ABORT("mpi_file_write_at_all_dv @ "//routineN)
         END BLOCK
#else
         WRITE (UNIT=fh, POS=offset + 1) msg(1:msg_len)
#endif
      END SUBROUTINE mp_file_write_at_all_dv