fortran - segfault with -fopenmp for a trivial program -


I'm refreshing openmp, and closed the bunch found in this strange situation, I made this least trivial matter The problem is that

  is not any integer underlying program ex2, parameter :: n = 10000000 integer :: i real: x (n) i = 1, nx (i) = 0.0d0 end program  

does not specify any flags, Giferman 4.3.4 compiles on Mac (10.6), and Implements the village correctly.

However, if I enable openmp with -fopenmp, the program segmentation ends with a mistake that no code is executed, apparently, as it crashes instantly as you would Let's see, OpenMP is not used in code to parallel anything, I tried to modify the size of the pile, both with the phamax-stack-size-size, and in any case, ten million reals Do not I do not I define a large array.

What am I doing?

Yes, OpenM usually changes the way the memory is allocated. Previous discussion:

Search the Web, I found

gfortran-mp-4.3 -fopenmp ex2.f90 -wl, -stack_size, 0x40000000, -stack_addr, 0xf0000000 -o ex2 .exe

Fixed a problem on my Mac.


Comments