- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
!DEC$ ATTRIBUTES ALIGN is supported for ALLOCATABLE arrays in current compiler versions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, it doesn't. Sorry. It applies to variables only.

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