Dear all,
when compiling the following demo code
program collapse implicit none real, dimension(1000) :: data1 = 1.0e0 real, dimension(100,10) :: data2 = 1.0e0 integer :: i,j !$omp parallel do simd do i=1,size(data1,1) data1(i) = data1(i) + 1.0e0 end do !$omp end parallel do simd !$omp parallel do do i=1,size(data1,1) data1(i) = data1(i) + 1.0e0 end do !$omp end parallel do !$omp parallel do simd collapse(2) do j=1,size(data2,2) do i=1,size(data2,1) data2(i,j) = data2(i,j) + 1.0e0 end do end do !$omp end parallel do simd !$omp parallel do collapse(2) do j=1,size(data2,2) do i=1,size(data2,1) data2(i,j) = data2(i,j) + 1.0e0 end do end do !$omp end parallel do end program collapse
with
ifort (IFORT) 14.0.3 20140422
Copyright (C) 1985-2014 Intel Corporation. All rights reserved.
under
Ubuntu 12.04.4 LTS
running on a
Intel(R) Core(TM) i5-3470 CPU @ 3.20GHz
I receive the following messages:
$> ifort -openmp -openmp_report2 -vec_report2 collapse.f90 -o collapse
collapse.f90(9): (col. 9) remark: OpenMP DEFINED LOOP WAS PARALLELIZED
collapse.f90(15): (col. 9) remark: OpenMP DEFINED LOOP WAS PARALLELIZED
collapse.f90(21): (col. 9) remark: OpenMP DEFINED LOOP WAS PARALLELIZED
collapse.f90(29): (col. 9) remark: OpenMP DEFINED LOOP WAS PARALLELIZED
collapse.f90(10): (col. 3) remark: OpenMP SIMD LOOP WAS VECTORIZED
collapse.f90(16): (col. 3) remark: LOOP WAS VECTORIZED
collapse.f90(25): (col. 5) remark: loop was not vectorized: statement cannot be vectorized
collapse.f90(22): (col. 3) warning #13379: loop was not vectorized with "simd"
collapse.f90(30): (col. 3) remark: loop was not vectorized: existence of vector dependence
Is there a reason she the loop (imp parallel do sims collapse(2)) starting at line 21-22 cannot be parallelized and vectorized, whereas the one at line 9-10 can be parallelized and vectorized? If so, can I add some more instructions to make this happen?
Thank you in advance,
Matthias