I wonder if there is some way to make MKL routine working as #pragma omp for schedule(dynamic) in OpenMP.
as I'm using Sparse BLAS doing SpMV, and for some reason I deside to reorder the rows of a sparse matrix by length. This results in the workload for internal threads in MKL being unbalanced, since SpMV in MKL is parallelized by row, and probably static scheduled.
if there's some function controlling the schedule strategy of internal threads that i don't know, it would be great.
(MKL_DYNAMIC is intended for dynamic thread number control, not for workload balancing)
jimdempseyatthecove wrote:Finally i get rid of this problem by writing my own spmv code, and it works well. But thank you and Tim, anyway~
Until the default schedule reset becomes available or KMP_SCHEDULE=... you might see if you can partition your matrix operation.
An enhancement of this, *** TimP may be able to confirm this, is consider using an outer parallel region with a single secton that partitions the matrix operation launching tasks. Something like:
call YourPartitioning(i,A,B,C) ! partition number + array args
!$omp end task
!$omp end single
!$omp end parallel