Quantcast
Channel: Recent posts
Viewing all articles
Browse latest Browse all 415

allocatable arrays in modules has unaligned access on Xeon Phi

$
0
0

Hi everyone,  

As the title said, an array from my modules is said to have unaligned access.  
It's something like this:

module some_module
...
real(dp), allocatable :: a(:,:)
!dir$ attributes align:64 :: a
...
end module some_module

It gives me unaligned access problem:

            remark #15389: vectorization support: reference some_module_mp_a_ has unaligned access

As far as I can tell from articles Data Alignment to Assist Vectorization and Fortran Array Data and Arguments and Vectorization, that is not the right thing to do. Another similar thread "Ifort array alignment problem" has the suggestion to use assume_aligned.

I tried this way, in another file:  

subroutine some_subroutine

use some_module
...
!$omp parallel do private(...) schedule(...)
!dir$ assume_aligned a:64
do i = 1, n
    a(:,i) = 0.0d0
    do j = 1, n
        ! update a(:,i) here
    enddo
enddo
!$omp end parallel do
...
end subroutine some_subroutine

Compiling with version 16.0 gives me this error:

error #8018: The memory reference associated with an ASSUME_ALIGNED directive must not be in COMMON, a field reference, use associated, or host associated.

While compiling with version 17.0 works but it still says unaligned access in the report.

I complied all of them with -align array64byte. As far as I understand, aligned access with allocatable arrays from modules has problems. I originally assumed it's because of the OpenMP's clauses, but removing them doesn't change the report. Did I misunderstood something? 


Viewing all articles
Browse latest Browse all 415

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>