PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

compiler options question
Goto page 1, 2  Next
 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
ephq



Joined: 09 Feb 2005
Posts: 12

PostPosted: Thu Aug 28, 2008 5:04 pm    Post subject: compiler options question Reply with quote

I am compiling some old code with pgf77, and was wondering what some of the compiler options in the makefile were.

Specifically, what does:
-My,120,0x20
-Mx,120,0x20

do? pgf77 -help says "pass x flag to compiler", but I don't know what that means.

Also, is there a compiler flag to control whether data is initialized to zero? Is this done automatically?

Thanks
Back to top
View user's profile
hongyon



Joined: 19 Jul 2004
Posts: 551

PostPosted: Thu Aug 28, 2008 5:15 pm    Post subject: Reply with quote

Hi,

What application is this? We normally don't export x flag to user because an x flag in one release might give the opposite effect on another release.

It looks like it has something to do with generating debugging information.

Hongyon
Back to top
View user's profile
ephq



Joined: 09 Feb 2005
Posts: 12

PostPosted: Thu Aug 28, 2008 6:07 pm    Post subject: Reply with quote

It's a scientific computing application. It's pretty old so I'm not sure what version of pgi it's programmers were using when they wrote it, probably 3.something.
Back to top
View user's profile
ephq



Joined: 09 Feb 2005
Posts: 12

PostPosted: Fri Aug 29, 2008 3:52 pm    Post subject: Reply with quote

I'm just wondering if it's safe to discard them, sounds like it is.

Also, is there a flag to initialize memory to a specific value or zero (like gfortran's -finit-local-zero)? I think this code was programmed with that assumption.
Back to top
View user's profile
mkcolg



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

PostPosted: Tue Sep 02, 2008 9:43 am    Post subject: Reply with quote

Hi eqhq,

Yes, please discard the -Mx/-My flags. "xflags" are used internally by the compiler and in general should not be used by user.

While we do not have and equivalent "-finit-local-zero", the flag "-Msave", which treats all local variables as having the SAVE attribute, has the side effect of initializing local variables to zero when the program is loaded. Note that with SAVE, a variable will retain it's value from the last call to the subroutine and is not re-initialized each time the subroutine is called.

As an aside, you might want to consider updating your code to initialize your local variables. If it's a large application, a utility like Valgrind (www.valgrind.org) can be very helpful in finding uninitialized memory reads (UMRs) which is generally the reason users request a flag like "-finit-local-zero".

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
Goto page 1, 2  Next
Page 1 of 2

 
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