mp_win_create_lv Subroutine

private subroutine mp_win_create_lv(base, comm, win)

Window initialization function for vector data

Note

arrays can be pointers or assumed shape, but they must be contiguous!

Arguments

Type IntentOptional Attributes Name
integer(kind=int_8), CONTIGUOUS, DIMENSION(:) :: base
type(mp_comm_type), intent(in) :: comm
type(mp_win_type), intent(out) :: win

Source Code

      SUBROUTINE mp_win_create_lv(base, comm, win)
      !! Window initialization function for vector data
      !! @note
      !! arrays can be pointers or assumed shape, but they must be contiguous!

         INTEGER(KIND=int_8), CONTIGUOUS, DIMENSION(:) :: base
         TYPE(mp_comm_type), INTENT(IN)      :: comm
         TYPE(mp_win_type), INTENT(OUT)      :: win

         CHARACTER(LEN=*), PARAMETER :: routineN = 'mp_win_create_lv'

         INTEGER                        :: ierr, handle
#if defined(__parallel)
         INTEGER(kind=mpi_address_kind) :: len
         INTEGER(KIND=int_8)                      :: foo(1)
#endif

         ierr = 0
         CALL timeset(routineN, handle)

#if defined(__parallel)

         len = SIZE(base)*int_8_size
         IF (len > 0) THEN
            CALL mpi_win_create(base, len, int_8_size, MPI_INFO_NULL, comm%handle, win%handle, ierr)
         ELSE
            CALL mpi_win_create(foo, len, int_8_size, MPI_INFO_NULL, comm%handle, win%handle, ierr)
         END IF
         IF (ierr /= 0) CALL mp_stop(ierr, "mpi_win_create @ "//routineN)
#else
         MARK_USED(base)
         MARK_USED(comm)
         win = mp_win_null
#endif
         CALL timestop(handle)
      END SUBROUTINE mp_win_create_lv