Skip to content

Commit 1a16e68

Browse files
committed
fortran/use-mpi-trk: add PMPI_* interfaces in mpi module
Signed-off-by: Gilles Gouaillardet <[email protected]>
1 parent 8e26e78 commit 1a16e68

File tree

5 files changed

+3623
-1
lines changed

5 files changed

+3623
-1
lines changed

ompi/mpi/fortran/use-mpi-tkr/Makefile.am

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ mpi.lo: mpi-f90-interfaces.h
6161
mpi.lo: mpi-f90-file-interfaces.h
6262
mpi.lo: $(top_builddir)/ompi/mpi/fortran/configure-fortran-output.h
6363
mpi.lo: mpi-f90-cptr-interfaces.h
64+
mpi.lo: pmpi-f90-interfaces.h
65+
mpi.lo: pmpi-f90-file-interfaces.h
66+
mpi.lo: pmpi-f90-cptr-interfaces.h
6467

6568
# Per MPI-3 p610:34-41, if we're building a TKR mpi module, we should
6669
# not build any interfaces for MPI subroutines that take a choice
@@ -164,5 +167,8 @@ endif
164167
EXTRA_DIST = \
165168
mpi-f90-interfaces.h \
166169
mpi-f90-file-interfaces.h \
167-
mpi-f90-cptr-interfaces.h
170+
mpi-f90-cptr-interfaces.h \
171+
pmpi-f90-interfaces.h \
172+
pmpi-f90-file-interfaces.h \
173+
pmpi-f90-cptr-interfaces.h
168174

ompi/mpi/fortran/use-mpi-tkr/mpi.F90

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
! Copyright (c) 2004-2005 The Regents of the University of California.
1212
! All rights reserved.
1313
! Copyright (c) 2006-2014 Cisco Systems, Inc. All rights reserved.
14+
! Copyright (c) 2016 Research Organization for Information Science
15+
! and Technology (RIST). All rights reserved.
1416
! $COPYRIGHT$
1517
!
1618
! Additional copyrights may follow
@@ -44,13 +46,16 @@ module mpi
4446
! macro in this file, so we need to use the preprocessor include
4547
! directive, not the Fortran include.
4648
#include "mpi-f90-cptr-interfaces.h"
49+
#include "pmpi-f90-cptr-interfaces.h"
4750

4851
! This file is generated, and is *huge*. Its size is directly related
4952
! to the --with-f90-max-array-dim configure parameter.
5053

5154
include "mpi-f90-interfaces.h"
55+
include "pmpi-f90-interfaces.h"
5256
#if OMPI_PROVIDE_MPI_FILE_INTEFACE
5357
include "mpi-f90-file-interfaces.h"
58+
include "pmpi-f90-file-interfaces.h"
5459
#endif
5560

5661
end module mpi
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
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

0 commit comments

Comments
 (0)