We are using this LAPACKE_dgesv (MKL function) in order to solve a linear system with dense coefficient matrix.
Sometimes the matrix is unbalanced (too different values), so bad conditioned! in this case results can be wrong.
Is there any mkl function that can alert about this situation, before running the solver?
there are a number of lapack's outines for estimating the condition number of a matrix. please have a look at the gecon() as an example. You may check the cond number of your case in advance solving the system.
or you may try to play with gerfs() routine which performs an iterative refinement of the solution to a system of linear equations