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

Alignment of ALLOCATABLES

Keith_R_
Novice
590 Views
Is there any method to specify data alignment requirements for allocatable arrays? I need this to be able to call FFTW routines when the FFTW library is compiled to use SSE2 instructions. I believe there is a 32-byte alignment requirement in this case. My code definitely crashes when linked against an sse3 version of FFTW but is OK with a non-sse2 version. According to the man page the "-align" option can be used to set alignment for common blocks, derived types and record structures. But no mention is made of allocatables. Is this under control of the compiler, or of the underlying system malloc? I'll be grateful for any suggestions which don't involve butchering the code and replacing allocate statements with something non-portable. Keith Refson
0 Kudos
3 Replies
Steven_L_Intel1
Employee
590 Views
!DEC$ ATTRIBUTES ALIGN is supported for ALLOCATABLE arrays in current compiler versions.
0 Kudos
Keith_R_
Novice
590 Views
Thanks. Does this also apply to pointer array components
of derived types? If so can it be applied at the type
definition? Changing every instance would mean inserting directives at an infeasibly largme number of declarations.

Keith Refson
0 Kudos
Steven_L_Intel1
Employee
590 Views
No, it doesn't. Sorry. It applies to variables only.
0 Kudos
Reply