Skip to content

Commit

Permalink
Add interfaces for the remaining synchronization statements
Browse files Browse the repository at this point in the history
  • Loading branch information
ktras committed Dec 17, 2023
1 parent ad0ca30 commit 3bc6f53
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 5 deletions.
28 changes: 26 additions & 2 deletions src/caffeine/synchronization_m.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
! Terms of use are as specified in LICENSE.txt
module synchronization_m
use iso_c_binding, only: c_int
use teams_m, only: prif_team_type
implicit none
private
public :: prif_sync_all
public :: prif_sync_all, prif_sync_images, prif_sync_team, prif_sync_memory

interface

module subroutine prif_sync_all(stat, errmsg, errmsg_alloc)
Expand All @@ -15,6 +16,29 @@ module subroutine prif_sync_all(stat, errmsg, errmsg_alloc)
character(len=:), intent(inout), allocatable, optional :: errmsg_alloc
end subroutine

module subroutine prif_sync_images(image_set, stat, errmsg, errmsg_alloc)
implicit none
integer(c_int), intent(in) :: image_set(:)
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_sync_team(team, stat, errmsg, errmsg_alloc)
implicit none
type(prif_team_type), intent(in) :: team
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_sync_memory(stat, errmsg, errmsg_alloc)
implicit none
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

end module synchronization_m
11 changes: 9 additions & 2 deletions src/caffeine/synchronization_s.f90
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@
contains

module procedure prif_sync_all

!TODO: handle optional args stat, errmsg, errmsg_alloc
call caf_sync_all
end procedure

module procedure prif_sync_images
end procedure

module procedure prif_sync_team
end procedure

end procedure
module procedure prif_sync_memory
end procedure

end submodule
2 changes: 1 addition & 1 deletion src/prif.f90
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ module prif
use image_enumeration_m, only : prif_this_image, prif_num_images
use collective_subroutines_m, only : prif_co_sum, prif_co_max, prif_co_min, prif_co_reduce, prif_co_broadcast
use teams_m, only: prif_form_team, prif_change_team, prif_end_team, prif_team_type
use synchronization_m, only : prif_sync_all
use synchronization_m, only : prif_sync_all, prif_sync_images, prif_sync_team, prif_sync_memory
implicit none
end module prif

0 comments on commit 3bc6f53

Please sign in to comment.