Recommend this
on Google+

Recommend this
on Google+

Tuesday, June 19, 2012

IBM Systems Magazine - 64-Bit Addressing for Technical Applications

IBM Systems Magazine - 64-Bit Addressing for Technical Applications

An application’s memory requirements must be considered when compiling and building applications. A 32-bit addressing model may be sufficient for applications with relatively small memory requirements, but may be insufficient for those with larger memory requirements.




As computers run faster, technical computational problems, inevitably, grow larger. In many of today's high-performance computing (HPC) applications or codes, 32-bit addressing may no longer be able to contain the data needed during a computation



64-bit addressing (-q64) has been available on IBM RISC processors and in AIX* for several years. While 32-bit addressing is still available--and it remains the default option--all objects and executables compiled and loaded with -q32 are limited to a maximum of 2 GB data and heap space. In contrast, objects and executables compiled and loaded with -q64 have no such practical software limits.



Let’s examine some common issues with 64-bit addressing mode applications:



Floating-point accuracy and -q640--64-bit addressing has absolutely no effect on the accuracy of floating-point computations. Accuracy is controlled by the declarations used in a compilation unit regardless of the size of the address pointer. In Fortran, a REAL*8 declared word uses 64-bits to represent a floating-point number; REAL*4 represents a floating-point number with 32-bits. In C or C++, a float is 32-bits and a double is 64-bits.



Code comparisons--In Fortran, the only major change is if you use the POINTER(A,B) construct, the size of the POINTER changes. This is only important if the application manipulates these pointers in some manner or if the application uses the LOC () function to get an address or set a pointer.



In C, the major change going from -q32 to -q64 is that the size of the C long variable changes from 32- to 64-bits. That is:



printf("The size of a long is %d bytes\ n",sizeof (long))



Of course, this change can have implications for C code that isn't perfectly written in terms of casting or using pointers.



All objects and executables compiled and loaded with -q32 are limited to a maximum of 2 GB data and heap space. In contract, objects and executables compiled and loaded with -q64 have no such practical software limits.