- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Hi people,
I am struggling with the threading of SGEMM in MKL called from C++. I am working on a rather big software that is parallelized with OpenMP. In one of the functions, I first set up matrices A (14000,1300) and B (1300,14000) within an OpenMP loop, and then want to calculate the product.
#pragma openmp parallel for
for (.....){ fill A,B }
C=prod(A,B);
prod() is supposed to call SGEMM. I also tried cblas_sgemm directly. In both cases, SGEMM is executed on one thread only, even though in other parts of the code, MKL calls to LAPACK are threaded. Any idea of why it switches to serial here?
Link kopiert
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Bjoern,
pls try to set mkl_set_num_threads( #num of cores on your system ) before C=prod(A,B).
What would you see in then case?
- Als neu kennzeichnen
- Lesezeichen
- Abonnieren
- Stummschalten
- RSS-Feed abonnieren
- Kennzeichnen
- Anstößigen Inhalt melden
Thanks Gennady,
turns out it was not a problem with MKL but with cmake caused linking of both GSL and MKL cblas, and the overloaded prod() took SGEMM from GSL...
I have another question regarding parallelization: Currently I have a construction:
#pragma omp parallel for
for ( int i =0 , i < mtot; i++) {
B = ub::prod(A, B[ i ]);
}
Is it advisable to do this? Will every OMP thread try to execute a threaded prod()? Then I assume that means threads getting into conflict. In my case, A is 2700x2700 and each B 2700x2300 matrix.
- RSS-Feed abonnieren
- Thema als neu kennzeichnen
- Thema als gelesen kennzeichnen
- Diesen Thema für aktuellen Benutzer floaten
- Lesezeichen
- Abonnieren
- Drucker-Anzeigeseite