Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion app/native-multi-image.F90
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
#ifndef HAVE_CO_BROADCAST
#define HAVE_CO_BROADCAST HAVE_COLLECTIVES
#endif
#ifndef HAVE_CO_BROADCAST_DERIVED_POD
#define HAVE_CO_BROADCAST_DERIVED_POD HAVE_CO_BROADCAST
#endif

! TYPES_PRIF_COMPLIANT: ISO_FORTRAN_ENV multi-image types satisfy PRIF requirements
! TYPES_IMPORT_PRIF: compiler imports the real PRIF definition of ISO_FORTRAN_ENV types
Expand Down Expand Up @@ -360,6 +363,21 @@ program native_multi_image
type(dummy_team_descriptor), pointer :: info => null()
end type

#if HAVE_CO_BROADCAST_DERIVED_POD
type :: bcast_parent_type
integer :: ap(4)
end type
type :: bcast_val_type
integer :: val
end type
type, extends(bcast_parent_type) :: bcast_type
integer :: ax(3)
type(bcast_val_type) :: val
integer :: sy
end type
type(bcast_type) :: bcast_var(4)
#endif

integer :: me, ni, peer, i, ia(3)
character(len=10) :: c, ca(3)
# if HAVE_FORM_TEAM
Expand Down Expand Up @@ -494,7 +512,7 @@ program native_multi_image
call CO_MAX(ca,1)
# endif
# if HAVE_CO_BROADCAST
STATUS("Testing CO_BROADCAST...")
STATUS("Testing CO_BROADCAST(intrinsic)...")
i = me*1000
ia = i
call CO_BROADCAST(i,1)
Expand All @@ -508,6 +526,22 @@ program native_multi_image
call CO_BROADCAST(ca,1)
CHECK_ASSERT(all(ca == 'hello'))
# endif
# if HAVE_CO_BROADCAST_DERIVED_POD
STATUS("Testing CO_BROADCAST(derived:pod)...")
do i=1,size(bcast_var)
bcast_var(i)%ap = me
bcast_var(i)%ax = me*10
bcast_var(i)%sy = me*100
bcast_var(i)%val%val = me*1000
end do
call CO_BROADCAST(bcast_var,ni)
do i=1,size(bcast_var)
CHECK_VALI(bcast_var(i)%val%val, ni*1000)
CHECK_VALI(bcast_var(i)%sy, ni*100)
CHECK_ASSERT(all(bcast_var(i)%ap == ni))
CHECK_ASSERT(all(bcast_var(i)%ax == ni*10))
end do
# endif

# if HAVE_TEAM_TYPE
CHECK_TYPE_COMPLIANCE(TEAM_TYPE, default_team, .true., 0)
Expand Down
15 changes: 12 additions & 3 deletions app/print-native-flags.F90
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
program print_native_flags
use iso_fortran_env, only: COMPILER_VERSION, COMPILER_OPTIONS
use iso_fortran_env, only: COMPILER_VERSION, COMPILER_OPTIONS, error_unit
implicit none

character(:), allocatable :: flags
logical :: stand_alone

#if VERBOSE
write(error_unit,'(A,A)') "COMPILER_VERSION=", COMPILER_VERSION()
write(error_unit,'(A,A)') "COMPILER_OPTIONS=", COMPILER_OPTIONS()
logical, parameter :: verbose = .true.
#else
logical, parameter :: verbose = .false.
#endif
if (verbose) then
write(error_unit,'(A,A)') "COMPILER_VERSION=", COMPILER_VERSION()
write(error_unit,'(A,A)') "COMPILER_OPTIONS=", COMPILER_OPTIONS()
end if

stand_alone = COMMAND_ARGUMENT_COUNT() > 0

Expand Down Expand Up @@ -71,6 +76,8 @@ subroutine write_flags
# if __LFORTRAN_MAJOR__ == 0 && __LFORTRAN_MINOR__ == 64
call no("TEAM")

call no("CO_BROADCAST_DERIVED_POD")

call no("ALLOC_COARRAY")
call no("COARRAY_QUERY")
call no("PUTGET_INTRINSIC_ARRAY_CONTIG")
Expand All @@ -87,6 +94,8 @@ subroutine write_flags
call no("THIS_IMAGE_TEAM")
call no("TEAM_NUMBER")

call no("CO_BROADCAST_DERIVED_POD")

call no("ALLOC_COARRAY_CLEANUP")
call no("IMAGE_INDEX")
call no("THIS_IMAGE_COARRAY")
Expand Down