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

ifort v:12.0.4 Bug: OpenMP segmentation fault

Kamil_Kie
Beginner
587 Views
When I compile below code by "ifort -openmp bug.f90" and run I get "Segmentation fault" :
[fortran]program bug
  implicit none
  integer :: n
  parameter (n=1024)
  real :: A(n,n),B(n,n),C1(n,n),C2(n,n),C3(n,n)
  
  print *,"hello"
  A=1
  B=2
  C3=3

  if(.not. all(C1.eq.C2)) print *,"error C1!=C2"
  if(.not. all(C1.eq.C3)) print *,"error C1!=C3"

end program[/fortran]
For n=512, or without "-openmp" option, everything is fine. How to fix it?
0 Kudos
1 Solution
jimdempseyatthecove
Honored Contributor III
587 Views
Either use heap arrays or

real, save::A(n,n),B(n,n),C1(n,n),C2(n,n),C3(n,n)

Jim Dempsey

View solution in original post

0 Kudos
3 Replies
jimdempseyatthecove
Honored Contributor III
588 Views
Either use heap arrays or

real, save::A(n,n),B(n,n),C1(n,n),C2(n,n),C3(n,n)

Jim Dempsey
0 Kudos
Kamil_Kie
Beginner
587 Views
ok thanks.
0 Kudos
Reply