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