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

ifx 2025.3.0 ICE when compiling a submodule with do concurrent and -fopenmp

ralis
Beginner
138 Views

Hi everyone!

 

I have a Fortran code which is organized with submodules and I want to replace do loops with do concurrent loops. The ultimate idea is to have a code which can run on CPU/GPU with the same source files and no pragmas. Regarding the actual evolution of computers, we seek portability to be able to run on any hardware configuration.

Here some info on my computer:

Operating system       : ubuntu 24.04
Processor(s)           : Intel(R) Xeon(R) Silver 4114 CPU @ 2.20GHz
Number of processors   : 2
Cores per processor    : 10
Total cores (physical) : 20
Total cores (virtual)  : 40
Installed memory (Gb)  : 62.53
Video card(s)          : NVIDIA Corporation GP104GL [Quadro P4000]  

 

In this context, I have and ICE when I want to compile the code with the -fopenmp/-qopenmp option and a do concurrent loop is present in the submodule. I managed to construct a reproducer DO_CONCURRENT.f90:

!-------------------------------------------------------------
MODULE module_test2

#if defined (CFG1_BUG) || (CFG3)
    integer :: n
#endif
#if defined (CFG2) || (CFG4)
    integer, parameter :: n=10
#endif

END MODULE module_test2
!-------------------------------------------------------------


!-------------------------------------------------------------
MODULE module_test1

use module_test2

INTERFACE

module subroutine loop_do_concurrent(q)
    real, dimension (1:n), intent(inout)  :: q
end subroutine

END INTERFACE

END MODULE module_test1
!-------------------------------------------------------------


!-------------------------------------------------------------
SUBMODULE(module_test1) submodule_loop_do_concurrent
    
CONTAINS

MODULE PROCEDURE loop_do_concurrent
    
    implicit none
    
    integer :: i
    
#if defined (CFG1_BUG) || (CFG2) 
    do concurrent (i = 1:n)
        q(i) = 0.5 * (i + i / i)
    end do
#endif
#if defined (CFG3) || (CFG4) 
    do i = 1,n
        q(i) = 0.5 * (i + i / i)
    end do
#endif

END PROCEDURE

END SUBMODULE
!-------------------------------------------------------------


!-------------------------------------------------------------
program test_do_concurrent

    use module_test1
    use module_test2
    
    implicit none
    
    real,  allocatable :: q(:)

    integer :: i
    
#if defined (CFG1_BUG) || (CFG3)
    n = 10
#endif
    allocate(q(n))
    
    call loop_do_concurrent(q)
    
    do i=1,n
        print*,q(i)
    enddo

end program test_do_concurrent
!-------------------------------------------------------------

And I run the following command when I have the ICE:

ifx -v; ifx -cpp -DCFG1_BUG -stand f18 -g -O0 -qopenmp DO_CONCURRENT3.f90 -o DO_CONCURRENT3.x
ifx version 2025.3.0
          #0 0x00005f8a23786e71
          #1 0x00005f8a237ed3b7
          #2 0x00005f8a237d828a
          #3 0x00005f8a236e6529
          #4 0x00005f8a23893c68
          #5 0x00005f8a238918a8
          #6 0x00005f8a23832570
          #7 0x00005f8a2383c2c1
          #8 0x00005f8a2383c7f7
          #9 0x00005f8a237c28a9
         #10 0x00005f8a237c23e6
         #11 0x00005f8a237c264c
         #12 0x00005f8a237c2df0
         #13 0x00005f8a2383c2c1
         #14 0x00005f8a2383c7f7
         #15 0x00005f8a2383f417
         #16 0x00005f8a2383c2c1
         #17 0x00005f8a2383c7f7
         #18 0x00005f8a23839fe6
         #19 0x00005f8a2383c2c1
         #20 0x00005f8a2383969e
         #21 0x00005f8a2383c2c1
         #22 0x00005f8a236c833d
         #23 0x00005f8a236c7cef
         #24 0x00005f8a238ae7cf
         #25 0x000078971042a1ca
         #26 0x000078971042a28b __libc_start_main + 139
         #27 0x00005f8a234ff68e

DO_CONCURRENT3.f90(45): error #5623: **Internal compiler error: internal abort** Please report this error along with the circumstances in which it occurred in a Software Problem Report.  Note: File and line given may not be explicit cause of this error.
        q(i) = 0.5 * (i + i / i)
--------^
compilation aborted for DO_CONCURRENT3.f90 (code 3)

If I change declare n to be a paramater (CFG2), everything is fine and if I suppress the do concurrent loop, it's also fine (CFG3+CFG4). I also found the same ICE with ifx 2024.2.0. With ifort, gfortran and nvfortran everthing is OK.

 

I didn't find any similar post with a solution in the forum but I may have missed one. Just this one https://community.intel.com/t5/Intel-Fortran-Compiler/IFX-update-seg-faults-compilation-internal-compiler-error-when/m-p/1723440#M177544 which may be related since -fiopenmp is used.

 

I hope these is clear and have a nice day!

Romain

0 Kudos
0 Replies
Reply