1
1

mpi_f08: pass function pointers from Fortran to C properly

Use type(c_funptr) to "cast" the fortran function pointers to
arbitrary C pointers.  In C, we then pick up the appropriate function
pointer type.

Tested with ifort 14.0.2 and gfortran 4.9 snapshot (which is what
identified that the previous method of passing function pointers was
not Fortran'08-compliant).

Refs trac:4157

This commit was SVN r31371.

The following Trac tickets were found above:
  Ticket 4157 --> https://svn.open-mpi.org/trac/ompi/ticket/4157
Этот коммит содержится в:
Jeff Squyres 2014-04-11 20:56:11 +00:00
родитель 7853f82567
Коммит 65b95e2844
18 изменённых файлов: 127 добавлений и 76 удалений

Просмотреть файл

@ -8,6 +8,7 @@
#include "ompi/mpi/fortran/configure-fortran-output.h"
subroutine MPI_Comm_create_errhandler_f08(comm_errhandler_fn,errhandler,ierror)
use, intrinsic :: iso_c_binding, only: c_funptr, c_funloc
use :: mpi_f08_types, only : MPI_Errhandler
use :: mpi_f08_interfaces_callbacks, only : MPI_Comm_errhandler_function
use :: mpi_f08, only : ompi_comm_create_errhandler_f
@ -16,8 +17,10 @@ subroutine MPI_Comm_create_errhandler_f08(comm_errhandler_fn,errhandler,ierror)
TYPE(MPI_Errhandler), INTENT(OUT) :: errhandler
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
type(c_funptr) :: fn
call ompi_comm_create_errhandler_f(comm_errhandler_fn,errhandler%MPI_VAL,c_ierror)
fn = c_funloc(comm_errhandler_fn)
call ompi_comm_create_errhandler_f(fn,errhandler%MPI_VAL,c_ierror)
if (present(ierror)) ierror = c_ierror
end subroutine MPI_Comm_create_errhandler_f08

Просмотреть файл

@ -9,6 +9,8 @@
subroutine MPI_Comm_create_keyval_f08(comm_copy_attr_fn,comm_delete_attr_fn,&
comm_keyval,extra_state,ierror)
use, intrinsic :: iso_c_binding, only: c_funptr, c_funloc
use :: mpi_f08_interfaces_callbacks, only : MPI_User_function
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
use :: mpi_f08_interfaces_callbacks, only : MPI_Comm_copy_attr_function
use :: mpi_f08_interfaces_callbacks, only : MPI_Comm_delete_attr_function
@ -20,8 +22,11 @@ subroutine MPI_Comm_create_keyval_f08(comm_copy_attr_fn,comm_delete_attr_fn,&
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: extra_state
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
type(c_funptr) :: fcopy_fn, fdelete_fn
call ompi_comm_create_keyval_f(comm_copy_attr_fn,comm_delete_attr_fn,&
fcopy_fn = c_funloc(comm_copy_attr_fn)
fdelete_fn = c_funloc(comm_delete_attr_fn)
call ompi_comm_create_keyval_f(fcopy_fn,fdelete_fn,&
comm_keyval,extra_state,c_ierror)
if (present(ierror)) ierror = c_ierror

Просмотреть файл

@ -8,6 +8,7 @@
#include "ompi/mpi/fortran/configure-fortran-output.h"
subroutine MPI_File_create_errhandler_f08(file_errhandler_fn,errhandler,ierror)
use, intrinsic :: iso_c_binding, only: c_funptr, c_funloc
use :: mpi_f08_types, only : MPI_Errhandler
use :: mpi_f08_interfaces_callbacks, only : MPI_File_errhandler_function
use :: mpi_f08, only : ompi_file_create_errhandler_f
@ -16,8 +17,10 @@ subroutine MPI_File_create_errhandler_f08(file_errhandler_fn,errhandler,ierror)
TYPE(MPI_Errhandler), INTENT(OUT) :: errhandler
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
type(c_funptr) :: fn
call ompi_file_create_errhandler_f(file_errhandler_fn,errhandler%MPI_VAL,c_ierror)
fn = c_funloc(file_errhandler_fn)
call ompi_file_create_errhandler_f(fn,errhandler%MPI_VAL,c_ierror)
if (present(ierror)) ierror = c_ierror
end subroutine MPI_File_create_errhandler_f08

Просмотреть файл

@ -9,6 +9,7 @@
subroutine MPI_Grequest_start_f08(query_fn,free_fn,cancel_fn,&
extra_state,request,ierror)
use, intrinsic :: iso_c_binding, only: c_funptr, c_funloc
use :: mpi_f08_types, only : MPI_Request, MPI_ADDRESS_KIND
use :: mpi_f08_interfaces_callbacks, only : MPI_Grequest_query_function
use :: mpi_f08_interfaces_callbacks, only : MPI_Grequest_free_function
@ -22,8 +23,12 @@ subroutine MPI_Grequest_start_f08(query_fn,free_fn,cancel_fn,&
TYPE(MPI_Request), INTENT(OUT) :: request
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
type(c_funptr) :: fquery_fn, ffree_fn, fcancel_fn
call ompi_grequest_start_f(query_fn,free_fn,cancel_fn,&
fquery_fn = c_funloc(query_fn)
ffree_fn = c_funloc(free_fn)
fcancel_fn = c_funloc(cancel_fn)
call ompi_grequest_start_f(fquery_fn,ffree_fn,fcancel_fn,&
extra_state,request%MPI_VAL,c_ierror)
if (present(ierror)) ierror = c_ierror

Просмотреть файл

@ -1243,11 +1243,10 @@ subroutine ompi_comm_create_keyval_f(comm_copy_attr_fn,comm_delete_attr_fn, &
comm_keyval,extra_state,ierror) &
BIND(C, name="ompi_comm_create_keyval_f")
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
use :: mpi_f08_interfaces_callbacks, only : MPI_Comm_copy_attr_function
use :: mpi_f08_interfaces_callbacks, only : MPI_Comm_delete_attr_function
use, intrinsic :: iso_c_binding, only: c_funptr
implicit none
OMPI_PROCEDURE(MPI_Comm_copy_attr_function) :: comm_copy_attr_fn
OMPI_PROCEDURE(MPI_Comm_delete_attr_function) :: comm_delete_attr_fn
type(c_funptr), value :: comm_copy_attr_fn
type(c_funptr), value :: comm_delete_attr_fn
INTEGER, INTENT(OUT) :: comm_keyval
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: extra_state
INTEGER, INTENT(OUT) :: ierror
@ -1519,11 +1518,10 @@ subroutine ompi_type_create_keyval_f(type_copy_attr_fn,type_delete_attr_fn, &
type_keyval,extra_state,ierror) &
BIND(C, name="ompi_type_create_keyval_f")
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
use :: mpi_f08_interfaces_callbacks, only : MPI_Type_copy_attr_function
use :: mpi_f08_interfaces_callbacks, only : MPI_Type_delete_attr_function
use, intrinsic :: iso_c_binding, only: c_funptr
implicit none
OMPI_PROCEDURE(MPI_Type_copy_attr_function) :: type_copy_attr_fn
OMPI_PROCEDURE(MPI_Type_delete_attr_function) :: type_delete_attr_fn
type(c_funptr), value :: type_copy_attr_fn
type(c_funptr), value :: type_delete_attr_fn
INTEGER, INTENT(OUT) :: type_keyval
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: extra_state
INTEGER, INTENT(OUT) :: ierror
@ -1579,11 +1577,10 @@ subroutine ompi_win_create_keyval_f(win_copy_attr_fn,win_delete_attr_fn, &
win_keyval,extra_state,ierror) &
BIND(C, name="ompi_win_create_keyval_f")
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
use :: mpi_f08_interfaces_callbacks, only : MPI_Win_copy_attr_function
use :: mpi_f08_interfaces_callbacks, only : MPI_Win_delete_attr_function
use, intrinsic :: iso_c_binding, only: c_funptr
implicit none
OMPI_PROCEDURE(MPI_Win_copy_attr_function) :: win_copy_attr_fn
OMPI_PROCEDURE(MPI_Win_delete_attr_function) :: win_delete_attr_fn
type(c_funptr), value :: win_copy_attr_fn
type(c_funptr), value :: win_delete_attr_fn
INTEGER, INTENT(OUT) :: win_keyval
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: extra_state
INTEGER, INTENT(OUT) :: ierror
@ -1809,9 +1806,9 @@ end subroutine ompi_comm_call_errhandler_f
subroutine ompi_comm_create_errhandler_f(comm_errhandler_fn,errhandler,ierror) &
BIND(C, name="ompi_comm_create_errhandler_f")
use :: mpi_f08_interfaces_callbacks, only : MPI_Comm_errhandler_function
use, intrinsic :: iso_c_binding, only: c_funptr
implicit none
OMPI_PROCEDURE(MPI_Comm_errhandler_function) :: comm_errhandler_fn
type(c_funptr), value :: comm_errhandler_fn
INTEGER, INTENT(OUT) :: errhandler
INTEGER, INTENT(OUT) :: ierror
end subroutine ompi_comm_create_errhandler_f
@ -1870,9 +1867,9 @@ end subroutine ompi_file_call_errhandler_f
subroutine ompi_file_create_errhandler_f(file_errhandler_fn,errhandler,ierror) &
BIND(C, name="ompi_file_create_errhandler_f")
use :: mpi_f08_interfaces_callbacks, only : MPI_File_errhandler_function
use, intrinsic :: iso_c_binding, only: c_funptr
implicit none
OMPI_PROCEDURE(MPI_File_errhandler_function) :: file_errhandler_fn
type(c_funptr), value :: file_errhandler_fn
INTEGER, INTENT(OUT) :: errhandler
INTEGER, INTENT(OUT) :: ierror
end subroutine ompi_file_create_errhandler_f
@ -1943,9 +1940,9 @@ end subroutine ompi_win_call_errhandler_f
subroutine ompi_win_create_errhandler_f(win_errhandler_fn,errhandler,ierror) &
BIND(C, name="ompi_win_create_errhandler_f")
use :: mpi_f08_interfaces_callbacks, only : MPI_Win_errhandler_function
use, intrinsic :: iso_c_binding, only: c_funptr
implicit none
OMPI_PROCEDURE(MPI_Win_errhandler_function) :: win_errhandler_fn
type(c_funptr), value :: win_errhandler_fn
INTEGER, INTENT(OUT) :: errhandler
INTEGER, INTENT(OUT) :: ierror
end subroutine ompi_win_create_errhandler_f
@ -2451,13 +2448,11 @@ subroutine ompi_grequest_start_f(query_fn,free_fn,cancel_fn, &
extra_state,request,ierror) &
BIND(C, name="ompi_grequest_start_f")
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
use :: mpi_f08_interfaces_callbacks, only : MPI_Grequest_query_function
use :: mpi_f08_interfaces_callbacks, only : MPI_Grequest_free_function
use :: mpi_f08_interfaces_callbacks, only : MPI_Grequest_cancel_function
use, intrinsic :: iso_c_binding, only: c_funptr
implicit none
OMPI_PROCEDURE(MPI_Grequest_query_function) :: query_fn
OMPI_PROCEDURE(MPI_Grequest_free_function) :: free_fn
OMPI_PROCEDURE(MPI_Grequest_cancel_function) :: cancel_fn
type(c_funptr), value :: query_fn
type(c_funptr), value :: free_fn
type(c_funptr), value :: cancel_fn
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: extra_state
INTEGER, INTENT(OUT) :: request
INTEGER, INTENT(OUT) :: ierror
@ -3034,12 +3029,11 @@ subroutine ompi_register_datarep_f(datarep,read_conversion_fn, &
BIND(C, name="ompi_register_datarep_f")
use, intrinsic :: ISO_C_BINDING, only : C_CHAR
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
use :: mpi_f08_interfaces_callbacks, only : MPI_Datarep_conversion_function
use :: mpi_f08_interfaces_callbacks, only : MPI_Datarep_extent_function
use, intrinsic :: iso_c_binding, only: c_funptr
implicit none
OMPI_PROCEDURE(MPI_Datarep_conversion_function) :: read_conversion_fn
OMPI_PROCEDURE(MPI_Datarep_conversion_function) :: write_conversion_fn
OMPI_PROCEDURE(MPI_Datarep_extent_function) :: dtype_file_extent_fn
type(c_funptr), value :: read_conversion_fn
type(c_funptr), value :: write_conversion_fn
type(c_funptr), value :: dtype_file_extent_fn
CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: datarep
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: extra_state
INTEGER, INTENT(OUT) :: ierror

Просмотреть файл

@ -1111,11 +1111,10 @@ subroutine pompi_comm_create_keyval_f(comm_copy_attr_fn,comm_delete_attr_fn, &
comm_keyval,extra_state,ierror) &
BIND(C, name="pompi_comm_create_keyval_f")
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
use :: mpi_f08_interfaces_callbacks, only : MPI_Comm_copy_attr_function
use :: mpi_f08_interfaces_callbacks, only : MPI_Comm_delete_attr_function
use, intrinsic :: iso_c_binding, only: c_funptr
implicit none
OMPI_PROCEDURE(MPI_Comm_copy_attr_function) :: comm_copy_attr_fn
OMPI_PROCEDURE(MPI_Comm_delete_attr_function) :: comm_delete_attr_fn
type(c_funptr) :: comm_copy_attr_fn
type(c_funptr) :: comm_delete_attr_fn
INTEGER, INTENT(OUT) :: comm_keyval
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: extra_state
INTEGER, INTENT(OUT) :: ierror
@ -1353,11 +1352,10 @@ subroutine pompi_type_create_keyval_f(type_copy_attr_fn,type_delete_attr_fn, &
type_keyval,extra_state,ierror) &
BIND(C, name="pompi_type_create_keyval_f")
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
use :: mpi_f08_interfaces_callbacks, only : MPI_Type_copy_attr_function
use :: mpi_f08_interfaces_callbacks, only : MPI_Type_delete_attr_function
use, intrinsic :: iso_c_binding, only: c_funptr
implicit none
OMPI_PROCEDURE(MPI_Type_copy_attr_function) :: type_copy_attr_fn
OMPI_PROCEDURE(MPI_Type_delete_attr_function) :: type_delete_attr_fn
type(c_funptr) :: type_copy_attr_fn
type(c_funptr) :: type_delete_attr_fn
INTEGER, INTENT(OUT) :: type_keyval
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: extra_state
INTEGER, INTENT(OUT) :: ierror
@ -1413,11 +1411,10 @@ subroutine pompi_win_create_keyval_f(win_copy_attr_fn,win_delete_attr_fn, &
win_keyval,extra_state,ierror) &
BIND(C, name="pompi_win_create_keyval_f")
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
use :: mpi_f08_interfaces_callbacks, only : MPI_Win_copy_attr_function
use :: mpi_f08_interfaces_callbacks, only : MPI_Win_delete_attr_function
use, intrinsic :: iso_c_binding, only: c_funptr
implicit none
OMPI_PROCEDURE(MPI_Win_copy_attr_function) :: win_copy_attr_fn
OMPI_PROCEDURE(MPI_Win_delete_attr_function) :: win_delete_attr_fn
type(c_funptr) :: win_copy_attr_fn
type(c_funptr) :: win_delete_attr_fn
INTEGER, INTENT(OUT) :: win_keyval
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: extra_state
INTEGER, INTENT(OUT) :: ierror
@ -1646,9 +1643,9 @@ end subroutine pompi_comm_call_errhandler_f
subroutine pompi_comm_create_errhandler_f(comm_errhandler_fn,errhandler,ierror) &
BIND(C, name="pompi_comm_create_errhandler_f")
use :: mpi_f08_interfaces_callbacks, only : MPI_Comm_errhandler_function
use, intrinsic :: iso_c_binding, only: c_funptr
implicit none
OMPI_PROCEDURE(MPI_Comm_errhandler_function) :: comm_errhandler_fn
type(c_funptr) :: comm_errhandler_fn
INTEGER, INTENT(OUT) :: errhandler
INTEGER, INTENT(OUT) :: ierror
end subroutine pompi_comm_create_errhandler_f
@ -1707,9 +1704,9 @@ end subroutine pompi_file_call_errhandler_f
subroutine pompi_file_create_errhandler_f(file_errhandler_fn,errhandler,ierror) &
BIND(C, name="pompi_file_create_errhandler_f")
use :: mpi_f08_interfaces_callbacks, only : MPI_File_errhandler_function
use, intrinsic :: iso_c_binding, only: c_funptr
implicit none
OMPI_PROCEDURE(MPI_File_errhandler_function) :: file_errhandler_fn
type(c_funptr) :: file_errhandler_fn
INTEGER, INTENT(OUT) :: errhandler
INTEGER, INTENT(OUT) :: ierror
end subroutine pompi_file_create_errhandler_f
@ -1780,9 +1777,9 @@ end subroutine pompi_win_call_errhandler_f
subroutine pompi_win_create_errhandler_f(win_errhandler_fn,errhandler,ierror) &
BIND(C, name="pompi_win_create_errhandler_f")
use :: mpi_f08_interfaces_callbacks, only : MPI_Win_errhandler_function
use, intrinsic :: iso_c_binding, only: c_funptr
implicit none
OMPI_PROCEDURE(MPI_Win_errhandler_function) :: win_errhandler_fn
type(c_funptr) :: win_errhandler_fn
INTEGER, INTENT(OUT) :: errhandler
INTEGER, INTENT(OUT) :: ierror
end subroutine pompi_win_create_errhandler_f
@ -2288,13 +2285,11 @@ subroutine pompi_grequest_start_f(query_fn,free_fn,cancel_fn, &
extra_state,request,ierror) &
BIND(C, name="pompi_grequest_start_f")
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
use :: mpi_f08_interfaces_callbacks, only : MPI_Grequest_query_function
use :: mpi_f08_interfaces_callbacks, only : MPI_Grequest_free_function
use :: mpi_f08_interfaces_callbacks, only : MPI_Grequest_cancel_function
use, intrinsic :: iso_c_binding, only: c_funptr
implicit none
OMPI_PROCEDURE(MPI_Grequest_query_function) :: query_fn
OMPI_PROCEDURE(MPI_Grequest_free_function) :: free_fn
OMPI_PROCEDURE(MPI_Grequest_cancel_function) :: cancel_fn
type(c_funptr) :: query_fn
type(c_funptr) :: free_fn
type(c_funptr) :: cancel_fn
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: extra_state
INTEGER, INTENT(OUT) :: request
INTEGER, INTENT(OUT) :: ierror
@ -2861,12 +2856,11 @@ subroutine pompi_register_datarep_f(datarep,read_conversion_fn, &
BIND(C, name="pompi_register_datarep_f")
use, intrinsic :: ISO_C_BINDING, only : C_CHAR
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
use :: mpi_f08_interfaces_callbacks, only : MPI_Datarep_conversion_function
use :: mpi_f08_interfaces_callbacks, only : MPI_Datarep_extent_function
use, intrinsic :: iso_c_binding, only: c_funptr
implicit none
OMPI_PROCEDURE(MPI_Datarep_conversion_function) :: read_conversion_fn
OMPI_PROCEDURE(MPI_Datarep_conversion_function) :: write_conversion_fn
OMPI_PROCEDURE(MPI_Datarep_extent_function) :: dtype_file_extent_fn
type(c_funptr) :: read_conversion_fn
type(c_funptr) :: write_conversion_fn
type(c_funptr) :: dtype_file_extent_fn
CHARACTER(KIND=C_CHAR), DIMENSION(*), INTENT(IN) :: datarep
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: extra_state
INTEGER, INTENT(OUT) :: ierror

Просмотреть файл

@ -8,6 +8,7 @@
#include "ompi/mpi/fortran/configure-fortran-output.h"
subroutine PMPI_Comm_create_errhandler_f08(comm_errhandler_fn,errhandler,ierror)
use, intrinsic :: iso_c_binding, only: c_funptr, c_funloc
use :: mpi_f08_types, only : MPI_Errhandler
use :: mpi_f08_interfaces_callbacks, only : MPI_Comm_errhandler_function
use :: mpi_f08, only : ompi_comm_create_errhandler_f
@ -16,8 +17,10 @@ subroutine PMPI_Comm_create_errhandler_f08(comm_errhandler_fn,errhandler,ierror)
TYPE(MPI_Errhandler), INTENT(OUT) :: errhandler
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
type(c_funptr) :: fn
call ompi_comm_create_errhandler_f(comm_errhandler_fn,errhandler%MPI_VAL,c_ierror)
fn = c_funloc(comm_errhandler_fn)
call ompi_comm_create_errhandler_f(fn,errhandler%MPI_VAL,c_ierror)
if (present(ierror)) ierror = c_ierror
end subroutine PMPI_Comm_create_errhandler_f08

Просмотреть файл

@ -9,6 +9,7 @@
subroutine PMPI_Comm_create_keyval_f08(comm_copy_attr_fn,comm_delete_attr_fn,&
comm_keyval,extra_state,ierror)
use, intrinsic :: iso_c_binding, only: c_funptr, c_funloc
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
use :: mpi_f08_interfaces_callbacks, only : MPI_Comm_copy_attr_function
use :: mpi_f08_interfaces_callbacks, only : MPI_Comm_delete_attr_function
@ -20,8 +21,11 @@ subroutine PMPI_Comm_create_keyval_f08(comm_copy_attr_fn,comm_delete_attr_fn,&
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: extra_state
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
type(c_funptr) :: fcopy_fn, fdelete_fn
call ompi_comm_create_keyval_f(comm_copy_attr_fn,comm_delete_attr_fn,&
fcopy_fn = c_funloc(comm_copy_attr_fn)
fdelete_fn = c_funloc(comm_delete_attr_fn)
call ompi_comm_create_keyval_f(fcopy_fn, fdelete_fn,&
comm_keyval,extra_state,c_ierror)
if (present(ierror)) ierror = c_ierror

Просмотреть файл

@ -8,6 +8,7 @@
#include "ompi/mpi/fortran/configure-fortran-output.h"
subroutine PMPI_File_create_errhandler_f08(file_errhandler_fn,errhandler,ierror)
use, intrinsic :: iso_c_binding, only: c_funptr, c_funloc
use :: mpi_f08_types, only : MPI_Errhandler
use :: mpi_f08_interfaces_callbacks, only : MPI_File_errhandler_function
use :: mpi_f08, only : ompi_file_create_errhandler_f
@ -16,8 +17,10 @@ subroutine PMPI_File_create_errhandler_f08(file_errhandler_fn,errhandler,ierror)
TYPE(MPI_Errhandler), INTENT(OUT) :: errhandler
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
type(c_funptr) :: fn
call ompi_file_create_errhandler_f(file_errhandler_fn,errhandler%MPI_VAL,c_ierror)
fn = c_funloc(file_errhandler_fn)
call ompi_file_create_errhandler_f(fn,errhandler%MPI_VAL,c_ierror)
if (present(ierror)) ierror = c_ierror
end subroutine PMPI_File_create_errhandler_f08

Просмотреть файл

@ -9,6 +9,7 @@
subroutine PMPI_Grequest_start_f08(query_fn,free_fn,cancel_fn,&
extra_state,request,ierror)
use, intrinsic :: iso_c_binding, only: c_funptr, c_funloc
use :: mpi_f08_types, only : MPI_Request, MPI_ADDRESS_KIND
use :: mpi_f08_interfaces_callbacks, only : MPI_Grequest_query_function
use :: mpi_f08_interfaces_callbacks, only : MPI_Grequest_free_function
@ -22,8 +23,12 @@ subroutine PMPI_Grequest_start_f08(query_fn,free_fn,cancel_fn,&
TYPE(MPI_Request), INTENT(OUT) :: request
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
type(c_funptr) :: fquery_fn, ffree_fn, fcancel_fn
call ompi_grequest_start_f(query_fn,free_fn,cancel_fn,&
fquery_fn = c_funloc(query_fn)
ffree_fn = c_funloc(free_fn)
fcancel_fn = c_funloc(cancel_fn)
call ompi_grequest_start_f(fquery_fn,ffree_fn,fcancel_fn,&
extra_state,request%MPI_VAL,c_ierror)
if (present(ierror)) ierror = c_ierror

Просмотреть файл

@ -9,6 +9,7 @@
subroutine PMPI_Register_datarep_f08(datarep,read_conversion_fn,write_conversion_fn, &
dtype_file_extent_fn,extra_state,ierror)
use, intrinsic :: iso_c_binding, only: c_funptr, c_funloc
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
use :: mpi_f08_interfaces_callbacks, only : MPI_Datarep_conversion_function
use :: mpi_f08_interfaces_callbacks, only : MPI_Datarep_extent_function
@ -21,9 +22,13 @@ subroutine PMPI_Register_datarep_f08(datarep,read_conversion_fn,write_conversion
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: extra_state
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
type(c_funptr) :: fread_fn, fwrite_fn, fdtype_fn
call ompi_register_datarep_f(datarep,read_conversion_fn,write_conversion_fn, &
dtype_file_extent_fn,extra_state,c_ierror,len(datarep))
fread_fn = c_funloc(read_conversion_fn)
fwrite_fn = c_funloc(write_conversion_fn)
fdtype_fn = c_funloc(dtype_file_extent_fn)
call ompi_register_datarep_f(datarep,fread_fn,fwrite_fn, &
fdtype_fn,extra_state,c_ierror,len(datarep))
if (present(ierror)) ierror = c_ierror
end subroutine PMPI_Register_datarep_f08

Просмотреть файл

@ -9,6 +9,7 @@
subroutine PMPI_Type_create_keyval_f08(type_copy_attr_fn,type_delete_attr_fn,&
type_keyval,extra_state,ierror)
use, intrinsic :: iso_c_binding, only: c_funptr, c_funloc
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
use :: mpi_f08_interfaces_callbacks, only : MPI_Type_copy_attr_function
use :: mpi_f08_interfaces_callbacks, only : MPI_Type_delete_attr_function
@ -20,8 +21,11 @@ subroutine PMPI_Type_create_keyval_f08(type_copy_attr_fn,type_delete_attr_fn,&
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: extra_state
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
type(c_funptr) :: fcopy_fn, fdelete_fn
call ompi_type_create_keyval_f(type_copy_attr_fn,type_delete_attr_fn,&
fcopy_fn = c_funloc(type_copy_attr_fn)
fdelete_fn = c_funloc(type_delete_attr_fn)
call ompi_type_create_keyval_f(fcopy_fn,fdelete_fn,&
type_keyval,extra_state,c_ierror)
if (present(ierror)) ierror = c_ierror

Просмотреть файл

@ -8,6 +8,7 @@
#include "ompi/mpi/fortran/configure-fortran-output.h"
subroutine PMPI_Win_create_errhandler_f08(win_errhandler_fn,errhandler,ierror)
use, intrinsic :: iso_c_binding, only: c_funptr, c_funloc
use :: mpi_f08_types, only : MPI_Errhandler
use :: mpi_f08_interfaces_callbacks, only : MPI_Win_errhandler_function
use :: mpi_f08, only : ompi_win_create_errhandler_f
@ -16,8 +17,10 @@ subroutine PMPI_Win_create_errhandler_f08(win_errhandler_fn,errhandler,ierror)
TYPE(MPI_Errhandler), INTENT(OUT) :: errhandler
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
type(c_funptr) :: fn
call ompi_win_create_errhandler_f(win_errhandler_fn,errhandler%MPI_VAL,c_ierror)
fn = c_funloc(win_errhandler_fn)
call ompi_win_create_errhandler_f(fn,errhandler%MPI_VAL,c_ierror)
if (present(ierror)) ierror = c_ierror
end subroutine PMPI_Win_create_errhandler_f08

Просмотреть файл

@ -9,6 +9,7 @@
subroutine PMPI_Win_create_keyval_f08(win_copy_attr_fn,win_delete_attr_fn,&
win_keyval,extra_state,ierror)
use, intrinsic :: iso_c_binding, only: c_funptr, c_funloc
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
use :: mpi_f08_interfaces_callbacks, only : MPI_Win_copy_attr_function
use :: mpi_f08_interfaces_callbacks, only : MPI_Win_delete_attr_function
@ -20,8 +21,11 @@ subroutine PMPI_Win_create_keyval_f08(win_copy_attr_fn,win_delete_attr_fn,&
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: extra_state
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
type(c_funptr) :: fcopy_fn, fdelete_fn
call ompi_win_create_keyval_f(win_copy_attr_fn,win_delete_attr_fn,&
fcopy_fn = c_funloc(win_copy_attr_fn)
fdelete_fn = c_funloc(win_delete_attr_fn)
call ompi_win_create_keyval_f(fcopy_fn,fdelete_fn,&
win_keyval,extra_state,c_ierror)
if (present(ierror)) ierror = c_ierror

Просмотреть файл

@ -9,6 +9,7 @@
subroutine MPI_Register_datarep_f08(datarep,read_conversion_fn,write_conversion_fn, &
dtype_file_extent_fn,extra_state,ierror)
use, intrinsic :: iso_c_binding, only: c_funptr, c_funloc
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
use :: mpi_f08_interfaces_callbacks, only : MPI_Datarep_conversion_function
use :: mpi_f08_interfaces_callbacks, only : MPI_Datarep_extent_function
@ -21,9 +22,13 @@ subroutine MPI_Register_datarep_f08(datarep,read_conversion_fn,write_conversion_
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: extra_state
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
type(c_funptr) :: fread_fn, fwrite_fn, fdtype_fn
call ompi_register_datarep_f(datarep,read_conversion_fn,write_conversion_fn, &
dtype_file_extent_fn,extra_state,c_ierror,len(datarep))
fread_fn = c_funloc(read_conversion_fn)
fwrite_fn = c_funloc(write_conversion_fn)
fdtype_fn = c_funloc(dtype_file_extent_fn)
call ompi_register_datarep_f(datarep,fread_fn,fwrite_fn, &
fdtype_fn,extra_state,c_ierror,len(datarep))
if (present(ierror)) ierror = c_ierror
end subroutine MPI_Register_datarep_f08

Просмотреть файл

@ -9,6 +9,7 @@
subroutine MPI_Type_create_keyval_f08(type_copy_attr_fn,type_delete_attr_fn,&
type_keyval,extra_state,ierror)
use, intrinsic :: iso_c_binding, only: c_funptr, c_funloc
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
use :: mpi_f08_interfaces_callbacks, only : MPI_Type_copy_attr_function
use :: mpi_f08_interfaces_callbacks, only : MPI_Type_delete_attr_function
@ -20,8 +21,11 @@ subroutine MPI_Type_create_keyval_f08(type_copy_attr_fn,type_delete_attr_fn,&
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: extra_state
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
type(c_funptr) :: fcopy_fn, fdelete_fn
call ompi_type_create_keyval_f(type_copy_attr_fn,type_delete_attr_fn,&
fcopy_fn = c_funloc(type_copy_attr_fn)
fdelete_fn = c_funloc(type_delete_attr_fn)
call ompi_type_create_keyval_f(fcopy_fn,fdelete_fn,&
type_keyval,extra_state,c_ierror)
if (present(ierror)) ierror = c_ierror

Просмотреть файл

@ -8,6 +8,7 @@
#include "ompi/mpi/fortran/configure-fortran-output.h"
subroutine MPI_Win_create_errhandler_f08(win_errhandler_fn,errhandler,ierror)
use, intrinsic :: iso_c_binding, only: c_funptr, c_funloc
use :: mpi_f08_types, only : MPI_Errhandler
use :: mpi_f08_interfaces_callbacks, only : MPI_Win_errhandler_function
use :: mpi_f08, only : ompi_win_create_errhandler_f
@ -16,8 +17,10 @@ subroutine MPI_Win_create_errhandler_f08(win_errhandler_fn,errhandler,ierror)
TYPE(MPI_Errhandler), INTENT(OUT) :: errhandler
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
type(c_funptr) :: fn
call ompi_win_create_errhandler_f(win_errhandler_fn,errhandler%MPI_VAL,c_ierror)
fn = c_funloc(win_errhandler_fn)
call ompi_win_create_errhandler_f(fn,errhandler%MPI_VAL,c_ierror)
if (present(ierror)) ierror = c_ierror
end subroutine MPI_Win_create_errhandler_f08

Просмотреть файл

@ -9,6 +9,7 @@
subroutine MPI_Win_create_keyval_f08(win_copy_attr_fn,win_delete_attr_fn,&
win_keyval,extra_state,ierror)
use, intrinsic :: iso_c_binding, only: c_funptr, c_funloc
use :: mpi_f08_types, only : MPI_ADDRESS_KIND
use :: mpi_f08_interfaces_callbacks, only : MPI_Win_copy_attr_function
use :: mpi_f08_interfaces_callbacks, only : MPI_Win_delete_attr_function
@ -20,8 +21,11 @@ subroutine MPI_Win_create_keyval_f08(win_copy_attr_fn,win_delete_attr_fn,&
INTEGER(MPI_ADDRESS_KIND), INTENT(IN) :: extra_state
INTEGER, OPTIONAL, INTENT(OUT) :: ierror
integer :: c_ierror
type(c_funptr) :: fcopy_fn, fdelete_fn
call ompi_win_create_keyval_f(win_copy_attr_fn,win_delete_attr_fn,&
fcopy_fn = c_funloc(win_copy_attr_fn)
fdelete_fn = c_funloc(win_delete_attr_fn)
call ompi_win_create_keyval_f(fcopy_fn,fdelete_fn,&
win_keyval,extra_state,c_ierror)
if (present(ierror)) ierror = c_ierror