Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

Parallel execution of HEGVD (OpenMP)

Lars_Pastewka
Beginner
347 Views
Hi everybody,

I'm quite new to MKL and LAPACK, however, I'm trying to execute the following piece of code on an SGI Altix (Itanium2):

!$omp parallel do default(private) shared(tb, S2, failed)
do k = 1, tb%nk
S2(:, :, k) = tb%S(:, :, k)
call hegvd(tb%evecs(:, :, k), S2(:, :, k), tb%evals(:, k), jobz='V', info=info)
if (info /= 0) then
!$omp critical
failed = .true.
!$omp end critical
endif
enddo
!$omp end parallel do

S2, tb%evecs are complex matrices, tb%evals is real (double precision). It works perfectly when running with a single thread, I do however get a segfault when using multiple threads. Am I doing something wrong are is MKL not thread-safe for HEGVD?

Thanks for your help!

Lars
0 Kudos
3 Replies
hajek
Beginner
347 Views
at line 3 you assign to a shared array S2 in each cycle. It looks like it should have been private.
0 Kudos
TimP
Honored Contributor III
347 Views
Did you set the environment variable MKL_SERIAL=yes , in accordance with the recommendation to start parallel threads either outside or inside MKL functions, but not both ways?
I'm wondering whether implicitly creating temporary argument vectors for each call is the best way.
0 Kudos
Lars_Pastewka
Beginner
347 Views
I tried using MKL_SERIAL=yes with the same outcome. I actually also tried to use the F77 interface and create a seperate work area for each thread manually. In that case, I do not get a SEGFAULT, it rather boils out with an MKL error complaining some matrix is malformed (different error and different location every time, so that sort of hints that there is some information that is shared between the threads although it shouldn't).

Lars
0 Kudos
Reply