Skip to content

Commit 4cd917a

Browse files
authored
Merge pull request #4659 from yanagibashi/pr/fortran2008
Add missing Fortran 2008 binding subroutines
2 parents a600525 + 3f4b373 commit 4cd917a

File tree

6 files changed

+221
-0
lines changed

6 files changed

+221
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# Copyright (c) 2015-2017 Research Organization for Information Science
1111
# and Technology (RIST). All rights reserved.
1212
# Copyright (c) 2016 IBM Corporation. All rights reserved.
13+
# Copyright (c) 2017 FUJITSU LIMITED. All rights reserved.
1314
#
1415
# $COPYRIGHT$
1516
#
@@ -533,9 +534,13 @@ pmpi_api_files = \
533534
profile/pfile_get_view_f08.F90 \
534535
profile/pfile_iread_at_f08.F90 \
535536
profile/pfile_iread_f08.F90 \
537+
profile/pfile_iread_at_all_f08.F90 \
538+
profile/pfile_iread_all_f08.F90 \
536539
profile/pfile_iread_shared_f08.F90 \
537540
profile/pfile_iwrite_at_f08.F90 \
538541
profile/pfile_iwrite_f08.F90 \
542+
profile/pfile_iwrite_at_all_f08.F90 \
543+
profile/pfile_iwrite_all_f08.F90 \
539544
profile/pfile_iwrite_shared_f08.F90 \
540545
profile/pfile_open_f08.F90 \
541546
profile/pfile_preallocate_f08.F90 \

ompi/mpi/fortran/use-mpi-f08/mod/pmpi-f08-interfaces.F90

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
! Copyright (c) 2012 Inria. All rights reserved.
1010
! Copyright (c) 2015-2017 Research Organization for Information Science
1111
! and Technology (RIST). All rights reserved.
12+
! Copyright (c) 2017 FUJITSU LIMITED. All rights reserved.
1213
! $COPYRIGHT$
1314
!
1415
! This file provides the interface specifications for the MPI Fortran
@@ -2105,6 +2106,36 @@ subroutine PMPI_Type_set_name_f08(datatype,type_name,ierror)
21052106
end subroutine PMPI_Type_set_name_f08
21062107
end interface PMPI_Type_set_name
21072108

2109+
interface PMPI_Win_allocate
2110+
subroutine PMPI_Win_allocate_f08(size, disp_unit, info, comm, &
2111+
baseptr, win, ierror)
2112+
USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR
2113+
use :: mpi_f08_types, only : MPI_Info, MPI_Comm, MPI_Win, MPI_ADDRESS_KIND
2114+
INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(IN) :: size
2115+
INTEGER, INTENT(IN) :: disp_unit
2116+
TYPE(MPI_Info), INTENT(IN) :: info
2117+
TYPE(MPI_Comm), INTENT(IN) :: comm
2118+
TYPE(C_PTR), INTENT(OUT) :: baseptr
2119+
TYPE(MPI_Win), INTENT(OUT) :: win
2120+
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
2121+
end subroutine PMPI_Win_allocate_f08
2122+
end interface PMPI_Win_allocate
2123+
2124+
interface PMPI_Win_allocate_shared
2125+
subroutine PMPI_Win_allocate_shared_f08(size, disp_unit, info, comm, &
2126+
baseptr, win, ierror)
2127+
USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR
2128+
use :: mpi_f08_types, only : MPI_Info, MPI_Comm, MPI_Win, MPI_ADDRESS_KIND
2129+
INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(IN) :: size
2130+
INTEGER, INTENT(IN) :: disp_unit
2131+
TYPE(MPI_Info), INTENT(IN) :: info
2132+
TYPE(MPI_Comm), INTENT(IN) :: comm
2133+
TYPE(C_PTR), INTENT(OUT) :: baseptr
2134+
TYPE(MPI_Win), INTENT(OUT) :: win
2135+
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
2136+
end subroutine PMPI_Win_allocate_shared_f08
2137+
end interface PMPI_Win_allocate_shared
2138+
21082139
interface PMPI_Win_create_keyval
21092140
subroutine PMPI_Win_create_keyval_f08(win_copy_attr_fn,win_delete_attr_fn,win_keyval, &
21102141
extra_state,ierror)
@@ -2150,6 +2181,16 @@ subroutine PMPI_Win_get_attr_f08(win,win_keyval,attribute_val,flag,ierror)
21502181
end subroutine PMPI_Win_get_attr_f08
21512182
end interface PMPI_Win_get_attr
21522183

2184+
interface PMPI_Win_get_info
2185+
subroutine PMPI_Win_get_info_f08(win,info,ierror)
2186+
use :: mpi_f08_types, only : MPI_Win, MPI_Info
2187+
implicit none
2188+
TYPE(MPI_Win), INTENT(IN) :: win
2189+
TYPE(MPI_Info), INTENT(OUT) :: info
2190+
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
2191+
end subroutine PMPI_Win_get_info_f08
2192+
end interface PMPI_Win_get_info
2193+
21532194
interface PMPI_Win_get_name
21542195
subroutine PMPI_Win_get_name_f08(win,win_name,resultlen,ierror)
21552196
use :: mpi_f08_types, only : MPI_Win, MPI_MAX_OBJECT_NAME
@@ -2172,6 +2213,16 @@ subroutine PMPI_Win_set_attr_f08(win,win_keyval,attribute_val,ierror)
21722213
end subroutine PMPI_Win_set_attr_f08
21732214
end interface PMPI_Win_set_attr
21742215

