root/ompi/mpi/fortran/use-mpi-tkr/mpi-f90-cptr-interfaces.h

/* [<][>][^][v][top][bottom][index][help] */
   1 ! -*- fortran -*-
   2 !
   3 ! Copyright (c) 2014 Cisco Systems, Inc.  All rights reserved.
   4 ! $COPYRIGHT$
   5 !
   6 ! Additional copyrights may follow
   7 !
   8 ! $HEADER$
   9 !
  10 ! This file contains interfaces that use the ISO_C_BINDING module and
  11 ! the TYPE(C_PTR) type, which not all Fortran compilers support (e.g.,
  12 ! gfortran on RHEL 5 does not support this module/type).  So we use a
  13 ! preprocessor macro to protect the problematic declarations.
  14 !
  15 ! This file is included via a preprocessor include directorive in
  16 ! mpi.F90, which allows us to use the preprocessor "if" directive,
  17 ! below.
  18 !
  19 
  20 interface MPI_Win_allocate
  21 
  22 subroutine MPI_Win_allocate(size, disp_unit, info, comm, &
  23       baseptr, win, ierror)
  24   include 'mpif-config.h'
  25   integer(KIND=MPI_ADDRESS_KIND), intent(in) :: size
  26   integer, intent(in) :: disp_unit
  27   integer, intent(in) :: info
  28   integer, intent(in) :: comm
  29   integer(KIND=MPI_ADDRESS_KIND), intent(out) :: baseptr
  30   integer, intent(out) :: win
  31   integer, intent(out) :: ierror
  32 end subroutine MPI_Win_allocate
  33 
  34 ! Only include the 2nd interface if we have ISO_C_BINDING / TYPE(C_PTR)
  35 #if OMPI_FORTRAN_HAVE_ISO_C_BINDING
  36 subroutine MPI_Win_allocate_cptr(size, disp_unit, info, comm, &
  37      baseptr, win, ierror)
  38   use, intrinsic :: iso_c_binding, only : c_ptr
  39   include 'mpif-config.h'
  40   integer :: disp_unit, info, comm, win, ierror
  41   integer(KIND=MPI_ADDRESS_KIND) :: size
  42   type(C_PTR) :: baseptr
  43 end subroutine MPI_Win_allocate_cptr
  44 #endif
  45 
  46 end interface
  47 
  48 
  49 interface MPI_Win_allocate_shared
  50 
  51 subroutine MPI_Win_allocate_shared(size, disp_unit, info, comm, &
  52       baseptr, win, ierror)
  53   include 'mpif-config.h'
  54   integer(KIND=MPI_ADDRESS_KIND), intent(in) :: size
  55   integer, intent(in) :: disp_unit
  56   integer, intent(in) :: info
  57   integer, intent(in) :: comm
  58   integer(KIND=MPI_ADDRESS_KIND), intent(out) :: baseptr
  59   integer, intent(out) :: win
  60   integer, intent(out) :: ierror
  61 end subroutine MPI_Win_allocate_shared
  62 
  63 ! Only include the 2nd interface if we have ISO_C_BINDING / TYPE(C_PTR)
  64 #if OMPI_FORTRAN_HAVE_ISO_C_BINDING
  65 subroutine MPI_Win_allocate_shared_cptr(size, disp_unit, info, comm, &
  66      baseptr, win, ierror)
  67   use, intrinsic :: iso_c_binding, only : c_ptr
  68   include 'mpif-config.h'
  69   integer :: disp_unit, info, comm, win, ierror
  70   integer(KIND=MPI_ADDRESS_KIND) :: size
  71   type(C_PTR) :: baseptr
  72 end subroutine MPI_Win_allocate_shared_cptr
  73 #endif
  74 
  75 end interface
  76 
  77 
  78 interface MPI_Win_shared_query
  79 
  80 subroutine MPI_Win_shared_query(win, rank, size, disp_unit, baseptr,&
  81       ierror)
  82   include 'mpif-config.h'
  83   integer, intent(in) :: win
  84   integer, intent(in) :: rank
  85   integer(KIND=MPI_ADDRESS_KIND), intent(out) :: size
  86   integer, intent(out) :: disp_unit
  87   integer(KIND=MPI_ADDRESS_KIND), intent(out) :: baseptr
  88   integer, intent(out) :: ierror
  89 end subroutine MPI_Win_shared_query
  90 
  91 ! Only include the 2nd interface if we have ISO_C_BINDING / TYPE(C_PTR)
  92 #if OMPI_FORTRAN_HAVE_ISO_C_BINDING
  93 subroutine MPI_Win_shared_query_cptr(win, rank, size, disp_unit, baseptr,&
  94       ierror)
  95   use, intrinsic :: iso_c_binding, only : c_ptr
  96   include 'mpif-config.h'
  97   integer, intent(in) :: win
  98   integer, intent(in) :: rank
  99   integer(KIND=MPI_ADDRESS_KIND), intent(out) :: size
 100   integer, intent(out) :: disp_unit
 101   type(C_PTR), intent(out) :: baseptr
 102   integer, intent(out) :: ierror
 103 end subroutine MPI_Win_shared_query_cptr
 104 #endif
 105 
 106 end interface

/* [<][>][^][v][top][bottom][index][help] */