File: mpi-f90-cptr-interfaces.h

package info (click to toggle)
openmpi 4.1.4-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 127,592 kB
  • sloc: ansic: 690,998; makefile: 43,047; f90: 19,220; sh: 7,182; java: 6,360; perl: 3,590; cpp: 2,227; python: 1,350; lex: 989; fortran: 61; tcl: 12
file content (106 lines) | stat: -rw-r--r-- 3,356 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
! -*- fortran -*-
!
! Copyright (c) 2014 Cisco Systems, Inc.  All rights reserved.
! $COPYRIGHT$
!
! Additional copyrights may follow
!
! $HEADER$
!
! This file contains interfaces that use the ISO_C_BINDING module and
! the TYPE(C_PTR) type, which not all Fortran compilers support (e.g.,
! gfortran on RHEL 5 does not support this module/type).  So we use a
! preprocessor macro to protect the problematic declarations.
!
! This file is included via a preprocessor include directorive in
! mpi.F90, which allows us to use the preprocessor "if" directive,
! below.
!

interface MPI_Win_allocate

subroutine MPI_Win_allocate(size, disp_unit, info, comm, &
      baseptr, win, ierror)
  include 'mpif-config.h'
  integer(KIND=MPI_ADDRESS_KIND), intent(in) :: size
  integer, intent(in) :: disp_unit
  integer, intent(in) :: info
  integer, intent(in) :: comm
  integer(KIND=MPI_ADDRESS_KIND), intent(out) :: baseptr
  integer, intent(out) :: win
  integer, intent(out) :: ierror
end subroutine MPI_Win_allocate

! Only include the 2nd interface if we have ISO_C_BINDING / TYPE(C_PTR)
#if OMPI_FORTRAN_HAVE_ISO_C_BINDING
subroutine MPI_Win_allocate_cptr(size, disp_unit, info, comm, &
     baseptr, win, ierror)
  use, intrinsic :: iso_c_binding, only : c_ptr
  include 'mpif-config.h'
  integer :: disp_unit, info, comm, win, ierror
  integer(KIND=MPI_ADDRESS_KIND) :: size
  type(C_PTR) :: baseptr
end subroutine MPI_Win_allocate_cptr
#endif

end interface


interface MPI_Win_allocate_shared

subroutine MPI_Win_allocate_shared(size, disp_unit, info, comm, &
      baseptr, win, ierror)
  include 'mpif-config.h'
  integer(KIND=MPI_ADDRESS_KIND), intent(in) :: size
  integer, intent(in) :: disp_unit
  integer, intent(in) :: info
  integer, intent(in) :: comm
  integer(KIND=MPI_ADDRESS_KIND), intent(out) :: baseptr
  integer, intent(out) :: win
  integer, intent(out) :: ierror
end subroutine MPI_Win_allocate_shared

! Only include the 2nd interface if we have ISO_C_BINDING / TYPE(C_PTR)
#if OMPI_FORTRAN_HAVE_ISO_C_BINDING
subroutine MPI_Win_allocate_shared_cptr(size, disp_unit, info, comm, &
     baseptr, win, ierror)
  use, intrinsic :: iso_c_binding, only : c_ptr
  include 'mpif-config.h'
  integer :: disp_unit, info, comm, win, ierror
  integer(KIND=MPI_ADDRESS_KIND) :: size
  type(C_PTR) :: baseptr
end subroutine MPI_Win_allocate_shared_cptr
#endif

end interface


interface MPI_Win_shared_query

subroutine MPI_Win_shared_query(win, rank, size, disp_unit, baseptr,&
      ierror)
  include 'mpif-config.h'
  integer, intent(in) :: win
  integer, intent(in) :: rank
  integer(KIND=MPI_ADDRESS_KIND), intent(out) :: size
  integer, intent(out) :: disp_unit
  integer(KIND=MPI_ADDRESS_KIND), intent(out) :: baseptr
  integer, intent(out) :: ierror
end subroutine MPI_Win_shared_query

! Only include the 2nd interface if we have ISO_C_BINDING / TYPE(C_PTR)
#if OMPI_FORTRAN_HAVE_ISO_C_BINDING
subroutine MPI_Win_shared_query_cptr(win, rank, size, disp_unit, baseptr,&
      ierror)
  use, intrinsic :: iso_c_binding, only : c_ptr
  include 'mpif-config.h'
  integer, intent(in) :: win
  integer, intent(in) :: rank
  integer(KIND=MPI_ADDRESS_KIND), intent(out) :: size
  integer, intent(out) :: disp_unit
  type(C_PTR), intent(out) :: baseptr
  integer, intent(out) :: ierror
end subroutine MPI_Win_shared_query_cptr
#endif

end interface