diff --git a/app/native-multi-image.F90 b/app/native-multi-image.F90 index 12e7bb81..70adfbcb 100644 --- a/app/native-multi-image.F90 +++ b/app/native-multi-image.F90 @@ -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 @@ -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 @@ -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) @@ -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) diff --git a/app/print-native-flags.F90 b/app/print-native-flags.F90 index fe490721..d02dfd51 100644 --- a/app/print-native-flags.F90 +++ b/app/print-native-flags.F90 @@ -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 @@ -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") @@ -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")