Skip to content

fortran bindings: use assumed rank syntax if supported #10266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions config/ompi_fortran_check_ignore_tkr.m4
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ dnl Copyright (c) 2007 Los Alamos National Security, LLC. All rights
dnl reserved.
dnl Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
dnl Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
dnl Copyright (c) 2022 Triad National Security, LLC. All rights
dnl reserved.
dnl
dnl $COPYRIGHT$
dnl
dnl Additional copyrights may follow
Expand Down Expand Up @@ -70,12 +73,18 @@ AC_DEFUN([_OMPI_FORTRAN_CHECK_IGNORE_TKR], [
ompi_fortran_ignore_tkr_predecl=!
ompi_fortran_ignore_tkr_type=real

# Vendor-neutral, TYPE(*),DIMENSION(..) assumed rank syntax
OMPI_FORTRAN_CHECK_F08_ASSUMED_RANK(
[OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB(
[!], [type(*), dimension(..)],
[TYPE(*), DIMENSION(..)],
[happy=1], [happy=0])])
# Vendor-neutral, TYPE(*) syntax
OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB(
[!], [type(*)],
[TYPE(*), DIMENSION(*)],
[happy=1], [happy=0])

AS_IF([test $happy -eq 0],
[OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB(
[!], [type(*)],
[TYPE(*), DIMENSION(*)],
[happy=1], [happy=0])])
# GCC compilers
AS_IF([test $happy -eq 0],
[OMPI_FORTRAN_CHECK_IGNORE_TKR_SUB(
Expand Down
18 changes: 5 additions & 13 deletions ompi/mpi/fortran/use-mpi-f08/mod/mpi-f08-interfaces.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
! Copyright (c) 2015-2020 Research Organization for Information Science
! and Technology (RIST). All rights reserved.
! Copyright (c) 2017-2018 FUJITSU LIMITED. All rights reserved.
! Copyright (c) 2021 Triad National Security, LLC. All rights
! Copyright (c) 2021-2022 Triad National Security, LLC. All rights
! reserved.
! $COPYRIGHT$
!
Expand Down Expand Up @@ -203,12 +203,8 @@ interface MPI_Precv_init
subroutine MPI_Precv_init_f08(buf,partitions,count,datatype,dest,tag,comm,request,ierror)
use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request
implicit none
!DEC$ ATTRIBUTES NO_ARG_CHECK :: buf
!GCC$ ATTRIBUTES NO_ARG_CHECK :: buf
!$PRAGMA IGNORE_TKR buf
!DIR$ IGNORE_TKR buf
!IBM* IGNORE_TKR buf
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf
@OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf
@OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: buf
INTEGER, INTENT(IN) :: partitions, count, dest, tag
TYPE(MPI_Datatype), INTENT(IN) :: datatype
TYPE(MPI_Comm), INTENT(IN) :: comm
Expand All @@ -221,12 +217,8 @@ interface MPI_Psend_init
subroutine MPI_Psend_init_f08(buf,partitions,count,datatype,dest,tag,comm,request,ierror)
use :: mpi_f08_types, only : MPI_Datatype, MPI_Comm, MPI_Request
implicit none
!DEC$ ATTRIBUTES NO_ARG_CHECK :: buf
!GCC$ ATTRIBUTES NO_ARG_CHECK :: buf
!$PRAGMA IGNORE_TKR buf
!DIR$ IGNORE_TKR buf
!IBM* IGNORE_TKR buf
OMPI_FORTRAN_IGNORE_TKR_TYPE, INTENT(IN) :: buf
@OMPI_FORTRAN_IGNORE_TKR_PREDECL@ buf
@OMPI_FORTRAN_IGNORE_TKR_TYPE@, INTENT(IN) :: buf
INTEGER, INTENT(IN) :: partitions, count, dest, tag
TYPE(MPI_Datatype), INTENT(IN) :: datatype
TYPE(MPI_Comm), INTENT(IN) :: comm
Expand Down