| United States-English |
|
|
|
![]() |
HP Fortran Compiler for HP-UX: HP Fortran Programmer's Reference > Chapter 5 Data
types and data objectsResolving issues with unaligned data |
|
The following suggestions will aid with issues regarding unaligned data: As a quick fix, add the following call to the main program: call allow_unaligned_data_access( ) Then, link in an additional library that fixes these alignment issues at runtime: -lunalign Longer term, try compiling with the following flag: +allow_unaligned An example would be:
Then compile with: /opt/fortran90/bin/f90 foo.f -lunalign +noppu If you need to drop the +noppu, then add an alias directive as follows: !$HP$ALIAS allow_unaligned_data_access=’allow_unaligned_data_access’
Then compile with: /opt/fortran90/bin/f90 foo.f -lunalign
If the misaligned data might be passed to routines which are not compiled with +allow_unaligned (for example, Fortran runtime IO and F90 libraries), then having the call will allow the runtime fixes to happen which will prevent bus errors in your application. To realize optimum performance, try and measure the following two options:
Option #1 may perform faster with very few references to misaligned data and a handler is invoked for these misaligned references. #2 may perform faster with many references. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||