Your application calls scalar instead of vectorized versions of math functions. To fix: Do all of the following:
- Upgrade the Glibc library to version 2.22 or higher. It supports SIMD directives in OpenMP* 4.0 or higher.
- Upgrade the GNU* gcc compiler to version 4.9 or higher. It supports vectorized math function options.
- Use the -fopenmp and -ffast-math compiler options to enable vector math functions.
- Use appropriate OpenMP SIMD directives to enable vectorization.
Note : Also use the -I/path/to/glibc/install/include and -L/path/to/glibc/install/lib compiler options if you have multiple Glibc libraries installed on the host.
gfortran PROGRAM.FOR -O2 -fopenmp -ffast-math -lrt -lm -mavx2...
!$OMP SIMD
do i=1,N
...gfortran PROGRAM.FOR -O2 -fopenmp -ffast-math -lrt -lm -mavx2program main
parameter (N=100000000)
real*8 angles(N), results(N)
integer i
call srand(86456)
do i=1,N
angles(i) = rand()
enddo
!$OMP SIMD
do i=1,N
results(i) = cos(angles(i))
enddo
end