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

MATMUL, allocatable arrays, parallelization

hermannl
Beginner
483 Views

Hi all,

we are facing a problem with a call to MATMUL. The setup is similar to the following:

REAL*8, ALLOCATABLE, DIMENSION (:,:) :: v

REAL*8, ALLOCATABLE, DIMENSION (:) :: rs,temp

ALLOCATE(v(n,m), temp(n), rs(m+1))

...

DO i=1,m

temp = MATMUL(v(:,1:i), rs(1:i))

ENDDO

...

If the above code snippet is compiled with -i8 -O3 -xW -parallel -heap-arrays, the line with MATMUL is parallelized, but the result is wrong. It is correct if the single line is broken up into a DO-loop in the form

temp = temp + v(:,j)*rs(j)

It is also correct, if -parallel is omitted. And, ifanother twoallocatable arrays are introduced and the critical code is replaced according to

ALLOCATE (v2(n,i),rs2(i))

temp = MATMUL(v2,rs2)

DEALLOCATE(v2,rs2)

everthing works fine - incl. parallelization.

I also included some debug output to check arrays just before and after the MATMUL opperation. These show that up to the MATMUL call everything is as it should be; however, directly after MATMUL the temp arrays are different. So, there seems to be a problem with the array sections, MATMUL, and parallelization. Has anybody encountered a problem like this?

Best,

Hermann

0 Kudos
1 Reply
Steven_L_Intel1
Employee
483 Views
Please send a test case to Intel Premier Support so that it can be investigated.
0 Kudos
Reply