From 3f4b3738562309b954ac75eacc58d2746d388624 Mon Sep 17 00:00:00 2001 From: Tsubasa Yanagibashi Date: Thu, 21 Dec 2017 17:13:22 +0900 Subject: [PATCH] Add missing Fortran 2008 binding subroutines added missing Fortran 2008 binding pmpi_{*} subroutines to Open MPI. Signed-off-by: Tsubasa Yanagibashi --- ompi/mpi/fortran/use-mpi-f08/Makefile.am | 5 + .../use-mpi-f08/mod/pmpi-f08-interfaces.F90 | 107 ++++++++++++++++++ .../profile/pfile_iread_all_f08.F90 | 26 +++++ .../profile/pfile_iread_at_all_f08.F90 | 28 +++++ .../profile/pfile_iwrite_all_f08.F90 | 27 +++++ .../profile/pfile_iwrite_at_all_f08.F90 | 28 +++++ 6 files changed, 221 insertions(+) create mode 100644 ompi/mpi/fortran/use-mpi-f08/profile/pfile_iread_all_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/profile/pfile_iread_at_all_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/profile/pfile_iwrite_all_f08.F90 create mode 100644 ompi/mpi/fortran/use-mpi-f08/profile/pfile_iwrite_at_all_f08.F90 diff --git a/ompi/mpi/fortran/use-mpi-f08/Makefile.am b/ompi/mpi/fortran/use-mpi-f08/Makefile.am index 4574ae5dff..786b7640a7 100644 --- a/ompi/mpi/fortran/use-mpi-f08/Makefile.am +++ b/ompi/mpi/fortran/use-mpi-f08/Makefile.am @@ -10,6 +10,7 @@ # Copyright (c) 2015-2017 Research Organization for Information Science # and Technology (RIST). All rights reserved. # Copyright (c) 2016 IBM Corporation. All rights reserved. +# Copyright (c) 2017 FUJITSU LIMITED. All rights reserved. # # $COPYRIGHT$ # @@ -533,9 +534,13 @@ pmpi_api_files = \ profile/pfile_get_view_f08.F90 \ profile/pfile_iread_at_f08.F90 \ profile/pfile_iread_f08.F90 \ + profile/pfile_iread_at_all_f08.F90 \ + profile/pfile_iread_all_f08.F90 \ profile/pfile_iread_shared_f08.F90 \ profile/pfile_iwrite_at_f08.F90 \ profile/pfile_iwrite_f08.F90 \ + profile/pfile_iwrite_at_all_f08.F90 \ + profile/pfile_iwrite_all_f08.F90 \ profile/pfile_iwrite_shared_f08.F90 \ profile/pfile_open_f08.F90 \ profile/pfile_preallocate_f08.F90 \ diff --git a/ompi/mpi/fortran/use-mpi-f08/mod/pmpi-f08-interfaces.F90 b/ompi/mpi/fortran/use-mpi-f08/mod/pmpi-f08-interfaces.F90 index 5b2b117b57..09a4e434f6 100644 --- a/ompi/mpi/fortran/use-mpi-f08/mod/pmpi-f08-interfaces.F90 +++ b/ompi/mpi/fortran/use-mpi-f08/mod/pmpi-f08-interfaces.F90 @@ -9,6 +9,7 @@ ! Copyright (c) 2012 Inria. All rights reserved. ! Copyright (c) 2015-2017 Research Organization for Information Science ! and Technology (RIST). All rights reserved. +! Copyright (c) 2017 FUJITSU LIMITED. All rights reserved. ! $COPYRIGHT$ ! ! This file provides the interface specifications for the MPI Fortran @@ -2105,6 +2106,36 @@ subroutine PMPI_Type_set_name_f08(datatype,type_name,ierror) end subroutine PMPI_Type_set_name_f08 end interface PMPI_Type_set_name +interface PMPI_Win_allocate +subroutine PMPI_Win_allocate_f08(size, disp_unit, info, comm, & + baseptr, win, ierror) + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR + use :: mpi_f08_types, only : MPI_Info, MPI_Comm, MPI_Win, MPI_ADDRESS_KIND + INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(IN) :: size + INTEGER, INTENT(IN) :: disp_unit + TYPE(MPI_Info), INTENT(IN) :: info + TYPE(MPI_Comm), INTENT(IN) :: comm + TYPE(C_PTR), INTENT(OUT) :: baseptr + TYPE(MPI_Win), INTENT(OUT) :: win + INTEGER, OPTIONAL, INTENT(OUT) :: ierror +end subroutine PMPI_Win_allocate_f08 +end interface PMPI_Win_allocate + +interface PMPI_Win_allocate_shared +subroutine PMPI_Win_allocate_shared_f08(size, disp_unit, info, comm, & + baseptr, win, ierror) + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR + use :: mpi_f08_types, only : MPI_Info, MPI_Comm, MPI_Win, MPI_ADDRESS_KIND + INTEGER(KIND=MPI_ADDRESS_KIND), INTENT(IN) :: size + INTEGER, INTENT(IN) :: disp_unit + TYPE(MPI_Info), INTENT(IN) :: info + TYPE(MPI_Comm), INTENT(IN) :: comm + TYPE(C_PTR), INTENT(OUT) :: baseptr + TYPE(MPI_Win), INTENT(OUT) :: win + INTEGER, OPTIONAL, INTENT(OUT) :: ierror +end subroutine PMPI_Win_allocate_shared_f08 +end interface PMPI_Win_allocate_shared + interface PMPI_Win_create_keyval subroutine PMPI_Win_create_keyval_f08(win_copy_attr_fn,win_delete_attr_fn,win_keyval, & extra_state,ierror) @@ -2150,6 +2181,16 @@ subroutine PMPI_Win_get_attr_f08(win,win_keyval,attribute_val,flag,ierror) end subroutine PMPI_Win_get_attr_f08 end interface PMPI_Win_get_attr +interface PMPI_Win_get_info +subroutine PMPI_Win_get_info_f08(win,info,ierror) + use :: mpi_f08_types, only : MPI_Win, MPI_Info + implicit none + TYPE(MPI_Win), INTENT(IN) :: win + TYPE(MPI_Info), INTENT(OUT) :: info + INTEGER, OPTIONAL, INTENT(OUT) :: ierror +end subroutine PMPI_Win_get_info_f08 +end interface PMPI_Win_get_info + interface PMPI_Win_get_name subroutine PMPI_Win_get_name_f08(win,win_name,resultlen,ierror) 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) end subroutine PMPI_Win_set_attr_f08 end interface PMPI_Win_set_attr +interface PMPI_Win_set_info +subroutine PMPI_Win_set_info_f08(win,info,ierror) + use :: mpi_f08_types, only : MPI_Win, MPI_Info + implicit none + TYPE(MPI_Win), INTENT(IN) :: win + TYPE(MPI_Info), INTENT(IN) :: info + INTEGER, OPTIONAL, INTENT(OUT) :: ierror +end subroutine PMPI_Win_set_info_f08 +end interface PMPI_Win_set_info + interface PMPI_Win_set_name subroutine PMPI_Win_set_name_f08(win,win_name,ierror) use :: mpi_f08_types, only : MPI_Win @@ -3187,6 +3238,48 @@ subroutine PMPI_Win_create_f08(base,size,disp_unit,info,comm,win,ierror) end subroutine PMPI_Win_create_f08 end interface PMPI_Win_create +interface PMPI_Win_create_dynamic +subroutine PMPI_Win_create_dynamic_f08(info,comm,win,ierror) + use :: mpi_f08_types, only : MPI_Info, MPI_Comm, MPI_Win + implicit none + TYPE(MPI_Info), INTENT(IN) :: info + TYPE(MPI_Comm), INTENT(IN) :: comm + TYPE(MPI_Win), INTENT(OUT) :: win + INTEGER, OPTIONAL, INTENT(OUT) :: ierror +end subroutine PMPI_Win_create_dynamic_f08 +end interface PMPI_Win_create_dynamic + +interface PMPI_Win_attach +subroutine PMPI_Win_attach_f08(win,base,size,ierror) + use :: mpi_f08_types, only : MPI_Win, MPI_ADDRESS_KIND + implicit none + !DEC$ ATTRIBUTES NO_ARG_CHECK :: base + !GCC$ ATTRIBUTES NO_ARG_CHECK :: base + !$PRAGMA IGNORE_TKR base + !DIR$ IGNORE_TKR base + !IBM* IGNORE_TKR base + OMPI_FORTRAN_IGNORE_TKR_TYPE :: base + INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: size + TYPE(MPI_Win), INTENT(IN) :: win + INTEGER, OPTIONAL, INTENT(OUT) :: ierror +end subroutine PMPI_Win_attach_f08 +end interface PMPI_Win_attach + +interface PMPI_Win_detach +subroutine PMPI_Win_detach_f08(win,base,ierror) + use :: mpi_f08_types, only : MPI_Win, MPI_ADDRESS_KIND + implicit none + !DEC$ ATTRIBUTES NO_ARG_CHECK :: base + !GCC$ ATTRIBUTES NO_ARG_CHECK :: base + !$PRAGMA IGNORE_TKR base + !DIR$ IGNORE_TKR base + !IBM* IGNORE_TKR base + OMPI_FORTRAN_IGNORE_TKR_TYPE :: base + TYPE(MPI_Win), INTENT(IN) :: win + INTEGER, OPTIONAL, INTENT(OUT) :: ierror +end subroutine PMPI_Win_detach_f08 +end interface PMPI_Win_detach + interface PMPI_Win_fence subroutine PMPI_Win_fence_f08(assert,win,ierror) use :: mpi_f08_types, only : MPI_Win @@ -3247,6 +3340,20 @@ subroutine PMPI_Win_post_f08(group,assert,win,ierror) end subroutine PMPI_Win_post_f08 end interface PMPI_Win_post +interface PMPI_Win_shared_query +subroutine PMPI_Win_shared_query_f08(win, rank, size, disp_unit, baseptr,& + ierror) + USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR + use :: mpi_f08_types, only : MPI_Win, MPI_ADDRESS_KIND + TYPE(MPI_Win), 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, OPTIONAL, INTENT(OUT) :: ierror +end subroutine PMPI_Win_shared_query_f08 +end interface PMPI_Win_shared_query + interface PMPI_Win_start subroutine PMPI_Win_start_f08(group,assert,win,ierror) use :: mpi_f08_types, only : MPI_Group, MPI_Win diff --git a/ompi/mpi/fortran/use-mpi-f08/profile/pfile_iread_all_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/profile/pfile_iread_all_f08.F90 new file mode 100644 index 0000000000..3d935f98ae --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/profile/pfile_iread_all_f08.F90 @@ -0,0 +1,26 @@ +! -*- f90 -*- +! +! Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2009-2012 Los Alamos National Security, LLC. +! All Rights reserved. +! Copyright (c) 2017 FUJITSU LIMITED. All rights reserved. +! $COPYRIGHT$ + +#include "ompi/mpi/fortran/configure-fortran-output.h" + +subroutine PMPI_File_iread_all_f08(fh,buf,count,datatype,request,ierror) + use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request + use :: mpi_f08, only : ompi_file_iread_all_f + implicit none + TYPE(MPI_File), INTENT(IN) :: fh + OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf + INTEGER, INTENT(IN) :: count + TYPE(MPI_Datatype), INTENT(IN) :: datatype + TYPE(MPI_Request), INTENT(OUT) :: request + INTEGER, OPTIONAL, INTENT(OUT) :: ierror + integer :: c_ierror + + call ompi_file_iread_all_f(fh%MPI_VAL,buf,count,datatype%MPI_VAL,request%MPI_VAL,c_ierror) + if (present(ierror)) ierror = c_ierror + +end subroutine PMPI_File_iread_all_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/profile/pfile_iread_at_all_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/profile/pfile_iread_at_all_f08.F90 new file mode 100644 index 0000000000..1a627fd739 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/profile/pfile_iread_at_all_f08.F90 @@ -0,0 +1,28 @@ +! -*- f90 -*- +! +! Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2009-2012 Los Alamos National Security, LLC. +! All Rights reserved. +! Copyright (c) 2017 FUJITSU LIMITED. All rights reserved. +! $COPYRIGHT$ + +#include "ompi/mpi/fortran/configure-fortran-output.h" + +subroutine PMPI_File_iread_at_all_f08(fh,offset,buf,count,datatype,request,ierror) + use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request, MPI_OFFSET_KIND + use :: mpi_f08, only : ompi_file_iread_at_all_f + implicit none + TYPE(MPI_File), INTENT(IN) :: fh + INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset + OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf + INTEGER, INTENT(IN) :: count + TYPE(MPI_Datatype), INTENT(IN) :: datatype + TYPE(MPI_Request), INTENT(OUT) :: request + INTEGER, OPTIONAL, INTENT(OUT) :: ierror + integer :: c_ierror + + call ompi_file_iread_at_all_f(fh%MPI_VAL,offset,buf,count,& + datatype%MPI_VAL,request%MPI_VAL,c_ierror) + if (present(ierror)) ierror = c_ierror + +end subroutine PMPI_File_iread_at_all_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/profile/pfile_iwrite_all_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/profile/pfile_iwrite_all_f08.F90 new file mode 100644 index 0000000000..f176b17d9e --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/profile/pfile_iwrite_all_f08.F90 @@ -0,0 +1,27 @@ +! -*- f90 -*- +! +! Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2009-2012 Los Alamos National Security, LLC. +! All Rights reserved. +! Copyright (c) 2017 FUJITSU LIMITED. All rights reserved. +! $COPYRIGHT$ + +#include "ompi/mpi/fortran/configure-fortran-output.h" + +subroutine PMPI_File_iwrite_all_f08(fh,buf,count,datatype,request,ierror) + use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request + use :: mpi_f08, only : ompi_file_iwrite_all_f + implicit none + TYPE(MPI_File), INTENT(IN) :: fh + OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf + INTEGER, INTENT(IN) :: count + TYPE(MPI_Datatype), INTENT(IN) :: datatype + TYPE(MPI_Request), INTENT(OUT) :: request + INTEGER, OPTIONAL, INTENT(OUT) :: ierror + integer :: c_ierror + + call ompi_file_iwrite_all_f(fh%MPI_VAL,buf,count,& + datatype%MPI_VAL,request%MPI_VAL,c_ierror) + if (present(ierror)) ierror = c_ierror + +end subroutine PMPI_File_iwrite_all_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/profile/pfile_iwrite_at_all_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/profile/pfile_iwrite_at_all_f08.F90 new file mode 100644 index 0000000000..ff5116f5d8 --- /dev/null +++ b/ompi/mpi/fortran/use-mpi-f08/profile/pfile_iwrite_at_all_f08.F90 @@ -0,0 +1,28 @@ +! -*- f90 -*- +! +! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2009-2012 Los Alamos National Security, LLC. +! All Rights reserved. +! Copyright (c) 2017 FUJITSU LIMITED. All rights reserved. +! $COPYRIGHT$ + +#include "ompi/mpi/fortran/configure-fortran-output.h" + +subroutine PMPI_File_iwrite_at_all_f08(fh,offset,buf,count,datatype,request,ierror) + use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request, MPI_OFFSET_KIND + use :: mpi_f08, only : ompi_file_iwrite_at_all_f + implicit none + TYPE(MPI_File), INTENT(IN) :: fh + INTEGER(MPI_OFFSET_KIND), INTENT(IN) :: offset + OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf + INTEGER, INTENT(IN) :: count + TYPE(MPI_Datatype), INTENT(IN) :: datatype + TYPE(MPI_Request), INTENT(OUT) :: request + INTEGER, OPTIONAL, INTENT(OUT) :: ierror + integer :: c_ierror + + call ompi_file_iwrite_at_all_f(fh%MPI_VAL,offset,buf,count,& + datatype%MPI_VAL,request%MPI_VAL,c_ierror) + if (present(ierror)) ierror = c_ierror + +end subroutine PMPI_File_iwrite_at_all_f08