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

Array descriptor format?

grg99
Beginner
649 Views
Okay, I know it's not a good idea to dig into things like this, BUT:

I'm writing an allocation tracker. It insinuates itself so it gets called on allocate and deallocate statements, and it keeps track of memory usage.

I'm able to extract the obvious info from the array descriptors, such as number of dimensions, elements, and element sizes. But the flags word has me mostly stumped. There seems to be a flag in bit 0, another one in bit 2, another one in bit 4. But the compiler goes to lots of trouble to stuff $82 in the high byte too.

Any info on what all these bits mean?

And has this info changed from version to version? I'm using 9.1.


Thanks!


0 Kudos
3 Replies
Steven_L_Intel1
Employee
649 Views
The format is documented in the Building Applications manual, chapter on mixed language programming. I have a side task to provide clearer documentation - what is there is usable but is a bit hard to decipher in places. I'm not aware of the high byte of the flags word being used for anything (but I'll check my sources tomorrow and verify that.)

The format has not changed since 8.0 (and we'll strongly resist anyone telling us to change it.) It IS different on the 64-bit platforms (every field is 64-bits). And it is different from CVF.
0 Kudos
grg99
Beginner
649 Views
>I'm not aware of the high byte of the flags word being used for anything (but I'll check my sources tomorrow and verify that.)

Oops, those are bits I gleaned from looking at CVF 6.x output! IVF 9.1 doesnt set those bits up there. And you call _for_allocate DOT, CVF didnt use the dot. Otherwise the bits seem mostly similar.

Thanks,


George





0 Kudos
Steven_L_Intel1
Employee
649 Views
The flag bits defined are:

0 - descriptor is valid (associated() is true)
1 - descriptor points to something that cannot be deallocated (array section, etc.)
2 - descriptor points to contiguous memory
all others reserved and must be zero

Fields (all either 32 or 64 bits accordingly)

A0 (address of array(0,0,0,0...)
size of one array element
offset from A0 to actual start of array
flags
number of dimensions
reserved (must be initialized to zero)

This is followed by an array of bounds information groups, one for each dimension, with fields:

extent
inter-element spacing
lower bound

0 Kudos
Reply