Use a Glibc library with vectorized SVML functions

Your application calls scalar instead of vectorized versions of math functions. To fix: Do all of the following:

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.

Example

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 -mavx2
program 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

Read More