From 558d34a5c346a9f1aae8af24f0474c5eeb6df298 Mon Sep 17 00:00:00 2001
From: Gilles Gouaillardet <gilles@rist.or.jp>
Date: Tue, 2 Jun 2015 17:45:02 +0900
Subject: [PATCH] MPI_Win_{get,set}_info : add Fortran bindings

---
 ompi/mpi/fortran/mpif-h/Makefile.am           |  2 +
 ompi/mpi/fortran/mpif-h/profile/Makefile.am   |  2 +
 ompi/mpi/fortran/mpif-h/profile/defines.h     |  2 +
 ompi/mpi/fortran/mpif-h/prototypes_mpi.h      |  2 +
 ompi/mpi/fortran/use-mpi-f08/Makefile.am      |  2 +
 .../use-mpi-f08/mpi-f-interfaces-bind.h       | 16 +++++
 .../use-mpi-f08/mpi-f08-interfaces.F90        | 20 ++++++
 .../mpi-ignore-tkr-interfaces.h.in            | 69 +++++++++++++++++++
 8 files changed, 115 insertions(+)

diff --git a/ompi/mpi/fortran/mpif-h/Makefile.am b/ompi/mpi/fortran/mpif-h/Makefile.am
index 0730538fce..d14985e821 100644
--- a/ompi/mpi/fortran/mpif-h/Makefile.am
+++ b/ompi/mpi/fortran/mpif-h/Makefile.am
@@ -408,12 +408,14 @@ libmpi_mpifh_la_SOURCES += \
         win_get_attr_f.c \
         win_get_errhandler_f.c \
         win_get_group_f.c \
+        win_get_info_f.c \
         win_get_name_f.c \
         win_lock_f.c \
         win_lock_all_f.c \
         win_post_f.c \
         win_set_attr_f.c \
         win_set_errhandler_f.c \
+        win_set_info_f.c \
         win_set_name_f.c \
         win_shared_query_f.c \
         win_start_f.c \
diff --git a/ompi/mpi/fortran/mpif-h/profile/Makefile.am b/ompi/mpi/fortran/mpif-h/profile/Makefile.am
index 7802d6ca23..39b5a33232 100644
--- a/ompi/mpi/fortran/mpif-h/profile/Makefile.am
+++ b/ompi/mpi/fortran/mpif-h/profile/Makefile.am
@@ -333,12 +333,14 @@ linked_files = \
         pwin_get_attr_f.c \
         pwin_get_errhandler_f.c \
         pwin_get_group_f.c \
+        pwin_get_info_f.c \
         pwin_get_name_f.c \
         pwin_lock_f.c \
         pwin_lock_all_f.c \
         pwin_post_f.c \
         pwin_set_attr_f.c \
         pwin_set_errhandler_f.c \
+        pwin_set_info_f.c \
         pwin_set_name_f.c \
         pwin_shared_query_f.c \
         pwin_start_f.c \
diff --git a/ompi/mpi/fortran/mpif-h/profile/defines.h b/ompi/mpi/fortran/mpif-h/profile/defines.h
index 60dcaff84e..579ae0d569 100644
--- a/ompi/mpi/fortran/mpif-h/profile/defines.h
+++ b/ompi/mpi/fortran/mpif-h/profile/defines.h
@@ -367,12 +367,14 @@
 #define ompi_win_get_attr_f pompi_win_get_attr_f
 #define ompi_win_get_errhandler_f pompi_win_get_errhandler_f
 #define ompi_win_get_group_f pompi_win_get_group_f
+#define ompi_win_get_info_f pompi_win_get_info_f
 #define ompi_win_get_name_f pompi_win_get_name_f
 #define ompi_win_lock_f pompi_win_lock_f
 #define ompi_win_lock_all_f pompi_win_lock_all_f
 #define ompi_win_post_f pompi_win_post_f
 #define ompi_win_set_attr_f pompi_win_set_attr_f
 #define ompi_win_set_errhandler_f pompi_win_set_errhandler_f
+#define ompi_win_set_info_f pompi_win_set_info_f
 #define ompi_win_set_name_f pompi_win_set_name_f
 #define ompi_win_shared_query_f pompi_win_shared_query_f
 #define ompi_win_shared_query_cptr_f pompi_win_shared_query_cptr_f
