Skip to content

Commit 98bf024

Browse files
committed
fortran: add Fortran 2008 bindings for attr_fn (MPI_COMM_DUP_FN and friends)
Fixes #460
1 parent e701bf3 commit 98bf024

File tree

2 files changed

+52
-12
lines changed

2 files changed

+52
-12
lines changed

ompi/mpi/fortran/use-mpi-f08/attr-fn-f08-callback-interfaces.h

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
! Copyright (c) 2006-2014 Cisco Systems, Inc. All rights reserved.
55
! Copyright (c) 2013 Los Alamos National Security, LLC. All rights
66
! reserved.
7+
! Copyright (c) 2015 Research Organization for Information Science
8+
! and Technology (RIST). All rights reserved.
79
! $COPYRIGHT$
810
!
911
! Additional copyrights may follow
@@ -43,7 +45,7 @@ interface
4345

4446
subroutine MPI_COMM_NULL_COPY_FN( comm, comm_keyval, extra_state, &
4547
attribute_val_in, attribute_val_out, &
46-
flag, ierr )
48+
flag, ierr ) BIND(C,name="ompi_comm_null_copy_fn_f")
4749
use mpi_f08_types
4850
implicit none
4951
type(MPI_Comm) :: comm
@@ -53,8 +55,20 @@ interface
5355
logical :: flag
5456
end subroutine MPI_COMM_NULL_COPY_FN
5557

58+
subroutine MPI_COMM_DUP_FN( comm, comm_keyval, extra_state, &
59+
attribute_val_in, attribute_val_out, &
60+
flag, ierr ) BIND(C,name="ompi_comm_dup_fn_f")
61+
use mpi_f08_types
62+
implicit none
63+
type(MPI_Comm) :: comm
64+
integer :: comm_keyval
65+
integer(kind=MPI_ADDRESS_KIND) :: extra_state, attribute_val_in, attribute_val_out
66+
integer :: ierr
67+
logical :: flag
68+
end subroutine MPI_COMM_DUP_FN
69+
5670
subroutine MPI_COMM_NULL_DELETE_FN(comm, comm_keyval, attribute_val_out, &
57-
extra_state, ierr )
71+
extra_state, ierr ) BIND(C,name="ompi_comm_null_delete_fn_f")
5872
use mpi_f08_types
5973
implicit none
6074
type(MPI_Comm) :: comm
@@ -67,7 +81,7 @@ interface
6781

6882
subroutine MPI_TYPE_NULL_COPY_FN( type, type_keyval, extra_state, &
6983
attribute_val_in, attribute_val_out, &
70-
flag, ierr )
84+
flag, ierr ) BIND(C,name="ompi_type_null_copy_fn_f")
7185
use mpi_f08_types
7286
implicit none
7387
type(MPI_Datatype) :: type
@@ -77,8 +91,20 @@ interface
7791
logical :: flag
7892
end subroutine MPI_TYPE_NULL_COPY_FN
7993

94+
subroutine MPI_TYPE_DUP_FN( type, type_keyval, extra_state, &
95+
attribute_val_in, attribute_val_out, &
96+
flag, ierr ) BIND(C,name="ompi_type_dup_fn_f")
97+
use mpi_f08_types
98+
implicit none
99+
type(MPI_Datatype) :: type
100+
integer :: type_keyval
101+
integer(kind=MPI_ADDRESS_KIND) :: extra_state, attribute_val_in, attribute_val_out
102+
integer :: ierr
103+
logical :: flag
104+
end subroutine MPI_TYPE_DUP_FN
105+
80106
subroutine MPI_TYPE_NULL_DELETE_FN( type, type_keyval, attribute_val_out, &
81-
extra_state, ierr )
107+
extra_state, ierr ) BIND(C,name="ompi_type_null_delete_fn_f")
82108
use mpi_f08_types
83109
implicit none
84110
type(MPI_Datatype) :: type
@@ -91,7 +117,7 @@ interface
91117

92118
subroutine MPI_WIN_NULL_COPY_FN( window, win_keyval, extra_state, &
93119
attribute_val_in, attribute_val_out, &
94-
flag, ierr )
120+
flag, ierr ) BIND(C,name="ompi_win_null_copy_fn_f")
95121
use mpi_f08_types
96122
implicit none
97123
type(MPI_Win) :: window
@@ -101,8 +127,20 @@ interface
101127
logical :: flag
102128
end subroutine MPI_WIN_NULL_COPY_FN
103129

