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

Compile Errors

Intel_C_Intel
Employee
1,155 Views
The following code:
INTEGER*4, PARAMETER :: KEY_SIZE= 4 INTEGER*4, PARAMETER :: MAX_MEM= 256
STRUCTURE/ dy_item_def /
INTEGER*4ival(CLASS_REC_SIZE)
END STRUCTURE
STRUCTURE/ dy_stream_def /
INTEGER*4ival(FLUID_REC_SIZE)
END STRUCTURE
INTEGER*4a_shared_item(CLASS_REC_SIZE * MAX_MEM) POINTER (p_dy_item, a_shared_item)
INTEGER*4a_shared_stream(FLUID_REC_SIZE * MAX_MEM) POINTER (p_dy_stream, a_shared_stream)
INTEGER*4a_shared_item_key(KEY_SIZE * MAX_MEM)
POINTER (p_dy_item_key, a_shared_item_key)
INTEGER*4a_shared_stream_key(KEY_SIZE * MAX_MEM)
POINTER (p_dy_stream_key, a_shared_stream_key)
COMMON/ DISPLAYSHR / a_shared_item, a_shared_stream, a_shared_item_key, a_shared_stream_key
COMMON/ POINTERSHR / p_dy_item_key, p_dy_item, p_dy_stream_key, p_dy_stream
produces the following errors:
.InclMEMSHARE.CMN(47) : Error: Conflicting attributes or multiple declaration of name. [A_SHARED_ITEM]
COMMON / DISPLAYSHR / a_shared_item, a_shared_stream, a_shared_item_key, a_shared_stream_key -------------------------------^
.InclMEMSHARE.CMN(47) : Error: Conflicting attributes or multiple declaration of name. [A_SHARED_STREAM]
COMMON / DISPLAYSHR / a_shared_item, a_shared_stream, a_shared_item_key, a_shared_stream_key ----------------------------------------------^
.InclMEMSHARE.CMN(47) : Error: Conflicting attributes or multiple declaration of name. [A_SHARED_ITEM_KEY]
COMMON / DISPLAYSHR / a_shared_item, a_shared_stream, a_shared_item_key, a_shared_stream_key ---------------------------------------------------------------^
.InclMEMSHARE.CMN(47) : Error: Conflicting attributes or multiple declaration of name. [A_SHARED_STREAM_KEY]
COMMON / DISPLAYSHR / a_shared_item, a_shared_stream, a_shared_item_key, a_shared_stream_key ----------------------------------------------------------------------- -----------^
They aren't declared anywhere else, so what are the conflicting attributes???
(apologies for the spacing, the forum wouldn't let me use CODE tags!)
0 Kudos
7 Replies
Intel_C_Intel
Employee
1,155 Views

OK

"A pointee cannot appear in a COMMON"

Is this new? Or a new or more strict compiler?I'm trying to compile code that used to work...I'm on 6.6C...

0 Kudos
Intel_C_Intel
Employee
1,155 Views
Can I make my arrays 'COMMON' (i.e, shareable between routines, not COMMON specifically)and pointees in a MODULE?
0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,155 Views

The restriction seems reasonable -- COMMON isby definition static, while Cray pointees are by definition "movable".

The answer to your second question really depends on what is done with these variables. I've never foundthat Cray pointers are necessary in pure Fortran-90 code (no C or Windows API interaction); allocatables and/or pointers within modules have always worked for me. So, my first impulse is to suggest rewriting everything to standard, readable & portable module/allocatable, unless

a) it's really lot of code which you don't feel like touching or

b) it does some nasty type conversions between pointed memory and pointee variables (effectively EQUIVALENCE-ing apples and oranges)

Jugoslav

0 Kudos
Steven_L_Intel1
Employee
1,155 Views
I don't think this is new.
A pointee, by definition, has no storage allocated to it by the compiler. It is a "virtual variable", if you will, whose location is determined solely by the address in its corresponding pointer variable.
A variable in COMMON has a static address, unchangeable. This conflicts with the status of being a pointee. The combination just doesn't make sense.
0 Kudos
Intel_C_Intel
Employee
1,155 Views

Jugoslav & Steve,

As I said, this code used to work a while ago (I guess under 6.0?), and is unchanged.It is for shared memory stuff.

The pointers are used thus:

p_dy_item = MAPVIEWOFFILE(...)

Which would make the 'a_shared_item' array the 'contents' of the memory file.

To be honest I'm not sure if I need the arrays in a common block (the code compiles fine if I comment that common block out), its just that's how I inherited the code...

Should I be using the FORTRAN 90/95 type of POINTER? (which to be honest, I don't grasp at all, even having read the documentation).

Will the association through the Cray pointer keep my data in the memory file static?

0 Kudos
Jugoslav_Dujic
Valued Contributor II
1,155 Views
Got it. I don't recall at the moment exact mechanics of MapViewOfFile/CreateFileMapping, but that's a common trick for sharing data among processes.
I don't think you need pointees in commons at all. Real memory,IIRC,is allocated by CreateFileMapping. Cray pointees are then only "equivalenced" with it by means of pointer-assignment. Thus, it would suffice to have pointers (p_ stuff) in a common, and only INCLUDE a file with declarations of pointees (a_) stuff. Alternatively (as I'd prefer), you could put all declarations (p_ and a_) in a MODULE andUSE it.
Jugoslav
0 Kudos
Intel_C_Intel
Employee
1,155 Views
Thanks Jugoslav... that sounds good and relatively simple. We'll see how it works out :)
0 Kudos
Reply