PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Course

segmentation error with -fast option

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
mellore



Joined: 08 Aug 2007
Posts: 1

PostPosted: Wed Jan 20, 2010 2:08 am    Post subject: segmentation error with -fast option Reply with quote

Hi everyone,

I have a segmentation error appearing with a code compiled with -the -fast option, but the execution is going well when the code is compiled with -C, -O or even no option. Can someone help me understand why? I'm new in the forum and I haven't seen this before.

Many thanks in advance
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6616
Location: The Portland Group Inc.

PostPosted: Wed Jan 20, 2010 9:20 am    Post subject: Reply with quote

Hi mellore,

When an application encounters a segmentation violation at higher optimization but not lower optimization it's typically caused by the compiler performing some transformation. This transformation may be incorrect (i.e. a compiler error), correct but not appropriate for your application, or correct but a programing error is exposed when the transformation is applied.

"-fast" is an aggregate flag composed of " -O2 -Munroll=c:1 -Mnoframe -Mlre -Mautoinline -Mvect=sse -Mscalarsse -Mcache_align -Mflushz -Mpre -Msmart" with slight variations between platforms. You can try starting at "-O2" (same as -O) and begin adding optimizations until the segv occurs. This will give you the what but not why.

To determine why, add the "-gopt" flag to create a binary with optimized debug information enabled. Next, run your program within the PGI debugger, "pgdbg". The program should abort at location of the segv. Note debugging optimized code can be difficult since code can be rearranged due to optimizations.

If you're really daring, you can add "-Mkeepasm -Manno" to keep the assembly file and compile with and without the offending optimization. Diffing the two assembly files will show what optimization occurred.

If this is a bit much and the application isn't too big, feel free to send a report to PGI Customer Service (trs@pgroup.com) and ask them to forward the code to me.

Hope this helps,
Mat
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group