Skip to content

Commit

Permalink
Update interface of collectives based on latest design doc choices.
Browse files Browse the repository at this point in the history
  • Loading branch information
ktras committed Dec 13, 2023
1 parent 153e652 commit e7d9b29
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/caffeine/collective_subroutines/co_reduce_s.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
! Terms of use are as specified in LICENSE.txt
submodule(collective_subroutines_m) co_reduce_s
use iso_c_binding, only : &
c_ptr, c_size_t, c_loc, c_null_ptr, c_funloc, c_associated, c_f_pointer, c_int, c_f_procpointer
c_ptr, c_size_t, c_loc, c_null_ptr, c_funloc, c_associated, c_f_pointer, c_f_procpointer
use caffeine_assert_m, only : assert
use caffeine_intrinsic_array_m, only : intrinsic_array_t
use utilities_m, only : get_c_ptr, get_c_ptr_character, optional_value
Expand Down
47 changes: 26 additions & 21 deletions src/caffeine/collective_subroutines_m.f90
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
! Copyright (c), The Regents of the University of California
! Terms of use are as specified in LICENSE.txt
module collective_subroutines_m
use iso_c_binding, only : c_int32_t, c_int64_t, c_float, c_char, c_bool, c_funptr, c_double
use iso_c_binding, only : c_int, c_int32_t, c_int64_t, c_float, c_char, c_bool, c_funptr, c_double
implicit none

private
Expand Down Expand Up @@ -82,45 +82,50 @@ pure function c_double_complex_operation(lhs, rhs) result(lhs_op_rhs)

interface

module subroutine prif_co_sum(a, result_image, stat, errmsg)
module subroutine prif_co_sum(a, result_image, stat, errmsg, errmsg_alloc)
implicit none
type(*), intent(inout), contiguous, target :: a(..)
integer, intent(in), target, optional :: result_image
integer, intent(out), target, optional :: stat
character(len=*), intent(inout), target, optional :: errmsg
integer(c_int), intent(in), optional :: result_image
integer(c_int), intent(out), optional :: stat
character(len=*), intent(inout), optional :: errmsg
character(len=:), intent(inout), allocatable, optional :: errmsg_alloc
end subroutine

module subroutine prif_co_max(a, result_image, stat, errmsg)
module subroutine prif_co_max(a, result_image, stat, errmsg, errmsg_alloc)
implicit none
type(*), intent(inout), contiguous, target :: a(..)
integer, intent(in), optional, target :: result_image
integer, intent(out), optional, target :: stat
character(len=*), intent(inout), optional, target :: errmsg
integer(c_int), intent(in), optional :: result_image
integer(c_int), intent(out), optional :: stat
character(len=*), intent(inout), optional :: errmsg
character(len=:), intent(inout), allocatable, optional :: errmsg_alloc
end subroutine

module subroutine prif_co_min(a, result_image, stat, errmsg)
module subroutine prif_co_min(a, result_image, stat, errmsg, errmsg_alloc)
implicit none
type(*), intent(inout), contiguous, target :: a(..)
integer, intent(in), optional, target :: result_image
integer, intent(out), optional, target :: stat
character(len=*), intent(inout), optional, target :: errmsg
integer(c_int), intent(in), optional :: result_image
integer(c_int), intent(out), optional :: stat
character(len=*), intent(inout), optional :: errmsg
character(len=:), intent(inout), allocatable, optional :: errmsg_alloc
end subroutine

module subroutine prif_co_reduce(a, operation, result_image, stat, errmsg)
module subroutine prif_co_reduce(a, operation, result_image, stat, errmsg, errmsg_alloc)
implicit none
type(*), intent(inout), contiguous, target :: a(..)
type(c_funptr), value :: operation
integer, intent(in), optional, target :: result_image
integer, intent(out), optional, target :: stat
character(len=*), intent(inout), optional, target :: errmsg
integer(c_int), intent(in), optional :: result_image
integer(c_int), intent(out), optional :: stat
character(len=*), intent(inout), optional :: errmsg
character(len=:), intent(inout), allocatable, optional :: errmsg_alloc
end subroutine

module subroutine prif_co_broadcast(a, source_image, stat, errmsg)
module subroutine prif_co_broadcast(a, source_image, stat, errmsg, errmsg_alloc)
implicit none
type(*), intent(inout), contiguous, target :: a(..)
integer, optional, intent(in) :: source_image
integer, optional, intent(out), target :: stat
character(len=*), intent(inout), optional, target :: errmsg
integer(c_int), intent(in) :: source_image
integer(c_int), intent(out), optional :: stat
character(len=*), intent(inout), optional :: errmsg
character(len=:), intent(inout), allocatable, optional :: errmsg_alloc
end subroutine

end interface
Expand Down

0 comments on commit e7d9b29

Please sign in to comment.