130+
subroutine MPI_WIN_DUP_FN( window, win_keyval, extra_state, &
131+
attribute_val_in, attribute_val_out, &
132+
flag, ierr ) BIND(C,name="ompi_win_dup_fn_f")
133+
use mpi_f08_types
134+
implicit none
135+
type(MPI_Win) :: window
136+
integer :: win_keyval
137+
integer(kind=MPI_ADDRESS_KIND) :: extra_state, attribute_val_in, attribute_val_out
138+
integer :: ierr
139+
logical :: flag
140+
end subroutine MPI_WIN_DUP_FN
141+
104142
subroutine MPI_WIN_NULL_DELETE_FN( window, win_keyval, attribute_val_out, &
105-
extra_state, ierr )
143+
extra_state, ierr ) BIND(C,name="ompi_win_null_delete_fn_f")
106144
use mpi_f08_types
107145
implicit none
108146
type(MPI_Win) :: window

ompi/mpi/fortran/use-mpi-f08/mpi-f08-interfaces-callbacks.F90

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
! Copyright (c) 2009-2013 Cisco Systems, Inc. All rights reserved.
33
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
44
! All rights reserved.
5+
! Copyright (c) 2015 Research Organization for Information Science
6+
! and Technology (RIST). All rights reserved.
57
! $COPYRIGHT$
68

79
#include "ompi/mpi/fortran/configure-fortran-output.h"
@@ -64,7 +66,7 @@ SUBROUTINE MPI_User_function(invec, inoutvec, len, datatype)
6466

6567
OMPI_ABSTRACT INTERFACE
6668
SUBROUTINE MPI_Comm_copy_attr_function(oldcomm,comm_keyval,extra_state, &
67-
attribute_val_in,attribute_val_out,flag,ierror)
69+
attribute_val_in,attribute_val_out,flag,ierror) BIND(C)
6870
USE mpi_f08_types
6971
IMPLICIT NONE
7072
TYPE(MPI_Comm) :: oldcomm
@@ -76,7 +78,7 @@ SUBROUTINE MPI_Comm_copy_attr_function(oldcomm,comm_keyval,extra_state, &
7678

7779
OMPI_ABSTRACT INTERFACE
7880
SUBROUTINE MPI_Comm_delete_attr_function(comm,comm_keyval, &
79-
attribute_val, extra_state, ierror)
81+
attribute_val, extra_state, ierror) BIND(C)
8082
USE mpi_f08_types
8183
IMPLICIT NONE
8284
TYPE(MPI_Comm) :: comm
@@ -87,7 +89,7 @@ SUBROUTINE MPI_Comm_delete_attr_function(comm,comm_keyval, &
8789

8890
OMPI_ABSTRACT INTERFACE
8991
SUBROUTINE MPI_Win_copy_attr_function(oldwin,win_keyval,extra_state, &
90-
attribute_val_in,attribute_val_out,flag,ierror)
92+
attribute_val_in,attribute_val_out,flag,ierror) BIND(C)
9193
USE mpi_f08_types
9294
IMPLICIT NONE
9395
TYPE(MPI_Win) :: oldwin
@@ -99,7 +101,7 @@ SUBROUTINE MPI_Win_copy_attr_function(oldwin,win_keyval,extra_state, &
99101

100102
OMPI_ABSTRACT INTERFACE
101103
SUBROUTINE MPI_Win_delete_attr_function(win,win_keyval,attribute_val, &
102-
extra_state,ierror)
104+
extra_state,ierror) BIND(C)
103105
USE mpi_f08_types
104106
IMPLICIT NONE
105107
TYPE(MPI_Win) :: win
@@ -110,7 +112,7 @@ SUBROUTINE MPI_Win_delete_attr_function(win,win_keyval,attribute_val, &
110112

111113
OMPI_ABSTRACT INTERFACE
112114
SUBROUTINE MPI_Type_copy_attr_function(oldtype,type_keyval,extra_state, &
113-
attribute_val_in,attribute_val_out,flag,ierror)
115+
attribute_val_in,attribute_val_out,flag,ierror) BIND(C)
114116
USE mpi_f08_types
115117
IMPLICIT NONE
116118
TYPE(MPI_Datatype) :: oldtype
@@ -122,7 +124,7 @@ SUBROUTINE MPI_Type_copy_attr_function(oldtype,type_keyval,extra_state, &
122124

123125
OMPI_ABSTRACT INTERFACE
124126
SUBROUTINE MPI_Type_delete_attr_function(datatype,type_keyval, &
125-
attribute_val,extra_state,ierror)
127+
attribute_val,extra_state,ierror) BIND(C)
126128
USE mpi_f08_types
127129
IMPLICIT NONE
128130
TYPE(MPI_Datatype) :: datatype

0 commit comments

Comments
 (0)