Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29544 Discussions

recursive derived type + OpenMP: compilation problem

DLauvergn
Beginner
61 Views

Dear developers,

I want to report a compilation problem with ifx-2024.

I don't have access to more recent versions, so may be it already fixed.

 

I’ve encountered a problem with a recursive derived type when used with OpenMP (it a follows up of a discussion on discourse https://fortran-lang.discourse.group/t/recursively-defined-derived-types-bug-in-gfortran/2416) and it might be related to an old bug:

https://community.intel.com/t5/Intel-Fortran-Compiler/Recursive-derived-type-compiler-crash/m-p/1164154

 

program chkrecursive
    implicit none

    type recu_t
        integer :: chk
        type(recu_t), allocatable :: next           ! with fortran:  compilation fatal error with OpenMP. 
                                                    ! With ifx: the compilation does not stop with OpenMP!!
        !type(recu_t), pointer     :: next => null() ! compilation and execution ok with gfortran and ifx
    end type recu_t

    type(recu_t) :: chain2

!$OMP   PARALLEL &
!$OMP   DEFAULT(NONE) &
!$OMP   PRIVATE(chain2)
    chain2%chk=0
    write(*,*) 'chain2%chk',chain2%chk
!$OMP   END PARALLEL

end program chkrecursive

 

The compilation:

  • With ifx (2024) and with OpenMP, on linux
    => the compilation does not stop. I've to kill the process after few minutes.

  • With ifort (2024) and with OpenMP, on linux
    => The compilation and the execution work as expected

When the “allocatable” (line 10) is replaced by a “pointer” (line 11) or when the OpenMP is turned off. The compilation and the execution work as expected.

 

Regards

0 Kudos
0 Replies
Reply