Skip to content

Commit

Permalink
Add new module, events_m, and add interfaces for prif_event_post,
Browse files Browse the repository at this point in the history
`prif_event_wait`, and `prif_event_query`.
  • Loading branch information
ktras committed Dec 17, 2023
1 parent 667a2e4 commit 62dbb65
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/caffeine/events_m.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
! Copyright (c), The Regents of the University of California
! Terms of use are as specified in LICENSE.txt
module events_m
use iso_c_binding, only: c_intptr_t, c_int, c_intmax_t

implicit none
private
public :: prif_event_post, prif_event_wait, prif_event_query

interface

module subroutine prif_event_post(image_num, event_var_ptr, stat, errmsg, errmsg_alloc)
implicit none
integer(c_int), intent(in) :: image_num
integer(c_intptr_t), intent(in) :: event_var_ptr
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_event_wait(event_var_ptr, until_count, stat, errmsg, errmsg_alloc)
implicit none
integer(c_intptr_t), intent(in) :: event_var_ptr
integer(c_intmax_t), intent(in), optional :: until_count
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_event_query(event_var_ptr, count, stat)
implicit none
integer(c_intptr_t), intent(in) :: event_var_ptr
integer(c_intmax_t), intent(out) :: count
integer(c_int), intent(out), optional :: stat
end subroutine

end interface

end module events_m
18 changes: 18 additions & 0 deletions src/caffeine/events_s.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
! Copyright (c), The Regents of the University of California
! Terms of use are as specified in LICENSE.txt
submodule(events_m) events_s

implicit none

contains

module procedure prif_event_post
end procedure

module procedure prif_event_wait
end procedure

module procedure prif_event_query
end procedure

end submodule events_s
1 change: 1 addition & 0 deletions src/prif.f90
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ module prif
use synchronization_m, only : prif_sync_all, prif_sync_images, prif_sync_team, prif_sync_memory
use locks_m, only: prif_lock_type, prif_lock, prif_unlock
use critical_m, only: prif_critical, prif_end_critical
use events_m, only: prif_event_post, prif_event_wait, prif_event_query
implicit none
end module prif

0 comments on commit 62dbb65

Please sign in to comment.