Community
cancel
Showing results for 
Search instead for 
Did you mean: 
teanku
Beginner
78 Views

openmp & mkl: getri inside $omp do trouble

Hello!

I'm using IVF Compiler 11.0.066 and MKL 10.1

So, I have this subroutine which is called from parallel $omp do cycle. In this subroutine I calculate inverse of a matrix, like this:

    call getrf(Matrix, ipiv)
    call getri(Matrix, ipiv)
 

everything works great in sequential execution, but when there are more than one thread application crashes at call getri(Matrix, ipiv) with exceptions like "heap corruption" or "access violation"

when I modify this code like this:

    call getrf(Matrix, ipiv)
    !$omp critical
    call getri(Matrix, ipiv)
    !$omp end critical

everything works in parallel execution, but obviously this is a bad solution

why this is happening and how should I change my code to make it work without $critical section?

0 Kudos
5 Replies
teanku
Beginner
78 Views

and the save problem with syevd, which I need to calculate eigenvalues/eigenvectors :(

TimP
Black Belt
78 Views

Did you try suggestions in references on this subject, including adjustments to shell stacksize and OMP_STACKSIZE, as well as ifort -heap-arrays?  

Gennady_F_Intel
Moderator
78 Views

in the case   #pragma omp parallel, have you use private clauses for input arrays?

 

 

teanku
Beginner
78 Views

Gennady Fedorov (Intel) wrote:

in the case   #pragma omp parallel, have you use private clauses for input arrays?

It is my understanding that every local variable in subroutine which being called from parallel section is private anyway, no?

roughly, my code looks like

[fortran] $omp parallel default(shared)&
!$omp private(private_vars)

!$omp do schedule(static,1)
do i=1,10
call work(private_vars,shared_vars)
end do
!$omp end do
!$omp end parallel


subroutine work(private_vars, shared_vars)
...
!local variables
real Matrix(n,n)
integer ipiv(n)

call getrf(Matrix, ipiv)
call getri(Matrix, ipiv)
end subroutine work

[/fortran]

teanku
Beginner
78 Views

I managed to avoid this problem by using FORTRAN77 interface for getrf/getri/syevd

anyway this is strange when usage of F90/95 interfaces leads to appcrash

 

Reply