Skip to content

v2.x: mpi/fortran: use conformant dummy names for Fortran bindings #5131

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

Merged
Merged
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
16 changes: 8 additions & 8 deletions ompi/mpi/fortran/base/attr-fn-int-callback-interfaces.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
! Copyright (c) 2006-2014 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2013 Los Alamos National Security, LLC. All rights
! reserved.
! Copyright (c) 2015 Research Organization for Information Science
! and Technology (RIST). All rights reserved.
! Copyright (c) 2015-2018 Research Organization for Information Science
! and Technology (RIST). All rights reserved.
! $COPYRIGHT$
!
! Additional copyrights may follow
Expand Down Expand Up @@ -84,35 +84,35 @@ interface

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

subroutine MPI_TYPE_DUP_FN( oldtype, type_keyval, extra_state, &
subroutine MPI_TYPE_DUP_FN( datatype, type_keyval, extra_state, &
attribute_val_in, attribute_val_out, &
flag, ierr )
implicit none
include 'mpif-config.h'
integer :: oldtype
integer :: datatype
integer :: type_keyval
integer(KIND=MPI_ADDRESS_KIND) :: extra_state, attribute_val_in, attribute_val_out
logical :: flag
integer :: ierr
end subroutine MPI_TYPE_DUP_FN

subroutine MPI_TYPE_NULL_COPY_FN( type, type_keyval, extra_state, &
subroutine MPI_TYPE_NULL_COPY_FN( datatype, type_keyval, extra_state, &
attribute_val_in, attribute_val_out, &
flag, ierr )
implicit none
include 'mpif-config.h'
integer :: type
integer :: datatype
integer :: type_keyval
integer(kind=MPI_ADDRESS_KIND) :: extra_state, attribute_val_in, attribute_val_out
integer :: ierr
logical :: flag
end subroutine MPI_TYPE_NULL_COPY_FN

subroutine MPI_TYPE_NULL_DELETE_FN( type, type_keyval, attribute_val_out, &
subroutine MPI_TYPE_NULL_DELETE_FN( datatype, type_keyval, attribute_val_out, &
extra_state, ierr )
implicit none
include 'mpif-config.h'
integer :: type
integer :: datatype
integer :: type_keyval
integer(kind=MPI_ADDRESS_KIND) :: attribute_val_out, extra_state
integer :: ierr
Expand Down
28 changes: 14 additions & 14 deletions ompi/mpi/fortran/use-mpi-f08/mpi-f-interfaces-bind.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
! of Tennessee Research Foundation. All rights
! reserved.
! Copyright (c) 2012 Inria. All rights reserved.
! Copyright (c) 2015 Research Organization for Information Science
! and Technology (RIST). All rights reserved.
! Copyright (c) 2015-2018 Research Organization for Information Science
! and Technology (RIST). All rights reserved.
! $COPYRIGHT$
!
! This file provides the interface specifications for the MPI Fortran
Expand Down Expand Up @@ -655,10 +655,10 @@ subroutine ompi_type_create_subarray_f(ndims,array_of_sizes, &
INTEGER, INTENT(OUT) :: ierror
end subroutine ompi_type_create_subarray_f

subroutine ompi_type_dup_f(type,newtype,ierror) &
subroutine ompi_type_dup_f(oldtype,newtype,ierror) &
BIND(C, name="ompi_type_dup_f")
implicit none
INTEGER, INTENT(IN) :: type
INTEGER, INTENT(IN) :: oldtype
INTEGER, INTENT(OUT) :: newtype
INTEGER, INTENT(OUT) :: ierror
end subroutine ompi_type_dup_f
Expand Down Expand Up @@ -1536,10 +1536,10 @@ subroutine ompi_type_create_keyval_f(type_copy_attr_fn,type_delete_attr_fn, &
INTEGER, INTENT(OUT) :: ierror
end subroutine ompi_type_create_keyval_f

subroutine ompi_type_delete_attr_f(type,type_keyval,ierror) &
subroutine ompi_type_delete_attr_f(datatype,type_keyval,ierror) &
BIND(C, name="ompi_type_delete_attr_f")
implicit none
INTEGER, INTENT(IN) :: type
INTEGER, INTENT(IN) :: datatype
INTEGER, INTENT(IN) :: type_keyval
INTEGER, INTENT(OUT) :: ierror
end subroutine ompi_type_delete_attr_f
Expand All @@ -1551,32 +1551,32 @@ subroutine ompi_type_free_keyval_f(type_keyval,ierror) &
INTEGER, INTENT(OUT) :: ierror
end subroutine ompi_type_free_keyval_f

subroutine ompi_type_get_name_f(type,type_name,resultlen,ierror,type_name_len) &
subroutine ompi_type_get_name_f(datatype,type_name,resultlen,ierror,type_name_len) &
BIND(C, name="ompi_type_get_name_f")
use, intrinsic :: ISO_C_BINDING, only : C_CHAR
implicit none
INTEGER, INTENT(IN) :: type
INTEGER, INTENT(IN) :: datatype
CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: type_name
INTEGER, INTENT(OUT) :: resultlen
INTEGER, INTENT(OUT) :: ierror
INTEGER, VALUE, INTENT(IN) :: type_name_len
end subroutine ompi_type_get_name_f

subroutine ompi_type_set_attr_f(type,type_keyval,attribute_val,ierror) &
subroutine ompi_type_set_attr_f(datatype,type_keyval,attribute_val,ierror) &
BIND(C, name="ompi_type_set_attr_f")
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
implicit none
INTEGER, INTENT(IN) :: type
INTEGER, INTENT(IN) :: datatype
INTEGER, INTENT(IN) :: type_keyval
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: attribute_val
INTEGER, INTENT(OUT) :: ierror
end subroutine ompi_type_set_attr_f

subroutine ompi_type_set_name_f(type,type_name,ierror,type_name_len) &
subroutine ompi_type_set_name_f(datatype,type_name,ierror,type_name_len) &
BIND(C, name="ompi_type_set_name_f")
use, intrinsic :: ISO_C_BINDING, only : C_CHAR
implicit none
INTEGER, INTENT(IN) :: type
INTEGER, INTENT(IN) :: datatype
CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: type_name
INTEGER, INTENT(OUT) :: ierror
INTEGER, VALUE, INTENT(IN) :: type_name_len
Expand Down Expand Up @@ -3256,11 +3256,11 @@ subroutine ompi_type_create_f90_real_f(p,r,newtype,ierror) &
INTEGER, INTENT(OUT) :: ierror
end subroutine ompi_type_create_f90_real_f

subroutine ompi_type_match_size_f(typeclass,size,type,ierror) &
subroutine ompi_type_match_size_f(typeclass,size,datatype,ierror) &
BIND(C, name="ompi_type_match_size_f")
implicit none
INTEGER, INTENT(IN) :: typeclass, size
INTEGER, INTENT(OUT) :: type
INTEGER, INTENT(OUT) :: datatype
INTEGER, INTENT(OUT) :: ierror
end subroutine ompi_type_match_size_f

Expand Down
10 changes: 5 additions & 5 deletions ompi/mpi/fortran/use-mpi-f08/mpi-f08-interfaces-callbacks.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
! Copyright (c) 2009-2013 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
! All rights reserved.
! Copyright (c) 2015-2016 Research Organization for Information Science
! and Technology (RIST). All rights reserved.
! Copyright (c) 2015-2018 Research Organization for Information Science
! and Technology (RIST). All rights reserved.
! $COPYRIGHT$

#include "ompi/mpi/fortran/configure-fortran-output.h"
Expand All @@ -23,13 +23,13 @@ SUBROUTINE MPI_User_function(invec, inoutvec, len, datatype)

!Example of a user defined callback function
!
! subroutine my_user_function( invec, inoutvec, len, type ) bind(c)
! subroutine my_user_function( invec, inoutvec, len, datatype ) bind(c)
! use, intrinsic :: iso_c_binding, only : c_ptr, c_f_pointer
! type(c_ptr), value :: invec, inoutvec
! integer, intent(in) :: len
! type(MPI_Datatype) :: type
! type(MPI_Datatype) :: datatype
! real, pointer :: invec_r(:), inoutvec_r(:)
! if (type%MPI_VAL == MPI_REAL%MPI_VAL) then
! if (datatype%MPI_VAL == MPI_REAL%MPI_VAL) then
! call c_f_pointer(invec, invec_r, (/ len /) )
! call c_f_pointer(inoutvec, inoutvec_r, (/ len /) )
! inoutvec_r = invec_r + inoutvec_r
Expand Down
28 changes: 14 additions & 14 deletions ompi/mpi/fortran/use-mpi-f08/pmpi-f-interfaces-bind.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
! of Tennessee Research Foundation. All rights
! reserved.
! Copyright (c) 2012 Inria. All rights reserved.
! Copyright (c) 2015 Research Organization for Information Science
! and Technology (RIST). All rights reserved.
! Copyright (c) 2015-2018 Research Organization for Information Science
! and Technology (RIST). All rights reserved.
! $COPYRIGHT$
!
! This file provides the interface specifications for the MPI Fortran
Expand Down Expand Up @@ -560,10 +560,10 @@ subroutine pompi_type_create_subarray_f(ndims,array_of_sizes, &
INTEGER, INTENT(OUT) :: ierror
end subroutine pompi_type_create_subarray_f

subroutine pompi_type_dup_f(type,newtype,ierror) &
subroutine pompi_type_dup_f(oldtype,newtype,ierror) &
BIND(C, name="pompi_type_dup_f")
implicit none
INTEGER, INTENT(IN) :: type
INTEGER, INTENT(IN) :: oldtype
INTEGER, INTENT(OUT) :: newtype
INTEGER, INTENT(OUT) :: ierror
end subroutine pompi_type_dup_f
Expand Down Expand Up @@ -1370,10 +1370,10 @@ subroutine pompi_type_create_keyval_f(type_copy_attr_fn,type_delete_attr_fn, &
INTEGER, INTENT(OUT) :: ierror
end subroutine pompi_type_create_keyval_f

subroutine pompi_type_delete_attr_f(type,type_keyval,ierror) &
subroutine pompi_type_delete_attr_f(datatype,type_keyval,ierror) &
BIND(C, name="pompi_type_delete_attr_f")
implicit none
INTEGER, INTENT(IN) :: type
INTEGER, INTENT(IN) :: datatype
INTEGER, INTENT(IN) :: type_keyval
INTEGER, INTENT(OUT) :: ierror
end subroutine pompi_type_delete_attr_f
Expand All @@ -1385,32 +1385,32 @@ subroutine pompi_type_free_keyval_f(type_keyval,ierror) &
INTEGER, INTENT(OUT) :: ierror
end subroutine pompi_type_free_keyval_f

subroutine pompi_type_get_name_f(type,type_name,resultlen,ierror,type_name_len) &
subroutine pompi_type_get_name_f(datatype,type_name,resultlen,ierror,type_name_len) &
BIND(C, name="pompi_type_get_name_f")
use, intrinsic :: ISO_C_BINDING, only : C_CHAR
implicit none
INTEGER, INTENT(IN) :: type
INTEGER, INTENT(IN) :: datatype
CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(OUT) :: type_name
INTEGER, INTENT(OUT) :: resultlen
INTEGER, INTENT(OUT) :: ierror
INTEGER, VALUE, INTENT(IN) :: type_name_len
end subroutine pompi_type_get_name_f

subroutine pompi_type_set_attr_f(type,type_keyval,attribute_val,ierror) &
subroutine pompi_type_set_attr_f(datatype,type_keyval,attribute_val,ierror) &
BIND(C, name="pompi_type_set_attr_f")
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
implicit none
INTEGER, INTENT(IN) :: type
INTEGER, INTENT(IN) :: datatype
INTEGER, INTENT(IN) :: type_keyval
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: attribute_val
INTEGER, INTENT(OUT) :: ierror
end subroutine pompi_type_set_attr_f

subroutine pompi_type_set_name_f(type,type_name,ierror,type_name_len) &
subroutine pompi_type_set_name_f(datatype,type_name,ierror,type_name_len) &
BIND(C, name="pompi_type_set_name_f")
use, intrinsic :: ISO_C_BINDING, only : C_CHAR
implicit none
INTEGER, INTENT(IN) :: type
INTEGER, INTENT(IN) :: datatype
CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: type_name
INTEGER, INTENT(OUT) :: ierror
INTEGER, VALUE, INTENT(IN) :: type_name_len
Expand Down Expand Up @@ -3039,11 +3039,11 @@ subroutine pompi_type_create_f90_real_f(p,r,newtype,ierror) &
INTEGER, INTENT(OUT) :: ierror
end subroutine pompi_type_create_f90_real_f

subroutine pompi_type_match_size_f(typeclass,size,type,ierror) &
subroutine pompi_type_match_size_f(typeclass,size,datatype,ierror) &
BIND(C, name="pompi_type_match_size_f")
implicit none
INTEGER, INTENT(IN) :: typeclass, size
INTEGER, INTENT(OUT) :: type
INTEGER, INTENT(OUT) :: datatype
INTEGER, INTENT(OUT) :: ierror
end subroutine pompi_type_match_size_f

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
! All rights reserved.
! Copyright (c) 2018 Research Organization for Information Science
! and Technology (RIST). All rights reserved.
! $COPYRIGHT$

subroutine PMPI_Type_delete_attr_f08(type,type_keyval,ierror)
subroutine PMPI_Type_delete_attr_f08(datatype,type_keyval,ierror)
use :: mpi_f08_types, only : MPI_Datatype
use :: mpi_f08, only : ompi_type_delete_attr_f
implicit none
TYPE(MPI_Datatype), INTENT(IN) :: type
TYPE(MPI_Datatype), INTENT(IN) :: datatype
INTEGER, INTENT(IN) :: type_keyval
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror

call ompi_type_delete_attr_f(type%MPI_VAL,type_keyval,c_ierror)
call ompi_type_delete_attr_f(datatype%MPI_VAL,type_keyval,c_ierror)
if (present(ierror)) ierror = c_ierror

end subroutine PMPI_Type_delete_attr_f08
8 changes: 5 additions & 3 deletions ompi/mpi/fortran/use-mpi-f08/profile/ptype_dup_f08.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
! All rights reserved.
! Copyright (c) 2018 Research Organization for Information Science
! and Technology (RIST). All rights reserved.
! $COPYRIGHT$

subroutine PMPI_Type_dup_f08(type,newtype,ierror)
subroutine PMPI_Type_dup_f08(oldtype,newtype,ierror)
use :: mpi_f08_types, only : MPI_Datatype
use :: mpi_f08, only : ompi_type_dup_f
implicit none
TYPE(MPI_Datatype), INTENT(IN) :: type
TYPE(MPI_Datatype), INTENT(IN) :: oldtype
TYPE(MPI_Datatype), INTENT(OUT) :: newtype
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror

call ompi_type_dup_f(type%MPI_VAL,newtype%MPI_VAL,c_ierror)
call ompi_type_dup_f(oldtype%MPI_VAL,newtype%MPI_VAL,c_ierror)
if (present(ierror)) ierror = c_ierror

end subroutine PMPI_Type_dup_f08
8 changes: 5 additions & 3 deletions ompi/mpi/fortran/use-mpi-f08/profile/ptype_get_attr_f08.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@
! Copyright (c) 2009-2013 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
! All rights reserved.
! Copyright (c) 2018 Research Organization for Information Science
! and Technology (RIST). All rights reserved.
! $COPYRIGHT$

subroutine PMPI_Type_get_attr_f08(type,type_keyval,attribute_val,flag,ierror)
subroutine PMPI_Type_get_attr_f08(datatype,type_keyval,attribute_val,flag,ierror)
use :: mpi_f08_types, only : MPI_Datatype, MPI_ADDRESS_KIND
! See note in mpi-f-interfaces-bind.h for why we "use mpi" here and
! call a PMPI_* subroutine below.
use :: mpi, only : PMPI_Type_get_attr
implicit none
TYPE(MPI_Datatype), INTENT(IN) :: type
TYPE(MPI_Datatype), INTENT(IN) :: datatype
INTEGER, INTENT(IN) :: type_keyval
INTEGER(MPI_ADDRESS_KIND), INTENT(OUT) :: attribute_val
LOGICAL, INTENT(OUT) :: flag
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror

call PMPI_Type_get_attr(type%MPI_VAL,type_keyval,attribute_val,flag,c_ierror)
call PMPI_Type_get_attr(datatype%MPI_VAL,type_keyval,attribute_val,flag,c_ierror)
if (present(ierror)) ierror = c_ierror
end subroutine PMPI_Type_get_attr_f08
8 changes: 5 additions & 3 deletions ompi/mpi/fortran/use-mpi-f08/profile/ptype_get_name_f08.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@
! Copyright (c) 2010-2011 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
! All rights reserved.
! Copyright (c) 2018 Research Organization for Information Science
! and Technology (RIST). All rights reserved.
! $COPYRIGHT$

subroutine PMPI_Type_get_name_f08(type,type_name,resultlen,ierror)
subroutine PMPI_Type_get_name_f08(datatype,type_name,resultlen,ierror)
use :: mpi_f08_types, only : MPI_Datatype, MPI_MAX_OBJECT_NAME
use :: mpi_f08, only : ompi_type_get_name_f
implicit none
TYPE(MPI_Datatype), INTENT(IN) :: type
TYPE(MPI_Datatype), INTENT(IN) :: datatype
CHARACTER(LEN=*), INTENT(OUT) :: type_name
INTEGER, INTENT(OUT) :: resultlen
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror

call ompi_type_get_name_f(type%MPI_VAL,type_name,resultlen,c_ierror,len(type_name))
call ompi_type_get_name_f(datatype%MPI_VAL,type_name,resultlen,c_ierror,len(type_name))
if (present(ierror)) ierror = c_ierror

end subroutine PMPI_Type_get_name_f08
8 changes: 5 additions & 3 deletions ompi/mpi/fortran/use-mpi-f08/profile/ptype_match_size_f08.F90
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@
! Copyright (c) 2009-2012 Cisco Systems, Inc. All rights reserved.
! Copyright (c) 2009-2012 Los Alamos National Security, LLC.
! All Rights reserved.
! Copyright (c) 2018 Research Organization for Information Science
! and Technology (RIST). All rights reserved.
! $COPYRIGHT$

subroutine PMPI_Type_match_size_f08(typeclass,size,type,ierror)
subroutine PMPI_Type_match_size_f08(typeclass,size,datatype,ierror)
use :: mpi_f08_types, only : MPI_Datatype
use :: mpi_f08, only : ompi_type_match_size_f
implicit none
INTEGER, INTENT(IN) :: typeclass, size
TYPE(MPI_Datatype), INTENT(OUT) :: type
TYPE(MPI_Datatype), INTENT(OUT) :: datatype
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror

call ompi_type_match_size_f(typeclass,size,type%MPI_VAL,c_ierror)
call ompi_type_match_size_f(typeclass,size,datatype%MPI_VAL,c_ierror)
if (present(ierror)) ierror = c_ierror

end subroutine PMPI_Type_match_size_f08
Loading