Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29235 Discussions

Apparent bug with vectorization with -xHost

daniel_h_1
Beginner
826 Views
Hello, I'm getting erroneous output for the following program when compiled with ifort -xHost using ifort version 13.1.3 on a computer with Xeon Intel 8-core Sandybridge processors. The program checks the vector, which is comprised of pairs of numbers, (/ 3,1, 3,2, 4,1, 5,1, 6,2, 7,1, 7,2 /) to see which numbers occur only once in the first position in each pair. The second number in the pair is irrelevant but having pairs is required to produce the erroneous output. The first numbers in the pairs are 3,3,4,5,6,7,7. 4, 5, and 6 occur only once. The program should return 0 0 1 1 1 0 0 but returns 0 0 0 1 1 0 0 when compiled with -xHost. When it is so compiled, both loops are vectorized: > ifort -xHost -vec-report bugtest.F90 -o bugtest bugtest.F90(10): (col. 3) remark: LOOP WAS VECTORIZED. bugtest.F90(15): (col. 6) remark: LOOP WAS VECTORIZED. when it is not compiled with -xHost, only the first is: > ifort -vec-report bugtest.F90 -o bugtest bugtest.F90(10): (col. 3) remark: LOOP WAS VECTORIZED. The program is below. I be removing -xHost from my makefile. Best regards, Dan program highspinorder implicit none integer,parameter :: ndof=14, numelec=7 integer :: configlist(ndof) = (/ 3,1, 3,2, 4,1, 5,1, 6,2, 7,1, 7,2 /) integer :: ii,unpaired(numelec),jj unpaired(1:numelec)=1 do ii=1,numelec !!ALWAYS VECTORIZED !!!WORKS do jj=1,numelec !!!WORKS if (jj.ne.ii) then do jj=ii+1,numelec !!FAILS WHEN VECTORIZED (WITH -xHost) if (configlist(jj*2-1).eq.configlist(ii*2-1)) then unpaired(ii)=0 unpaired(jj)=0 endif !!!WORKS endif enddo enddo print *, unpaired(:); stop end program highspinorder
0 Kudos
2 Replies
daniel_h_1
Beginner
826 Views
This is with the AVX instruction set (-xAVX). It works fine with SSE4.2, SSSE3 and all others I tried.
0 Kudos
daniel_h_1
Beginner
826 Views
Nevermind I see this is fixed in version 14.
0 Kudos
Reply