PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Questions when using pgf90 on AMD64

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



Joined: 02 Aug 2004
Posts: 1

PostPosted: Tue Aug 03, 2004 9:30 pm    Post subject: Questions when using pgf90 on AMD64 Reply with quote

Questions when using pgf90 on AMD64
1.when I compile the FORTRAN source code in 32-bit, the variables are all initialized to zero by default. This is what I want. But when I compile the FORTRAN source code in 64-bit, then the variables cannot be initialized by default. Are there some switches to force the compiler to initialize the variable, or some tools to help me find which variable was used before initialized? This is important to me, because some old software running correctly in 32-bit when the variables are not initialized by hand. If find which variable was used before initialized by hand when porting 32-bit to 64-bit, it will be loaded down with trivial details.

2.why pgf90 do not support the data type real*16? If so, what is superiority of 64-bit?

Details:
Compiler: pgf90 v.5.2
OS: Turbo Linux 2.4.21-4smp 64 bit
Hardware: Opteron 2.4G

Wenley
wenley@etang.com
Back to top
View user's profile
mleair



Joined: 19 Jul 2004
Posts: 67
Location: Portland Group

PostPosted: Wed Aug 04, 2004 10:41 am    Post subject: questions on pgf90 and AMD64 Reply with quote

Hi,

1. There is not a magic switch to do this for you. The closest to a magic switch is -Msave, but I have a feeling that won't help you since -Msave says to treat each variable as if it had the save attribute. Still, for simple examples, they will be initialized to zero the first time they are used. As a safer alternative, you could put your variables into a common block or a module and they will be initialized to zero.

2. pgf90 currently does not support real*16. The superiority of 64-bit comes from the fact that 64-bit allows use of the medium memory model and large arrays. So, your program's data can be larger than 2GB. 64-bits also allow more machine instructions, registers and a larger word length, so programs will usually run faster on 64-bits than 32-bits. However, there are some exceptions (see the article on the medium memory model in this forum for example).

I hope this helps,

-Mark
Back to top
View user's profile
mwolfe



Joined: 13 Jul 2004
Posts: 20

PostPosted: Thu Aug 05, 2004 2:22 pm    Post subject: Reply with quote

REAL*16 would require support for 128-bit floating point arithmetic. Since neither AMD64 nor EM64T support native 128-bit floating point, this would all have to be done in library routines, which would be unacceptably slow.
Back to top
View user's profile
mleair



Joined: 19 Jul 2004
Posts: 67
Location: Portland Group

PostPosted: Thu Aug 12, 2004 6:11 pm    Post subject: more on save Reply with quote

You can use the save statement or attribute in a routine to initialize certain variables to zero too. However, keep in mind that when you introduce initialization through -Msave or a save statement, you are introducing additional overhead for the initialization. So, use these tools wisely. :)

-Mark
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