Skip to content

Commit 0931a59

Browse files
Replaced deprecated function.
1 parent 38089b4 commit 0931a59

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

Solver/src/libs/jacobian/CSRMatrixClass.f90

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@ subroutine mkl_dcsrgemv(transa, m, a, ia, ja, x, y)
6969
integer :: ia(*), ja(*)
7070
real(kind=RP) :: x(*), y(*)
7171
end subroutine mkl_dcsrgemv
72-
end interface
73-
72+
end interface
7473
!
7574
!========
7675
CONTAINS
@@ -768,14 +767,17 @@ end subroutine CSR_MatMatMul
768767
! -> v needs to be allocated beforehand
769768
! ----------------------------------------------------
770769
function CSR_MatVecMul( A,u, trans) result(v)
770+
#ifdef HAS_MKL
771+
use MKL_SPBLAS, only: SPARSE_OPERATION_NON_TRANSPOSE
772+
#endif
771773
implicit none
772774
!-arguments--------------------------------------------------------------------
773775
class(csrMat_t) , intent(inout) :: A !< Structure holding matrix
774776
real(kind=RP) , intent(in) :: u(A % num_of_Cols) !< Vector to be multiplied
775777
logical, optional, intent(in) :: trans !< A matrix is transposed?
776778
real(kind=RP) :: v(A % num_of_Rows) !> Result vector
777779
!------------------------------------------------------------------------------
778-
integer :: i,j
780+
integer :: i,j,stat
779781
REAL(KIND=RP) :: rsum
780782
character(len=1) :: transInfo
781783
!------------------------------------------------------------------------------
@@ -796,6 +798,10 @@ function CSR_MatVecMul( A,u, trans) result(v)
796798

797799
#ifdef HAS_MKL
798800
! CALL mkl_dcsrgemv(transInfo, A % num_of_Rows, A % Values, A % Rows, A % Cols, u, v)
801+
! This call was changed because the function mkl_dcsrgemv was deprecated.
802+
! See: https://www.intel.com/content/www/us/en/docs/onemkl/developer-reference-fortran/2023-1/mkl-csrgemv.html
803+
! TODO: Check that the new function performs as expected.
804+
stat = mkl_sparse_d_mv(SPARSE_OPERATION_NON_TRANSPOSE, 1.0_rp, A % mkl_options % csrA, A % mkl_options % descrA, u, 0.0_rp, v)
799805
#else
800806
if (transInfo == 't') error stop "CSR_MatVecMul with 't' only with MKL"
801807
!$omp parallel do private(j,rsum)

0 commit comments

Comments
 (0)