Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.
29306 Discussions

forrtl: severe (174): SIGSEGV, segmentation fault occurred -> again

sallestaing
Beginner
1,100 Views
Hi guys,

I'm aware of the thread on this forum about the segmentation fault. I have tried most of the things that were proposed but I still have some problems.
I have a piece of code in fortran that compiles and runs well under windows and Linux. However when I try to compile and run it under mac os x (snow leopard) it gives a segfault (intel fortran compiler 11.1).
In fact it seems that the trouble is coming from the multiple files optimisation (-ipo or -fast options).
If I try the following option:

FFLAGS= -m64 -heap-arrays -override-limits -O3 -fp-stack-check -check all

Everything compiling well and the run gives the good results (but of course it runs really slowly).

If I try to use

FFLAGS= -m64 -heap-arrays -fast

or even

FFLAGS= -heap-arrays -O3

It crashes with

forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image PC Routine Line Source
sedsim8 000000010015A258 Unknown Unknown Unknown
sedsim8 0000000100177DAE Unknown Unknown Unknown
sedsim8 000000010009D54C Unknown Unknown Unknown
sedsim8 0000000100000CCC Unknown Unknown Unknown
sedsim8 0000000100000C64 Unknown Unknown Unknown

I try to increase the stack size under mac with:

ulimit -Ss unlimited

ulimit -c unlimited

But the problem remains.

I had a try with g95 (option:FFLAGS= -O2 -funroll-loops) and the program compiles and runs (around 5 times faster than the ifort not optimised).

Do you have any ideas to speed up the code and is there a problem with the mac installation of intel fortran compiler?

Cheers

0 Kudos
3 Replies
Ron_Green
Moderator
1,100 Views
What version of Xcode do you have installed? Check the first post on this forum regarding the Xcode 3.2.2 problem.
0 Kudos
jpapp
Beginner
1,100 Views
You cannot change the stacksize limit passed 64Mb on a Mac. I notified Apple about this but they basically shrugged. That being said, not sure that -heap-arrays will actually work on a Mac. The only way to test is to replace any colon driven implicit loops, which use stack storage, into explicit loops, i.e.,

a(1:20,1:50,1:25)= b(1:20,1:50,1:25)

with

do k=1,25
do j=1,50
do i=1,20
a(i,j,k)=b(i,j,k)
enddo
enddo
enddo

G95 may be doing this automatically with -funroll-loops.

John
0 Kudos
Ron_Green
Moderator
1,100 Views
-heap-arrays does work with the Mac OS compiler.

If none of these suggestions help, you can open an issue at premier.intel.com (if you have an active support license) OR post the files here so we can test it.

ron
0 Kudos
Reply