- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
and the save problem with syevd, which I need to calculate eigenvalues/eigenvectors :(
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you try suggestions in references on this subject, including adjustments to shell stacksize and OMP_STACKSIZE, as well as ifort -heap-arrays?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
in the case #pragma omp parallel, have you use private clauses for input arrays?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page