Commit 30da9161 authored by Junchao Zhang's avatar Junchao Zhang
Browse files

Add F08 bindings for nonblocking collective I/O

No review since F08 binding is experimental now.
parent 48c38c08
......@@ -1565,6 +1565,62 @@ function MPIR_Ineighbor_alltoallw_cdesc(sendbuf, sendcounts, sdispls, sendtypes,
integer(c_int) :: ierror
end function MPIR_Ineighbor_alltoallw_cdesc
function MPIR_File_iread_all_cdesc(fh, buf, count, datatype, request) &
bind(C, name="MPIR_File_iread_all_cdesc") result(ierror)
use, intrinsic :: iso_c_binding, only : c_int
use :: mpi_c_interface_types, only : c_File, c_Datatype, c_Request
implicit none
integer(c_File), value, intent(in) :: fh
type(*), dimension(..) :: buf
integer(c_int), value, intent(in) :: count
integer(c_Datatype), value, intent(in) :: datatype
integer(c_Request), intent(out) :: request
integer(c_int) :: ierror
end function MPIR_File_iread_all_cdesc
function MPIR_File_iwrite_all_cdesc(fh, buf, count, datatype, request) &
bind(C, name="MPIR_File_iwrite_all_cdesc") result(ierror)
use, intrinsic :: iso_c_binding, only : c_int, c_ptr
use :: mpi_c_interface_types, only : c_File, c_Datatype, c_Request
implicit none
integer(c_File), value, intent(in) :: fh
type(*), dimension(..), intent(in) :: buf
integer(c_int), value, intent(in) :: count
integer(c_Datatype), value, intent(in) :: datatype
integer(c_Request), intent(out) :: request
integer(c_int) :: ierror
end function MPIR_File_iwrite_all_cdesc
function MPIR_File_iread_at_all_cdesc(fh, offset, buf, count, datatype, request) &
bind(C, name="MPIR_File_iread_at_all_cdesc") result(ierror)
use, intrinsic :: iso_c_binding, only : c_int
use :: mpi_f08_compile_constants, only : MPI_OFFSET_KIND
use :: mpi_c_interface_types, only : c_File, c_Datatype, c_Request
implicit none
integer(c_File), value, intent(in) :: fh
integer(MPI_OFFSET_KIND), value, intent(in) :: offset
type(*), dimension(..) :: buf
integer(c_int), value, intent(in) :: count
integer(c_Datatype), value, intent(in) :: datatype
integer(c_Request), intent(out) :: request
integer(c_int) :: ierror
end function MPIR_File_iread_at_all_cdesc
function MPIR_File_iwrite_at_all_cdesc(fh, offset, buf, count, datatype, request) &
bind(C, name="MPIR_File_iwrite_at_all_cdesc") result(ierror)
use, intrinsic :: iso_c_binding, only : c_int
use :: mpi_f08_compile_constants, only : MPI_OFFSET_KIND
use :: mpi_c_interface_types, only : c_File, c_Datatype, c_Request
implicit none
integer(c_File), value, intent(in) :: fh
integer(MPI_OFFSET_KIND), value, intent(in) :: offset
type(*), dimension(..) :: buf
integer(c_int), value, intent(in) :: count
integer(c_Datatype), value, intent(in) :: datatype
integer(c_Request), intent(out) :: request
integer(c_int) :: ierror
end function MPIR_File_iwrite_at_all_cdesc
end interface
end module mpi_c_interface_cdesc
......@@ -4121,4 +4121,60 @@ interface MPIX_Aint_diff
end function MPIX_Aint_diff_f08
end interface MPIX_Aint_diff
interface MPIX_File_iread_all
subroutine MPIX_File_iread_all_f08ts(fh, buf, count, datatype, request, ierror)
use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request
implicit none
type(MPI_File), intent(in) :: fh
type(*), dimension(..) :: buf
integer, intent(in) :: count
type(MPI_Datatype), intent(in) :: datatype
type(MPI_Request), intent(out) :: request
integer, optional, intent(out) :: ierror
end subroutine MPIX_File_iread_all_f08ts
end interface MPIX_File_iread_all
interface MPIX_File_iwrite_all
subroutine MPIX_File_iwrite_all_f08ts(fh, buf, count, datatype, request, ierror)
use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request
implicit none
type(MPI_File), intent(in) :: fh
type(*), dimension(..), intent(in) :: buf
integer, intent(in) :: count
type(MPI_Datatype), intent(in) :: datatype
type(MPI_Request), intent(out) :: request
integer, optional, intent(out) :: ierror
end subroutine MPIX_File_iwrite_all_f08ts
end interface MPIX_File_iwrite_all
interface MPIX_File_iread_at_all
subroutine MPIX_File_iread_at_all_f08ts(fh, offset, buf, count, datatype, request, ierror)
use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request
use :: mpi_f08_compile_constants, only : MPI_OFFSET_KIND
implicit none
type(MPI_File), intent(in) :: fh
integer(MPI_OFFSET_KIND), intent(in) :: offset
type(*), dimension(..) :: buf
integer, intent(in) :: count
type(MPI_Datatype), intent(in) :: datatype
type(MPI_Request), intent(out) :: request
integer, optional, intent(out) :: ierror
end subroutine MPIX_File_iread_at_all_f08ts
end interface MPIX_File_iread_at_all
interface MPIX_File_iwrite_at_all
subroutine MPIX_File_iwrite_at_all_f08ts(fh, offset, buf, count, datatype, request, ierror)
use :: mpi_f08_types, only : MPI_File, MPI_Datatype, MPI_Request
use :: mpi_f08_compile_constants, only : MPI_OFFSET_KIND
implicit none
type(MPI_File), intent(in) :: fh
integer(MPI_OFFSET_KIND), intent(in) :: offset
type(*), dimension(..) :: buf
integer, intent(in) :: count
type(MPI_Datatype), intent(in) :: datatype
type(MPI_Request), intent(out) :: request
integer, optional, intent(out) :: ierror
end subroutine MPIX_File_iwrite_at_all_f08ts
end interface MPIX_File_iwrite_at_all
end module mpi_f08
! -*- Mode: Fortran; -*-
!
! (C) 2014 by Argonne National Laboratory.
! See COPYRIGHT in top-level directory.
!
subroutine MPIX_File_iread_all_f08ts(fh, buf, count, datatype, request, ierror)
use, intrinsic :: iso_c_binding, only : c_loc, c_associated
use, intrinsic :: iso_c_binding, only : c_int, c_ptr
use :: mpi_f08, only : MPI_File, MPI_Datatype, MPI_Request
use :: mpi_f08, only : MPI_File_f2c, MPI_File_c2f
use :: mpi_c_interface, only : c_File, c_Datatype
use :: mpi_c_interface, only : c_Request
use :: mpi_c_interface, only : MPIR_File_iread_all_cdesc
implicit none
type(MPI_File), intent(in) :: fh
type(*), dimension(..) :: buf
integer, intent(in) :: count
type(MPI_Datatype), intent(in) :: datatype
type(MPI_Request), intent(out) :: request
integer, optional, intent(out) :: ierror
integer(c_File) :: fh_c
integer(c_int) :: count_c
integer(c_Datatype) :: datatype_c
integer(c_Request) :: request_c
integer(c_int) :: ierror_c
fh_c = MPI_File_f2c(fh%MPI_VAL)
if (c_int == kind(0)) then
ierror_c = MPIR_File_iread_all_cdesc(fh_c, buf, count, datatype%MPI_VAL, request%MPI_VAL)
else
count_c = count
datatype_c = datatype%MPI_VAL
ierror_c = MPIR_File_iread_all_cdesc(fh_c, buf, count_c, datatype_c, request_c)
request%MPI_VAL = request_c
end if
if (present(ierror)) ierror = ierror_c
end subroutine MPIX_File_iread_all_f08ts
! -*- Mode: Fortran; -*-
!
! (C) 2014 by Argonne National Laboratory.
! See COPYRIGHT in top-level directory.
!
subroutine MPIX_File_iread_at_all_f08ts(fh, offset, buf, count, datatype, request, ierror)
use, intrinsic :: iso_c_binding, only : c_loc, c_associated
use, intrinsic :: iso_c_binding, only : c_int, c_ptr
use :: mpi_f08, only : MPI_File, MPI_Datatype, MPI_Request
use :: mpi_f08, only : MPI_OFFSET_KIND
use :: mpi_f08, only : MPI_File_f2c, MPI_File_c2f
use :: mpi_c_interface, only : c_File, c_Datatype
use :: mpi_c_interface, only : c_Request
use :: mpi_c_interface, only : MPIR_File_iread_at_all_cdesc
implicit none
type(MPI_File), intent(in) :: fh
integer(MPI_OFFSET_KIND), intent(in) :: offset
type(*), dimension(..) :: buf
integer, intent(in) :: count
type(MPI_Datatype), intent(in) :: datatype
type(MPI_Request), intent(out) :: request
integer, optional, intent(out) :: ierror
integer(c_File) :: fh_c
integer(MPI_OFFSET_KIND) :: offset_c
integer(c_int) :: count_c
integer(c_Datatype) :: datatype_c
integer(c_Request) :: request_c
integer(c_int) :: ierror_c
fh_c = MPI_File_f2c(fh%MPI_VAL)
if (c_int == kind(0)) then
ierror_c = MPIR_File_iread_at_all_cdesc(fh_c, offset, buf, count, datatype%MPI_VAL, request%MPI_VAL)
else
offset_c = offset
count_c = count
datatype_c = datatype%MPI_VAL
ierror_c = MPIR_File_iread_at_all_cdesc(fh_c, offset_c, buf, count_c, datatype_c, request_c)
request%MPI_VAL = request_c
end if
if (present(ierror)) ierror = ierror_c
end subroutine MPIX_File_iread_at_all_f08ts
! -*- Mode: Fortran; -*-
!
! (C) 2014 by Argonne National Laboratory.
! See COPYRIGHT in top-level directory.
!
subroutine MPIX_File_iwrite_all_f08ts(fh, buf, count, datatype, request, ierror)
use, intrinsic :: iso_c_binding, only : c_loc, c_associated
use, intrinsic :: iso_c_binding, only : c_int, c_ptr
use :: mpi_f08, only : MPI_File, MPI_Datatype, MPI_Request
use :: mpi_f08, only : MPI_File_f2c, MPI_File_c2f
use :: mpi_c_interface, only : c_File, c_Datatype
use :: mpi_c_interface, only : c_Request
use :: mpi_c_interface, only : MPIR_File_iwrite_all_cdesc
implicit none
type(MPI_File), intent(in) :: fh
type(*), dimension(..), intent(in) :: buf
integer, intent(in) :: count
type(MPI_Datatype), intent(in) :: datatype
type(MPI_Request), intent(out) :: request
integer, optional, intent(out) :: ierror
integer(c_File) :: fh_c
integer(c_int) :: count_c
integer(c_Datatype) :: datatype_c
integer(c_Request) :: request_c
integer(c_int) :: ierror_c
fh_c = MPI_File_f2c(fh%MPI_VAL)
if (c_int == kind(0)) then
ierror_c = MPIR_File_iwrite_all_cdesc(fh_c, buf, count, datatype%MPI_VAL, request%MPI_VAL)
else
count_c = count
datatype_c = datatype%MPI_VAL
ierror_c = MPIR_File_iwrite_all_cdesc(fh_c, buf, count_c, datatype_c, request_c)
request%MPI_VAL = request_c
end if
if (present(ierror)) ierror = ierror_c
end subroutine MPIX_File_iwrite_all_f08ts
! -*- Mode: Fortran; -*-
!
! (C) 2014 by Argonne National Laboratory.
! See COPYRIGHT in top-level directory.
!
subroutine MPIX_File_iwrite_at_all_f08ts(fh, offset, buf, count, datatype, request, ierror)
use, intrinsic :: iso_c_binding, only : c_loc, c_associated
use, intrinsic :: iso_c_binding, only : c_int, c_ptr
use :: mpi_f08, only : MPI_File, MPI_Datatype, MPI_Request
use :: mpi_f08, only : MPI_OFFSET_KIND
use :: mpi_f08, only : MPI_File_f2c, MPI_File_c2f
use :: mpi_c_interface, only : c_File, c_Datatype
use :: mpi_c_interface, only : c_Request
use :: mpi_c_interface, only : MPIR_File_iwrite_at_all_cdesc
implicit none
type(MPI_File), intent(in) :: fh
integer(MPI_OFFSET_KIND), intent(in) :: offset
type(*), dimension(..) :: buf
integer, intent(in) :: count
type(MPI_Datatype), intent(in) :: datatype
type(MPI_Request), intent(out) :: request
integer, optional, intent(out) :: ierror
integer(c_File) :: fh_c
integer(MPI_OFFSET_KIND) :: offset_c
integer(c_int) :: count_c
integer(c_Datatype) :: datatype_c
integer(c_Request) :: request_c
integer(c_int) :: ierror_c
fh_c = MPI_File_f2c(fh%MPI_VAL)
if (c_int == kind(0)) then
ierror_c = MPIR_File_iwrite_at_all_cdesc(fh_c, offset, buf, count, datatype%MPI_VAL, request%MPI_VAL)
else
offset_c = offset
count_c = count
datatype_c = datatype%MPI_VAL
ierror_c = MPIR_File_iwrite_at_all_cdesc(fh_c, offset_c, buf, count_c, datatype_c, request_c)
request%MPI_VAL = request_c
end if
if (present(ierror)) ierror = ierror_c
end subroutine MPIX_File_iwrite_at_all_f08ts
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment