- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the dll interface of my fortran application I am using the non standard construct pointer (p, pointee). The language reference manual says p will be 32 bit on an ia32 and 64 bit on an Itanium. Is there a way to use this feature in a 64 bit environment such as long pointer (p, pointee)? More precisely: Code:
iaz = loc(b(xmap(2,49))) .............. Subroutine sub1 () integer*4 iaz
real*8 ia(1) common /dll/iaz pointer (pia, ia) pia = iaz access to array ia
Is it possible to port this type of code to ia64, by specifying integer*64 and using some tpye of 64 bit pointer in Fortran such as long pointer?
Link Copied
4 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On 64-bit systems, LOC() will return a 64-bit pointer, and in declaration
pointer (pia, ia)
pia will also be 64-bit one. However, iaz in your example is obviously too small, as it's declared as 32-bit.
CVF has (non-standard) INT_PTR_KIND() which returns the Fortran kind number of C pointer (4 on IA32, 8 on IA64). I suggest that you define something like
In this way, you define the C_POINTER only once and retain almost all portability.
HTH,
Jugoslav
pointer (pia, ia)
pia will also be 64-bit one. However, iaz in your example is obviously too small, as it's declared as 32-bit.
CVF has (non-standard) INT_PTR_KIND() which returns the Fortran kind number of C pointer (4 on IA32, 8 on IA64). I suggest that you define something like
MODULE MyKinds
INTEGER, PARAMETER:: C_POINTER = INT_PTR_KIND()
END MODULE MyKinds
...
SUBROUTINE Foo
USE MyKinds
INTEGER(C_POINTER):: iaz
END SUBROUTINE
In this way, you define the C_POINTER only once and retain almost all portability.
HTH,
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thank you very much for your answer.
I presume a xeon processor with Intel 64 Bit Memory technology is a 64 bit system?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, ifort for em64t also chooses a 64-bit integer for INT_PTR_KIND.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is not sufficient to identify the processor. The Xeon processors with EM64T can run as either 32-bit or 64-bit processors, depending on which operating system you load. If you are running Windows x64 editions, and use the Intel EM64T compiler, pointers are 64 bits. Otherwise they are 32 bits.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page