From 3bc6f53ab256fb60a61f7e1d3a3ecb8e950fa13f Mon Sep 17 00:00:00 2001 From: Katherine Rasmussen Date: Sun, 17 Dec 2023 15:07:38 -0800 Subject: [PATCH] Add interfaces for the remaining synchronization statements --- src/caffeine/synchronization_m.f90 | 28 ++++++++++++++++++++++++++-- src/caffeine/synchronization_s.f90 | 11 +++++++++-- src/prif.f90 | 2 +- 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/src/caffeine/synchronization_m.f90 b/src/caffeine/synchronization_m.f90 index 1612b6af6..d7d1cab71 100644 --- a/src/caffeine/synchronization_m.f90 +++ b/src/caffeine/synchronization_m.f90 @@ -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) @@ -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 diff --git a/src/caffeine/synchronization_s.f90 b/src/caffeine/synchronization_s.f90 index b522d9c4a..b9b77ae48 100644 --- a/src/caffeine/synchronization_s.f90 +++ b/src/caffeine/synchronization_s.f90 @@ -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 diff --git a/src/prif.f90 b/src/prif.f90 index 87e762e71..520451fd4 100644 --- a/src/prif.f90 +++ b/src/prif.f90 @@ -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