Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Hammond <[email protected]>
  • Loading branch information
jeffhammond committed Apr 17, 2024
1 parent 0a2fa3f commit 80b8d1b
Showing 1 changed file with 17 additions and 15 deletions.
32 changes: 17 additions & 15 deletions tests/uop08.F90
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,7 @@ end subroutine MPI_Op_create_f08

end module m

subroutine uop( cin, cout, count, datatype )
use m
integer, dimension(*) :: cin, cout
integer :: count
type(MPI_Datatype) :: datatype
integer :: i
do i=1, count
cout(i) = cin(i) + cout(i)
enddo
end

#if 1
subroutine uop08( cin, cout, count, datatype )
use iso_c_binding, only: c_ptr, c_f_pointer
use m
Expand All @@ -57,13 +47,25 @@ subroutine uop08( cin, cout, count, datatype )
call c_f_pointer(cout, cout_r, [count])
cout_r = cin_r + cout_r
end
#endif

program main
use m
external :: uop
#if 0
interface
subroutine uop08( cin, cout, count, datatype )
use iso_c_binding, only: c_ptr, c_f_pointer
use m
type(c_ptr), value :: cin, cout
integer :: count
type(MPI_Datatype) :: datatype
integer, pointer :: cin_r(:), cout_r(:)
end
end interface
#endif
external :: uop08
integer :: ierr
type(MPI_Op) :: sumop, sumop08
call MPI_Op_create( uop, .true., sumop, ierr )
call MPI_Op_create( uop08, .true., sumop08, ierr )
!type(MPI_Op) :: sumop, sumop08
!call MPI_Op_create( uop, .true., sumop, ierr )
!call MPI_Op_create( uop08, .true., sumop08, ierr )
end

0 comments on commit 80b8d1b

Please sign in to comment.