mpi_f08: Fix param name and string length for MPI_GET_LIBRARY_VERSION
Junchao Zhang pointed out to me that we had the wrong parameter name and string length specification for the "version" parameter. This matters because Fortran allows passing by parameter name (vs. parameter ordering). Specifically, we had the interface as: {{{ subroutine MPI_Get_library_version_f08(name,resultlen,ierror) character(len=MPI_MAX_PROCESSOR_NAME), intent(out) :: name ...etc. }}} but it should be: {{{ subroutine MPI_Get_library_version_f08(version,resultlen,ierror) character(len=MPI_MAX_LIBRARY_VERSION_STRING), intent(out) :: version ...etc. }}} Thankfully, MPI_MAX_PROCESSOR_NAME and MPI_MAX_LIBRARY_VERSION_STRING are both 255 in OMPI, so there's no ABI issue caused by changing the length from MMPN --> MMLVS. The ABI is also unaffected by the parameter name change: if you compile/link an MPI application calling MPI_GET_LIBRARY_VERSION with 1.8, it'll still run-time link with this change. However, if an MPI program compiled using parameter name passing with the old/incorrect parameter name ("name"), it won't be able to compile with the new/correct parameter name ("version"). But this will only happen for an incorrect MPI application (because the MPI-3 mandated parameter name is "version", not "name"), so they deserve what they get. cmr=v1.8.1:reviewer=dgoodell This commit was SVN r31365.
Этот коммит содержится в:
родитель
6521dcc4f1
Коммит
12e82daa78
@ -4252,10 +4252,10 @@ end subroutine MPI_F_sync_reg_f08
|
||||
end interface MPI_F_sync_reg
|
||||
|
||||
interface MPI_Get_library_version
|
||||
subroutine MPI_Get_library_version_f08(name,resultlen,ierror)
|
||||
use :: mpi_f08_types, only : MPI_MAX_PROCESSOR_NAME
|
||||
subroutine MPI_Get_library_version_f08(version,resultlen,ierror)
|
||||
use :: mpi_f08_types, only : MPI_MAX_LIBRARY_VERSION_STRING
|
||||
implicit none
|
||||
character(len=MPI_MAX_PROCESSOR_NAME), intent(out) :: name
|
||||
character(len=MPI_MAX_LIBRARY_VERSION_STRING), intent(out) :: version
|
||||
integer, intent(out) :: resultlen
|
||||
integer, optional, intent(out) :: ierror
|
||||
end subroutine MPI_Get_library_version_f08
|
||||
|
@ -4253,10 +4253,10 @@ end subroutine PMPI_F_sync_reg_f08
|
||||
end interface PMPI_F_sync_reg
|
||||
|
||||
interface PMPI_Get_library_version
|
||||
subroutine PMPI_Get_library_version_f08(name,resultlen,ierror)
|
||||
use :: mpi_f08_types, only : MPI_MAX_PROCESSOR_NAME
|
||||
subroutine PMPI_Get_library_version_f08(version,resultlen,ierror)
|
||||
use :: mpi_f08_types, only : MPI_MAX_LIBRARY_VERSION_STRING
|
||||
implicit none
|
||||
character(len=MPI_MAX_PROCESSOR_NAME), intent(out) :: name
|
||||
character(len=MPI_MAX_LIBRARY_VERSION_STRING), intent(out) :: version
|
||||
integer, intent(out) :: resultlen
|
||||
integer, optional, intent(out) :: ierror
|
||||
end subroutine PMPI_Get_library_version_f08
|
||||
|
@ -1,20 +1,20 @@
|
||||
! -*- f90 -*-
|
||||
!
|
||||
! Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
|
||||
! Copyright (c) 2010-2014 Cisco Systems, Inc. All rights reserved.
|
||||
! Copyright (c) 2010-2012 Los Alamos National Security, LLC.
|
||||
! All Rights reserved.
|
||||
! $COPYRIGHT$
|
||||
|
||||
subroutine MPI_Get_library_version_f08(name,resultlen,ierror)
|
||||
use :: mpi_f08_types, only : MPI_MAX_PROCESSOR_NAME
|
||||
subroutine MPI_Get_library_version_f08(version,resultlen,ierror)
|
||||
use :: mpi_f08_types, only : MPI_MAX_LIBRARY_VERSION_STRING
|
||||
use :: mpi_f08, only : ompi_get_library_version_f
|
||||
implicit none
|
||||
character(len=MPI_MAX_PROCESSOR_NAME), intent(out) :: name
|
||||
character(len=MPI_MAX_LIBRARY_VERSION_STRING), intent(out) :: version
|
||||
integer, intent(out) :: resultlen
|
||||
integer, optional, intent(out) :: ierror
|
||||
integer :: c_ierror
|
||||
|
||||
call ompi_get_library_version_f(name,resultlen,c_ierror,len(name))
|
||||
call ompi_get_library_version_f(version,resultlen,c_ierror,len(version))
|
||||
if (present(ierror)) ierror = c_ierror
|
||||
|
||||
end subroutine MPI_Get_library_version_f08
|
||||
|
@ -1,20 +1,20 @@
|
||||
! -*- f90 -*-
|
||||
!
|
||||
! Copyright (c) 2010-2012 Cisco Systems, Inc. All rights reserved.
|
||||
! Copyright (c) 2010-2014 Cisco Systems, Inc. All rights reserved.
|
||||
! Copyright (c) 2010-2012 Los Alamos National Security, LLC.
|
||||
! All Rights reserved.
|
||||
! $COPYRIGHT$
|
||||
|
||||
subroutine PMPI_Get_library_version_f08(name,resultlen,ierror)
|
||||
use :: mpi_f08_types, only : MPI_MAX_PROCESSOR_NAME
|
||||
subroutine PMPI_Get_library_version_f08(version,resultlen,ierror)
|
||||
use :: mpi_f08_types, only : MPI_MAX_LIBRARY_VERSION_STRING
|
||||
use :: mpi_f08, only : ompi_get_library_version_f
|
||||
implicit none
|
||||
character(len=MPI_MAX_PROCESSOR_NAME), intent(out) :: name
|
||||
character(len=MPI_MAX_LIBRARY_VERSION_STRING), intent(out) :: version
|
||||
integer, intent(out) :: resultlen
|
||||
integer, optional, intent(out) :: ierror
|
||||
integer :: c_ierror
|
||||
|
||||
call ompi_get_library_version_f(name,resultlen,c_ierror,len(name))
|
||||
call ompi_get_library_version_f(version,resultlen,c_ierror,len(version))
|
||||
if (present(ierror)) ierror = c_ierror
|
||||
|
||||
end subroutine PMPI_Get_library_version_f08
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user