2216+
interface PMPI_Win_set_info
2217+
subroutine PMPI_Win_set_info_f08(win,info,ierror)
2218+
use :: mpi_f08_types, only : MPI_Win, MPI_Info
2219+
implicit none
2220+
TYPE(MPI_Win), INTENT(IN) :: win
2221+
TYPE(MPI_Info), INTENT(IN) :: info
2222+
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
2223+
end subroutine PMPI_Win_set_info_f08
2224+
end interface PMPI_Win_set_info
2225+
21752226
interface PMPI_Win_set_name
21762227
subroutine PMPI_Win_set_name_f08(win,win_name,ierror)
21772228
use :: mpi_f08_types, only : MPI_Win
@@ -3187,6 +3238,48 @@ subroutine PMPI_Win_create_f08(base,size,disp_unit,info,comm,win,ierror)
31873238
end subroutine PMPI_Win_create_f08
31883239
end interface PMPI_Win_create
31893240

3241+
interface PMPI_Win_create_dynamic
3242+
subroutine PMPI_Win_create_dynamic_f08(info,comm,win,ierror)
3243+
use :: mpi_f08_types, only : MPI_Info, MPI_Comm, MPI_Win
3244+
implicit none
3245+
TYPE(MPI_Info), INTENT(IN) :: info
3246+
TYPE(MPI_Comm), INTENT(IN) :: comm
3247+
TYPE(MPI_Win), INTENT(OUT) :: win
3248+
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
3249+
end subroutine PMPI_Win_create_dynamic_f08
3250+
end interface PMPI_Win_create_dynamic
3251+
3252+
interface PMPI_Win_attach
3253+
subroutine PMPI_Win_attach_f08(win,base,size,ierror)
3254+
use :: mpi_f08_types, only : MPI_Win, MPI_ADDRESS_KIND
3255+
implicit none
3256+
!DEC$ ATTRIBUTES NO_ARG_CHECK :: base
3257+
!GCC$ ATTRIBUTES NO_ARG_CHECK :: base
3258+
!$PRAGMA IGNORE_TKR base
3259+
!DIR$ IGNORE_TKR base
3260+
!IBM* IGNORE_TKR base
3261+
OMPI_FORTRAN_IGNORE_TKR_TYPE :: base
3262+
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: size
3263+
TYPE(MPI_Win), INTENT(IN) :: win
3264+
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
3265+
end subroutine PMPI_Win_attach_f08
3266+
end interface PMPI_Win_attach
3267+
3268+
interface PMPI_Win_detach
3269+
subroutine PMPI_Win_detach_f08(win,base,ierror)
3270+
use :: mpi_f08_types, only : MPI_Win, MPI_ADDRESS_KIND
3271+
implicit none
3272+
!DEC$ ATTRIBUTES NO_ARG_CHECK :: base
3273+
!GCC$ ATTRIBUTES NO_ARG_CHECK :: base
3274+
!$PRAGMA IGNORE_TKR base
3275+
!DIR$ IGNORE_TKR base
3276+
!IBM* IGNORE_TKR base
3277+
OMPI_FORTRAN_IGNORE_TKR_TYPE :: base
3278+
TYPE(MPI_Win), INTENT(IN) :: win
3279+
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
3280+
end subroutine PMPI_Win_detach_f08
3281+
end interface PMPI_Win_detach
3282+
31903283
interface PMPI_Win_fence
31913284
subroutine PMPI_Win_fence_f08(assert,win,ierror)
31923285
use :: mpi_f08_types, only : MPI_Win
@@ -3247,6 +3340,20 @@ subroutine PMPI_Win_post_f08(group,assert,win,ierror)
32473340
end subroutine PMPI_Win_post_f08
32483341
end interface PMPI_Win_post
32493342