diff --git a/ompi/mpi/fortran/mpif-h/prototypes_mpi.h b/ompi/mpi/fortran/mpif-h/prototypes_mpi.h
index f4f3fa1229..2c68dac550 100644
--- a/ompi/mpi/fortran/mpif-h/prototypes_mpi.h
+++ b/ompi/mpi/fortran/mpif-h/prototypes_mpi.h
@@ -424,12 +424,14 @@ PN2(void, MPI_Win_free_keyval, mpi_win_free_keyval, MPI_WIN_FREE_KEYVAL, (MPI_Fi
 PN2(void, MPI_Win_get_attr, mpi_win_get_attr, MPI_WIN_GET_ATTR, (MPI_Fint *win, MPI_Fint *win_keyval, MPI_Aint *attribute_val, ompi_fortran_logical_t *flag, MPI_Fint *ierr));
 PN2(void, MPI_Win_get_errhandler, mpi_win_get_errhandler, MPI_WIN_GET_ERRHANDLER, (MPI_Fint *win, MPI_Fint *errhandler, MPI_Fint *ierr));
 PN2(void, MPI_Win_get_group, mpi_win_get_group, MPI_WIN_GET_GROUP, (MPI_Fint *win, MPI_Fint *group, MPI_Fint *ierr));
+PN2(void, MPI_Win_get_info, mpi_win_get_info, MPI_WIN_GET_INFO, (MPI_Fint *win, MPI_Fint *info, MPI_Fint *ierr));
 PN2(void, MPI_Win_get_name, mpi_win_get_name, MPI_WIN_GET_NAME, (MPI_Fint *win, char *win_name, MPI_Fint *resultlen, MPI_Fint *ierr, int name_len));
 PN2(void, MPI_Win_lock, mpi_win_lock, MPI_WIN_LOCK, (MPI_Fint *lock_type, MPI_Fint *rank, MPI_Fint *assert, MPI_Fint *win, MPI_Fint *ierr));
 PN2(void, MPI_Win_lock_all, mpi_win_lock_all, MPI_WIN_LOCK_ALL, (MPI_Fint *assert, MPI_Fint *win, MPI_Fint *ierr));
 PN2(void, MPI_Win_post, mpi_win_post, MPI_WIN_POST, (MPI_Fint *group, MPI_Fint *assert, MPI_Fint *win, MPI_Fint *ierr));
 PN2(void, MPI_Win_set_attr, mpi_win_set_attr, MPI_WIN_SET_ATTR, (MPI_Fint *win, MPI_Fint *win_keyval, MPI_Aint *attribute_val, MPI_Fint *ierr));
 PN2(void, MPI_Win_set_errhandler, mpi_win_set_errhandler, MPI_WIN_SET_ERRHANDLER, (MPI_Fint *win, MPI_Fint *errhandler, MPI_Fint *ierr));
+PN2(void, MPI_Win_set_info, mpi_win_set_info, MPI_WIN_SET_INFO, (MPI_Fint *win, MPI_Fint *info, MPI_Fint *ierr));
 PN2(void, MPI_Win_set_name, mpi_win_set_name, MPI_WIN_SET_NAME, (MPI_Fint *win, char *win_name, MPI_Fint *ierr, int name_len));
 PN2(void, MPI_Win_shared_query, mpi_win_shared_query, MPI_WIN_SHARED_QUERY, (MPI_Fint *win, MPI_Fint *rank, MPI_Aint *size, MPI_Fint *disp_unit, char *baseptr, MPI_Fint *ierr));
 PN2(void, MPI_Win_shared_query_cptr, mpi_win_shared_query_cptr, MPI_WIN_SHARED_QUERY_CPTR, (MPI_Fint *win, MPI_Fint *rank, MPI_Aint *size, MPI_Fint *disp_unit, char *baseptr, MPI_Fint *ierr));
diff --git a/ompi/mpi/fortran/use-mpi-f08/Makefile.am b/ompi/mpi/fortran/use-mpi-f08/Makefile.am
index 530f2a4427..f5ed4c12d1 100644
--- a/ompi/mpi/fortran/use-mpi-f08/Makefile.am
+++ b/ompi/mpi/fortran/use-mpi-f08/Makefile.am
@@ -356,12 +356,14 @@ mpi_api_files = \
         win_get_attr_f08.F90 \
         win_get_errhandler_f08.F90 \
         win_get_group_f08.F90 \
+        win_get_info_f08.F90 \
         win_get_name_f08.F90 \
         win_lock_f08.F90 \
         win_lock_all_f08.F90 \
         win_post_f08.F90 \
         win_set_attr_f08.F90 \
         win_set_errhandler_f08.F90 \
+        win_set_info_f08.F90 \
         win_set_name_f08.F90 \
         win_shared_query_f08.F90 \
         win_start_f08.F90 \
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 72ca46a777..a692e6055b 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
@@ -2452,6 +2452,14 @@ subroutine ompi_win_get_group_f(win,group,ierror) &
    INTEGER, INTENT(OUT) :: ierror
 end subroutine ompi_win_get_group_f
 
+subroutine ompi_win_get_info_f(comm,info,ierror) &
+   BIND(C, name="ompi_win_get_info_f")
+   implicit none
+   INTEGER, INTENT(IN) :: comm
+   INTEGER, INTENT(OUT) :: info
+   INTEGER, INTENT(OUT) :: ierror
+end subroutine ompi_win_get_info_f
+
 subroutine ompi_win_lock_f(lock_type,rank,assert,win,ierror) &
    BIND(C, name="ompi_win_lock_f")
    implicit none
@@ -2477,6 +2485,14 @@ subroutine ompi_win_post_f(group,assert,win,ierror) &
    INTEGER, INTENT(OUT) :: ierror
 end subroutine ompi_win_post_f
 
+subroutine ompi_win_set_info_f(comm,info,ierror) &
+   BIND(C, name="ompi_win_set_info_f")
+   implicit none
+   INTEGER, INTENT(IN) :: comm
+   INTEGER, INTENT(IN) :: info
+   INTEGER, INTENT(OUT) :: ierror
+end subroutine ompi_win_set_info_f
+
 subroutine ompi_win_shared_query_f(win, rank, size, disp_unit, baseptr,&
       ierror) BIND(C, name="ompi_win_shared_query_f")
   USE, INTRINSIC ::  ISO_C_BINDING, ONLY : C_PTR
diff --git a/ompi/mpi/fortran/use-mpi-f08/mpi-f08-interfaces.F90 b/ompi/mpi/fortran/use-mpi-f08/mpi-f08-interfaces.F90
index fa29834411..1cabdff5f2 100644
--- a/ompi/mpi/fortran/use-mpi-f08/mpi-f08-interfaces.F90
+++ b/ompi/mpi/fortran/use-mpi-f08/mpi-f08-interfaces.F90
@@ -2180,6 +2180,16 @@ subroutine MPI_Win_get_attr_f08(win,win_keyval,attribute_val,flag,ierror)
 end subroutine MPI_Win_get_attr_f08
 end interface  MPI_Win_get_attr
 
+interface  MPI_Win_get_info
+subroutine MPI_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 MPI_Win_get_info_f08
+end interface  MPI_Win_get_info
+
 interface  MPI_Win_get_name
 subroutine MPI_Win_get_name_f08(win,win_name,resultlen,ierror)
    use :: mpi_f08_types, only : MPI_Win, MPI_MAX_OBJECT_NAME
@@ -2202,6 +2212,16 @@ subroutine MPI_Win_set_attr_f08(win,win_keyval,attribute_val,ierror)
 end subroutine MPI_Win_set_attr_f08
 end interface  MPI_Win_set_attr
 
+interface  MPI_Win_set_info
+subroutine MPI_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 MPI_Win_set_info_f08
+end interface  MPI_Win_set_info
+
 interface  MPI_Win_set_name
 subroutine MPI_Win_set_name_f08(win,win_name,ierror)
    use :: mpi_f08_types, only : MPI_Win
diff --git a/ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-interfaces.h.in b/ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-interfaces.h.in
index 9f1abc3a3b..16433d793a 100644
--- a/ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-interfaces.h.in
+++ b/ompi/mpi/fortran/use-mpi-ignore-tkr/mpi-ignore-tkr-interfaces.h.in
@@ -1465,6 +1465,29 @@ end subroutine PMPI_Comm_set_errhandler
 end interface
 
 
+interface MPI_Comm_set_info
+
+subroutine MPI_Comm_set_info(comm, info, ierror)
+  include 'mpif-config.h'
+  integer, intent(in) :: comm
+  integer, intent(in) :: info
+  integer, intent(out) :: ierror
+end subroutine MPI_Comm_set_info
+
+end interface
+
+interface PMPI_Comm_set_info
+
+subroutine PMPI_Comm_set_info(comm, info, ierror)
+  include 'mpif-config.h'
+  integer, intent(in) :: comm
+  integer, intent(in) :: info
+  integer, intent(out) :: ierror
+end subroutine PMPI_Comm_set_info
+
+end interface
+
+
 interface MPI_Comm_set_name
 
 subroutine MPI_Comm_set_name(comm, comm_name, ierror)
@@ -7742,6 +7765,29 @@ end subroutine PMPI_Win_get_group
 end interface
 
 
+interface MPI_Win_get_info
+
+subroutine MPI_Win_get_info(comm, info, ierror)
+  include 'mpif-config.h'
+  integer, intent(in) :: comm
+  integer, intent(in) :: info
+  integer, intent(out) :: ierror
+end subroutine MPI_Win_get_info
+
+end interface
+
+interface PMPI_Win_get_info
+
+subroutine PMPI_Win_get_info(comm, info, ierror)
+  include 'mpif-config.h'
+  integer, intent(in) :: comm
+  integer, intent(in) :: info
+  integer, intent(out) :: ierror
+end subroutine PMPI_Win_get_info
+
+end interface
+
+
 interface MPI_Win_get_name
 
 subroutine MPI_Win_get_name(win, win_name, resultlen, ierror)
@@ -7859,6 +7905,29 @@ end subroutine PMPI_Win_set_errhandler
 end interface
 
 
+interface MPI_Win_set_info
+
+subroutine MPI_Win_set_info(comm, info, ierror)
+  include 'mpif-config.h'
+  integer, intent(in) :: comm
+  integer, intent(in) :: info
+  integer, intent(out) :: ierror
+end subroutine MPI_Win_set_info
+
+end interface
+
+interface PMPI_Win_set_info
+
+subroutine PMPI_Win_set_info(comm, info, ierror)
+  include 'mpif-config.h'
+  integer, intent(in) :: comm
+  integer, intent(in) :: info
+  integer, intent(out) :: ierror
+end subroutine PMPI_Win_set_info
+
+end interface
+
+
 interface MPI_Win_set_name
 
 subroutine MPI_Win_set_name(win, win_name, ierror)