From 258d1aa1607a315068bcb05d5d8d07f213436369 Mon Sep 17 00:00:00 2001 From: Jeff Squyres Date: Wed, 24 Jun 2015 08:26:05 -0700 Subject: [PATCH] mpi-f08: corrections to new MPI_Aint_* subroutines (cherry picked from commit 8f252e65b02bfe20cacee0ece8c835246eea3bd9) --- ompi/mpi/fortran/use-mpi-f08/Makefile.am | 4 ++++ ompi/mpi/fortran/use-mpi-f08/aint_add_f08.F90 | 11 ++++++----- ompi/mpi/fortran/use-mpi-f08/aint_diff_f08.F90 | 9 +++++---- .../fortran/use-mpi-f08/mpi-f-interfaces-bind.h | 10 +++++----- .../fortran/use-mpi-f08/pmpi-f-interfaces-bind.h | 10 +++++----- .../fortran/use-mpi-f08/pmpi-f08-interfaces.F90 | 12 +++++------- .../fortran/use-mpi-f08/profile/paint_add_f08.F90 | 9 +++++---- .../use-mpi-f08/profile/paint_diff_f08.F90 | 15 ++++++++------- 8 files changed, 43 insertions(+), 37 deletions(-) diff --git a/ompi/mpi/fortran/use-mpi-f08/Makefile.am b/ompi/mpi/fortran/use-mpi-f08/Makefile.am index f5ed4c12d14..b46103827f0 100644 --- a/ompi/mpi/fortran/use-mpi-f08/Makefile.am +++ b/ompi/mpi/fortran/use-mpi-f08/Makefile.am @@ -92,6 +92,8 @@ mpi_api_files = \ add_error_class_f08.F90 \ add_error_code_f08.F90 \ add_error_string_f08.F90 \ + aint_add_f08.F90 \ + aint_diff_f08.F90 \ allgather_f08.F90 \ allgatherv_f08.F90 \ alloc_mem_f08.F90 \ @@ -444,6 +446,8 @@ pmpi_api_files = \ profile/padd_error_class_f08.F90 \ profile/padd_error_code_f08.F90 \ profile/padd_error_string_f08.F90 \ + profile/paint_add_f08.F90 \ + profile/paint_diff_f08.F90 \ profile/pallgather_f08.F90 \ profile/pallgatherv_f08.F90 \ profile/palloc_mem_f08.F90 \ diff --git a/ompi/mpi/fortran/use-mpi-f08/aint_add_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/aint_add_f08.F90 index bc6e1575bcb..afe3874d036 100644 --- a/ompi/mpi/fortran/use-mpi-f08/aint_add_f08.F90 +++ b/ompi/mpi/fortran/use-mpi-f08/aint_add_f08.F90 @@ -1,17 +1,18 @@ ! -*- f90 -*- ! -! Copyright (c) 2010-2014 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved. ! Copyright (c) 2009-2015 Los Alamos National Security, LLC. ! All Rights reserved. ! $COPYRIGHT$ #include "ompi/mpi/fortran/configure-fortran-output.h" -function MPI_Aint_add_f08(base,diff) +function MPI_Aint_add_f08(addr1, addr2) use :: mpi_f08_types, only : MPI_ADDRESS_KIND use :: mpi_f08, only : ompi_aint_add_f implicit none - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: base - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: diff - call ompi_aint_add_f (base, diff) + INTEGER(MPI_ADDRESS_KIND) :: MPI_Aint_add_f08 + INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: addr1 + INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: addr2 + MPI_Aint_add_f08 = ompi_aint_add_f(addr1, addr2) end function MPI_Aint_add_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/aint_diff_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/aint_diff_f08.F90 index ab5ee4e7fb3..97919f1da97 100644 --- a/ompi/mpi/fortran/use-mpi-f08/aint_diff_f08.F90 +++ b/ompi/mpi/fortran/use-mpi-f08/aint_diff_f08.F90 @@ -1,17 +1,18 @@ ! -*- f90 -*- ! -! Copyright (c) 2010-2014 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved. ! Copyright (c) 2009-2015 Los Alamos National Security, LLC. ! All Rights reserved. ! $COPYRIGHT$ #include "ompi/mpi/fortran/configure-fortran-output.h" -function MPI_Aint_diff_f08(addr1,addr2) +function MPI_Aint_diff_f08(addr1, addr2) use :: mpi_f08_types, only : MPI_ADDRESS_KIND - use :: mpi_f08, only ompi_aint_diff_f + use :: mpi_f08, only : ompi_aint_diff_f implicit none + INTEGER(MPI_ADDRESS_KIND) :: MPI_Aint_diff_f08 INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: addr1 INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: addr2 - call ompi_aint_diff_f (base, diff) + MPI_Aint_diff_f08 = ompi_aint_diff_f(addr1, addr2) end function MPI_Aint_diff_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/mpi-f-interfaces-bind.h b/ompi/mpi/fortran/use-mpi-f08/mpi-f-interfaces-bind.h index f98e80ae9df..dcfa4e4a513 100644 --- a/ompi/mpi/fortran/use-mpi-f08/mpi-f-interfaces-bind.h +++ b/ompi/mpi/fortran/use-mpi-f08/mpi-f-interfaces-bind.h @@ -1,6 +1,6 @@ ! -*- f90 -*- ! -! Copyright (c) 2009-2014 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved. ! Copyright (c) 2009-2012 Los Alamos National Security, LLC. ! All rights reserved. ! Copyright (c) 2012 The University of Tennessee and The University @@ -1780,23 +1780,23 @@ function ompi_wtime_f() & DOUBLE PRECISION :: ompi_wtime_f end function ompi_wtime_f -function ompi_aint_add_f(base,diff) & +function ompi_aint_add_f(base,diff) & BIND(C, name="ompi_aint_add_f") use :: mpi_f08_types, only : MPI_ADDRESS_KIND implicit none INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: base INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: diff INTEGER(MPI_ADDRESS_KIND) :: ompi_aint_add_f -end function ompi_aint_add_f +end function ompi_aint_add_f -function ompi_aint_diff_f(addr1,addr2) & +function ompi_aint_diff_f(addr1,addr2) & BIND(C, name="ompi_aint_diff_f") use :: mpi_f08_types, only : MPI_ADDRESS_KIND implicit none INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: addr1 INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: addr2 INTEGER(MPI_ADDRESS_KIND) :: ompi_aint_diff_f -end function ompi_aint_diff_f +end function ompi_aint_diff_f subroutine ompi_abort_f(comm,errorcode,ierror) & BIND(C, name="ompi_abort_f") diff --git a/ompi/mpi/fortran/use-mpi-f08/pmpi-f-interfaces-bind.h b/ompi/mpi/fortran/use-mpi-f08/pmpi-f-interfaces-bind.h index 0c2d606352f..c5310da3e55 100644 --- a/ompi/mpi/fortran/use-mpi-f08/pmpi-f-interfaces-bind.h +++ b/ompi/mpi/fortran/use-mpi-f08/pmpi-f-interfaces-bind.h @@ -1,6 +1,6 @@ ! -*- f90 -*- ! -! Copyright (c) 2009-2014 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved. ! Copyright (c) 2009-2012 Los Alamos National Security, LLC. ! All rights reserved. ! Copyright (c) 2012 The University of Tennessee and The University @@ -1615,23 +1615,23 @@ end subroutine pompi_topo_test_f ! DOUBLE PRECISION :: MPI_Wtime_f !end function MPI_Wtime_f -function pompi_aint_add_f(base,diff) & +function pompi_aint_add_f(base,diff) & BIND(C, name="pompi_aint_add_f") use :: mpi_f08_types, only : MPI_ADDRESS_KIND implicit none INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: base INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: diff INTEGER(MPI_ADDRESS_KIND) :: pompi_aint_add_f -end function pompi_aint_add_f +end function pompi_aint_add_f -function pompi_aint_diff_f(addr1,addr2) & +function pompi_aint_diff_f(addr1,addr2) & BIND(C, name="pompi_aint_diff_f") use :: mpi_f08_types, only : MPI_ADDRESS_KIND implicit none INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: addr1 INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: addr2 INTEGER(MPI_ADDRESS_KIND) :: pompi_aint_diff_f -end function pompi_aint_diff_f +end function pompi_aint_diff_f subroutine pompi_abort_f(comm,errorcode,ierror) & BIND(C, name="pompi_abort_f") diff --git a/ompi/mpi/fortran/use-mpi-f08/pmpi-f08-interfaces.F90 b/ompi/mpi/fortran/use-mpi-f08/pmpi-f08-interfaces.F90 index b8c1f1e54bf..a1ca4e91087 100644 --- a/ompi/mpi/fortran/use-mpi-f08/pmpi-f08-interfaces.F90 +++ b/ompi/mpi/fortran/use-mpi-f08/pmpi-f08-interfaces.F90 @@ -1,6 +1,6 @@ ! -*- f90 -*- ! -! Copyright (c) 2009-2014 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved. ! Copyright (c) 2009-2013 Los Alamos National Security, LLC. ! All rights reserved. ! Copyright (c) 2012 The University of Tennessee and The University @@ -2431,23 +2431,21 @@ end function PMPI_Wtime_f08 end interface PMPI_Wtime interface PMPI_Aint_add -function PMPI_Aint_add_f08(base,diff) +subroutine PMPI_Aint_add_f08(base,diff) use :: mpi_f08_types, only : MPI_ADDRESS_KIND implicit none INTEGER(MPI_ADDRESS_KIND) :: base INTEGER(MPI_ADDRESS_KIND) :: diff - INTEGER(MPI_ADDRESS_KIND) :: PMPI_Aint_add_f08 -end function PMPI_Aint_add_f08 +end subroutine PMPI_Aint_add_f08 end interface PMPI_Aint_add interface PMPI_Aint_diff -function PMPI_Aint_diff_f08(addr1,addr2) +subroutine PMPI_Aint_diff_f08(addr1,addr2) use :: mpi_f08_types, only : MPI_ADDRESS_KIND implicit none INTEGER(MPI_ADDRESS_KIND) :: addr1 INTEGER(MPI_ADDRESS_KIND) :: addr2 - INTEGER(MPI_ADDRESS_KIND) :: PMPI_Aint_diff_f08 -end function PMPI_Aint_diff_f08 +end subroutine PMPI_Aint_diff_f08 end interface PMPI_Aint_diff interface PMPI_Abort diff --git a/ompi/mpi/fortran/use-mpi-f08/profile/paint_add_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/profile/paint_add_f08.F90 index 9fbdd7af7ad..d07e786568e 100644 --- a/ompi/mpi/fortran/use-mpi-f08/profile/paint_add_f08.F90 +++ b/ompi/mpi/fortran/use-mpi-f08/profile/paint_add_f08.F90 @@ -1,17 +1,18 @@ ! -*- f90 -*- ! -! Copyright (c) 2010-2014 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved. ! Copyright (c) 2009-2015 Los Alamos National Security, LLC. ! All Rights reserved. ! $COPYRIGHT$ #include "ompi/mpi/fortran/configure-fortran-output.h" -function PMPI_Aint_add_f08(base,diff) +function PMPI_Aint_add_f08(base, diff) use :: mpi_f08_types, only : MPI_ADDRESS_KIND - use :: mpi_f08, only ompi_aint_add_f + use :: mpi_f08, only : ompi_aint_add_f implicit none + INTEGER(MPI_ADDRESS_KIND) :: PMPI_Aint_add_f08 INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: base INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: diff - call ompi_aint_add_f (base, diff) + PMPI_Aint_add_f08 = ompi_aint_add_f(base, diff) end function PMPI_Aint_add_f08 diff --git a/ompi/mpi/fortran/use-mpi-f08/profile/paint_diff_f08.F90 b/ompi/mpi/fortran/use-mpi-f08/profile/paint_diff_f08.F90 index 9fbdd7af7ad..0d46dee769b 100644 --- a/ompi/mpi/fortran/use-mpi-f08/profile/paint_diff_f08.F90 +++ b/ompi/mpi/fortran/use-mpi-f08/profile/paint_diff_f08.F90 @@ -1,17 +1,18 @@ ! -*- f90 -*- ! -! Copyright (c) 2010-2014 Cisco Systems, Inc. All rights reserved. +! Copyright (c) 2010-2015 Cisco Systems, Inc. All rights reserved. ! Copyright (c) 2009-2015 Los Alamos National Security, LLC. ! All Rights reserved. ! $COPYRIGHT$ #include "ompi/mpi/fortran/configure-fortran-output.h" -function PMPI_Aint_add_f08(base,diff) +function PMPI_Aint_diff_f08(addr1, addr2) use :: mpi_f08_types, only : MPI_ADDRESS_KIND - use :: mpi_f08, only ompi_aint_add_f + use :: mpi_f08, only : ompi_aint_diff_f implicit none - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: base - INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: diff - call ompi_aint_add_f (base, diff) -end function PMPI_Aint_add_f08 + INTEGER(MPI_ADDRESS_KIND) :: PMPI_Aint_diff_f08 + INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: addr1 + INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: addr2 + PMPI_Aint_diff_f08 = ompi_aint_diff_f(addr1, addr2) +end function PMPI_Aint_diff_f08