3343+
interface PMPI_Win_shared_query
3344+
subroutine PMPI_Win_shared_query_f08(win, rank, size, disp_unit, baseptr,&
3345+
ierror)
3346+
USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR
3347+
use :: mpi_f08_types, only : MPI_Win, MPI_ADDRESS_KIND
3348+
TYPE(MPI_Win), INTENT(IN) :: win
3349+
INTEGER, INTENT(IN) :: rank
3350+
INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(OUT) :: size
3351+
INTEGER, INTENT(OUT) :: disp_unit
3352+
TYPE(C_PTR), INTENT(OUT) :: baseptr
3353+
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
3354+
end subroutine PMPI_Win_shared_query_f08
3355+
end interface PMPI_Win_shared_query
3356+
32503357
interface PMPI_Win_start
32513358
subroutine PMPI_Win_start_f08(group,assert,win,ierror)
32523359
use :: mpi_f08_types, only : MPI_Group, MPI_Win
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
! -*- f90 -*-
2+
!
3+
! Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
4+
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
5+
! All Rights reserved.
6+
! Copyright (c) 2017 FUJITSU LIMITED. All rights reserved.
7+
! $COPYRIGHT$
8+
9+
#include "ompi/mpi/fortran/configure-fortran-output.h"
10+
11+
subroutine PMPI_File_iread_all_f08(fh,buf,count,datatype,request,ierror)
12+
use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request
13+
use :: mpi_f08, only : ompi_file_iread_all_f
14+
implicit none
15+
TYPE(MPI_File), INTENT(IN) :: fh
16+
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf
17+
INTEGER, INTENT(IN) :: count
18+
TYPE(MPI_Datatype), INTENT(IN) :: datatype
19+
TYPE(MPI_Request), INTENT(OUT) :: request
20+
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
21+
integer :: c_ierror
22+
23+
call ompi_file_iread_all_f(fh%MPI_VAL,buf,count,datatype%MPI_VAL,request%MPI_VAL,c_ierror)
24+
if (present(ierror)) ierror = c_ierror
25+
26+
end subroutine PMPI_File_iread_all_f08
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
! -*- f90 -*-
2+
!
3+
! Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
4+
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
5+
! All Rights reserved.
6+
! Copyright (c) 2017 FUJITSU LIMITED. All rights reserved.
7+
! $COPYRIGHT$
8+
9+
#include "ompi/mpi/fortran/configure-fortran-output.h"
10+
11+
subroutine PMPI_File_iread_at_all_f08(fh,offset,buf,count,datatype,request,ierror)
12+
use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request, MPI_OFFSET_KIND
13+
use :: mpi_f08, only : ompi_file_iread_at_all_f
14+
implicit none
15+
TYPE(MPI_File), INTENT(IN) :: fh
16+
INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset
17+
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf
18+
INTEGER, INTENT(IN) :: count
19+
TYPE(MPI_Datatype), INTENT(IN) :: datatype
20+
TYPE(MPI_Request), INTENT(OUT) :: request
21+
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
22+
integer :: c_ierror
23+
24+
call ompi_file_iread_at_all_f(fh%MPI_VAL,offset,buf,count,&
25+
datatype%MPI_VAL,request%MPI_VAL,c_ierror)
26+
if (present(ierror)) ierror = c_ierror
27+
28+
end subroutine PMPI_File_iread_at_all_f08
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
! -*- f90 -*-
2+
!
3+
! Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
4+
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
5+
! All Rights reserved.
6+
! Copyright (c) 2017 FUJITSU LIMITED. All rights reserved.
7+
! $COPYRIGHT$
8+
9+
#include "ompi/mpi/fortran/configure-fortran-output.h"
10+
11+
subroutine PMPI_File_iwrite_all_f08(fh,buf,count,datatype,request,ierror)
12+
use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request
13+
use :: mpi_f08, only : ompi_file_iwrite_all_f
14+
implicit none
15+
TYPE(MPI_File), INTENT(IN) :: fh
16+
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf
17+
INTEGER, INTENT(IN) :: count
18+
TYPE(MPI_Datatype), INTENT(IN) :: datatype
19+
TYPE(MPI_Request), INTENT(OUT) :: request
20+
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
21+
integer :: c_ierror
22+
23+
call ompi_file_iwrite_all_f(fh%MPI_VAL,buf,count,&
24+
datatype%MPI_VAL,request%MPI_VAL,c_ierror)
25+
if (present(ierror)) ierror = c_ierror
26+
27+
end subroutine PMPI_File_iwrite_all_f08
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
! -*- f90 -*-
2+
!
3+
! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
4+
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
5+
! All Rights reserved.
6+
! Copyright (c) 2017 FUJITSU LIMITED. All rights reserved.
7+
! $COPYRIGHT$
8+
9+
#include "ompi/mpi/fortran/configure-fortran-output.h"
10+
11+
subroutine PMPI_File_iwrite_at_all_f08(fh,offset,buf,count,datatype,request,ierror)
12+
use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request, MPI_OFFSET_KIND
13+
use :: mpi_f08, only : ompi_file_iwrite_at_all_f
14+
implicit none
15+
TYPE(MPI_File), INTENT(IN) :: fh
16+
INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset
17+
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf
18+
INTEGER, INTENT(IN) :: count
19+
TYPE(MPI_Datatype), INTENT(IN) :: datatype
20+
TYPE(MPI_Request), INTENT(OUT) :: request
21+
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
22+
integer :: c_ierror
23+
24+
call ompi_file_iwrite_at_all_f(fh%MPI_VAL,offset,buf,count,&
25+
datatype%MPI_VAL,request%MPI_VAL,c_ierror)
26+
if (present(ierror)) ierror = c_ierror
27+
28+
end subroutine PMPI_File_iwrite_at_all_f08

0 commit comments

Comments
 (0)