Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Question concerning 64 bit on IA64

drb
Beginner
742 Views
Hello,

I have compiled our code on an ItaniumII RedHat system, using the intel compilers. This code was originally compiled on 32 bit platforms (win/linux/etc). My question is this:

We use the LOC function, defined as Integer*4. What size will this be in 64 bit? Do I need to define anything differently, when using the Fortran ALLOCATE functions to take advantage of the 64 bit platform (>2GB arrays).

Getting a little confused, if anyone has any links to help it would be much appreciated!

Thanks

Ben
0 Kudos
5 Replies
TimP
Honored Contributor III
742 Views
In the Fortran Language reference .pdf which comes with the compilers, it defines LOC as INTEGER(KIND=8) for IPF.
0 Kudos
Steven_L_Intel1
Employee
742 Views
Intel Fortran defines an intrinsic function INT_PTR_KIND which can be used in declarations for integer pointers to get the right "kind" for use with LOC. For example:
integer (kind=int_ptr_kind()) my_pointer
Addresses are 64-bits on Itanium-based systems as well as the new Intel EM64T-based systems.
0 Kudos
drb
Beginner
742 Views
Thanks for the quick replies. I am interested in the INT_PTR_KIND, but a little unsure how I could use this. My definitions are:

INTEGER(INT4),DIMENSION(:),POINTER :: MT
REAL (REAL8),DIMENSION(:),POINTER :: VR

Where INT4 and REAL8 are defined as:

INTEGER, PARAMETER :: INT4 = SELECTED_INT_KIND (6)

! FOR SINGLE PRECISION
INTEGER, PARAMETER :: REAL8 = SELECTED_REAL_KIND (6,30)

Can I use these intrinsic functions to get the correct kind to take advantage of th 64bit platforms?

Thanks again

Ben
0 Kudos
Steven_L_Intel1
Employee
742 Views
You are using the Fortran 90 POINTER feature, in which case the compiler handles this all for you automatically. The INT_PTR_KIND intrinsic would be useful when you want to store an address in an INTEGER variable, and therefore you need to declare the INTEGER variable as the right size. As long as you're not using LOC (or %LOC), or routines such as malloc and free, you typically don't need to know the address size.
Even if you are using LOC, if you used the "integer pointer extension", with syntax such as:
POINTER (P, V)
then the compiler properly declares P to be an integer of the correct size. You would want INT_PTR_KIND if you were storing an address in an array or derived type component - a context where theinteger pointerextension is not permitted.
0 Kudos
drb
Beginner
742 Views
I see, elsewhere we do use LOC, so I will make sure that it is defined with INT_PTR_KIND and not INT4.

Thanks!

Ben
0 Kudos
Reply