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

Complexity of functions ?potrs, ?potrf and cblas_dgemm


Dear MKL forum,

I'm using the functions "?potrf" for Cholesky factorization of a matrix and "?potrs" for solving a linear equation system. Additionally I need the function "cblas_dgemm" (matrix multiplication) for further calculations. These functions are used in a distributed system with multiple servers, but I need the exact complexity for each of these algorithms for optimal load balancing (see: big O notation). I don't prefer to use the complexities given in common literature because the MKL functions are optimized and don't work with the common complexities.

Can you help me out?

Best regards

0 Kudos
2 Replies

Hi Fabian, 

It is good question, I guess i understand your questions, but I'm afraid that they likely lead to some ambiguity about algorithm complexity and MKL optimization.   

Actually, MKL function like cblas_dgemm etc, we don't change the algorithm complexity.  The  principle for  optimize the MKL function is to  maximumly utilize hardware resource, for example, vectorized ( fully use SIMD introduction), threaded. (all core are used).  

The "?potrf  and cblas_dgemm  are vectorized and threaded, and be multi-core ready.  So if you use these functions in a distributed system with multiple servers, unless you wrote high-level threads (like MPI process) to distribute the task, in most of case, you can call them directly and get the multi-cores used with good performance.  

If you do want distribute task your self,  for example,  5 1000x1000 cblas_dgemm  on one sever and  2 12500x12500 cblas_dgemm on another server, if you may worry about the imblance,  you can consider the relationship like algorithm complexity vs.hardware resource etc.  But you can image it is not linear, even no exact formula to discrible it. So i may recommend to use system profile tools, for example, if Intel MPI program, you use the ITAC to profile and adjust the workload.  

Best Regards,




Thank you very much!