From f6edc11836b9cb2ed20811ba564b92dbc87add56 Mon Sep 17 00:00:00 2001 From: Jeremie Vandenplas Date: Fri, 3 Jul 2026 20:00:37 +0200 Subject: [PATCH 01/10] Support of BLAS helpers --- CMakeLists.txt | 9 ++ Makefile | 5 + src/CMakeLists.txt | 1 + src/Makefile | 3 +- src/modsparse_crs.f90 | 41 ++++++- src/modsparse_helpers.f90 | 234 ++++++++++++++++++++++++++++++++++++++ 6 files changed, 290 insertions(+), 3 deletions(-) create mode 100644 src/modsparse_helpers.f90 diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e0c59b..67c9318 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,6 +89,14 @@ endif() #endif() message(STATUS "Support of MKL PARDISO: ${WITH_MKLPARDISO}") +#MKL SPARSE +if(NOT DEFINED CMAKE_MKL_SPARSE) + set(WITH_MKL_SPARSE 1 CACHE STRING "Support of MKL SPARSE") +else() + set(WITH_MKL_SPARSE ${CMAKE_MKL_SPARSE} CACHE STRING "Support of MKL SPARSE") +endif() + + #SPAINV if(NOT DEFINED CMAKE_SPAINV) set(WITH_SPAINV 0 CACHE STRING "Support of SPAINV") @@ -145,6 +153,7 @@ target_compile_definitions( PRIVATE "-D_DP=1" "-D_METIS=${WITH_METIS}" + "-D_MKL_SPARSE=${WITH_MKL_SPARSE}" "-D_PARDISO=${WITH_MKLPARDISO}" "-D_SPAINV=${WITH_SPAINV}" "-D_VERBOSE=${WITH_VERBOSE}" diff --git a/Makefile b/Makefile index ded44ef..bf36595 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ DEBUGENABLE=0 DPENABLE=1 METISENABLE=0 +MKL_SPARSE=1 PARDISOENABLE=1 SPAINVENABLE=1 VERBOSE=0 @@ -63,6 +64,10 @@ else METIS = 0 endif +ifeq ($(MKL_SPARSE), 1) + FFLAGS += -D_MKL_SPARSE +endif + ifeq ($(DPENABLE),0) DP=0 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 737fa4e..1d257cf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -26,6 +26,7 @@ list( "${dir}/modsparse_crs.f90" "${dir}/modsparse.f90" "${dir}/modsparse_gen.f90" + "${dir}/modsparse_helpers.f90" "${dir}/modsparse_inv.f90" "${dir}/modsparse_inv_int.f90" "${dir}/modsparse_ll.f90" diff --git a/src/Makefile b/src/Makefile index b18d131..68fbb9e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -20,6 +20,7 @@ OBJ = modcommon.o \ modsparse_inv_int.o \ modsparse_inv.o smbfct.o \ $(OBJPARDISO) $(OBJMETIS) $(OBJSPAINV) \ + modsparse_helpers.o \ modsparse_mkl.o modsparse_hash.o modsparse.o modsparse_gen.o modsparse_coo.o \ modsparse_crs64.o \ modsparse_crs.o modsparse_ll.o modsparse_metisgraph.o @@ -36,7 +37,7 @@ libsparse.a: $(OBJ) #dependencies modsparse_coo.o: modsparse.o modsparse_hash.o -modsparse_crs.o: modsparse_mkl.o modsparse.o $(OBJSPAINV) $(OBJPARDISO) $(OBJMETIS) +modsparse_crs.o: modsparse_mkl.o modsparse.o modsparse_helpers.o $(OBJSPAINV) $(OBJPARDISO) $(OBJMETIS) modsparse_crs64.o: modsparse.o $(OBJPARDISO) ifeq ($(SPAINVENABLE),1) modsparse_inv.o: modspainv.o smbfct.o modsparse_inv_int.o diff --git a/src/modsparse_crs.f90 b/src/modsparse_crs.f90 index c9e32ec..6dcc441 100644 --- a/src/modsparse_crs.f90 +++ b/src/modsparse_crs.f90 @@ -1,10 +1,14 @@ submodule (modsparse) modsparse_crs use modrandom, only: setseed, snorm=>rand_stdnormal - use modsparse_mkl, only: pardisoinit, pardiso & - , mkl_scsrmv, mkl_dcsrmv & + use modsparse_mkl, only: pardisoinit, pardiso +#if _MKL_SPARSE + use modsparse_mkl, only: mkl_scsrmv, mkl_dcsrmv & , mkl_scsrmm, mkl_dcsrmm & , mkl_scsrtrsv, mkl_dcsrtrsv & , mkl_scsrsymv, mkl_dcsrsymv +#else + use modsparse_helpers, only: csrsymv, csrmm, csrmv, csrtrsv +#endif use modsparse_inv, only: get_chol, get_ichol, get_spainv #if (_PARDISO==1) use modvariablepardiso, only: checkpardiso, pardiso_variable @@ -251,10 +255,14 @@ module subroutine harville_crs(sparse, ngibbs, nburn, diaginv, seed) endif do i = 1, ngibbs +#if _MKL_SPARSE #if(_DP==0) call mkl_scsrsymv('U', n, a, sparse%ia, sparse%ja, xt, x) #else call mkl_dcsrsymv('U', n, a, sparse%ia, sparse%ja, xt, x) +#endif +#else + call csrsymv('U', n, a, sparse%ia, sparse%ja, xt, x) #endif x = -1 * x do j=1,n @@ -339,6 +347,7 @@ module subroutine multgenv_csr(sparse,alpha,trans,x,val,y) matdescra(4)='F' +#if _MKL_SPARSE #if(_DP==0) call mkl_scsrmv(trans,sparse%dim1,sparse%dim2,alpha,matdescra& ,sparse%a,sparse%ja,sparse%ia(1:sparse%dim1),sparse%ia(2:sparse%dim1+1)& @@ -348,6 +357,11 @@ module subroutine multgenv_csr(sparse,alpha,trans,x,val,y) ,sparse%a,sparse%ja,sparse%ia(1:sparse%dim1),sparse%ia(2:sparse%dim1+1)& ,x,val,y) #endif +#else + call csrmv(trans,sparse%dim1,sparse%dim2,alpha,matdescra& + ,sparse%a,sparse%ja,sparse%ia(1:sparse%dim1),sparse%ia(2:sparse%dim1+1)& + ,x,val,y) +#endif end subroutine @@ -382,6 +396,7 @@ module subroutine multgenm_csr(sparse,alpha,trans,x,val,y) matdescra(4)='F' +#if _MKL_SPARSE #if(_DP==0) call mkl_scsrmm(trans,sparse%dim1,size(y,2),sparse%dim2,& alpha,matdescra,sparse%a,sparse%ja,sparse%ia(1:sparse%dim1),sparse%ia(2:sparse%dim1+1),& @@ -393,6 +408,12 @@ module subroutine multgenm_csr(sparse,alpha,trans,x,val,y) x,size(x,1),& val,y,size(y,1)) #endif +#else + call csrmm(trans,sparse%dim1,size(y,2),sparse%dim2,& + alpha,matdescra,sparse%a,sparse%ja,sparse%ia(1:sparse%dim1),sparse%ia(2:sparse%dim1+1),& + x,size(x,1),& + val,y,size(y,1)) +#endif end subroutine @@ -1193,22 +1214,30 @@ module subroutine isolve_crs(sparse,x,y) !$ t2=omp_get_wtime() #endif +#if _MKL_SPARSE #if(_DP==0) call mkl_scsrtrsv('U','T','N',sparse%getdim(1),sparse%a,sparse%ia,sparse%ja,x_,x) #else call mkl_dcsrtrsv('U','T','N',sparse%getdim(1),sparse%a,sparse%ia,sparse%ja,x_,x) #endif +#else + call csrtrsv('U','T','N',sparse%getdim(1),sparse%a,sparse%ia,sparse%ja,x_,x) +#endif #if (_VERBOSE>0) !$ write(sparse%unlog,'(1x,a,t30,a,f0.5)')'ISOLVE CRS 1st triangular solve',': Elapsed time (s) = ',omp_get_wtime()-t2 !$ t2=omp_get_wtime() #endif +#if _MKL_SPARSE #if(_DP==0) call mkl_scsrtrsv('U','N','N',sparse%getdim(1),sparse%a,sparse%ia,sparse%ja,x,x_) #else call mkl_dcsrtrsv('U','N','N',sparse%getdim(1),sparse%a,sparse%ia,sparse%ja,x,x_) #endif +#else + call csrtrsv('U','N','N',sparse%getdim(1),sparse%a,sparse%ia,sparse%ja,x,x_) +#endif #if (_VERBOSE>0) !$ write(sparse%unlog,'(1x,a,t30,a,f0.5)')'ISOLVE CRS 2nd triangular solve',': Elapsed time (s) = ',omp_get_wtime()-t2 @@ -1253,11 +1282,15 @@ module subroutine solveldlt_s_crs(sparse,x,y) !$ t2=omp_get_wtime() #endif +#if _MKL_SPARSE #if(_DP==0) call mkl_scsrtrsv('U','T','U',sparse%getdim(1),sparse%a,sparse%ia,sparse%ja,x_,x) #else call mkl_dcsrtrsv('U','T','U',sparse%getdim(1),sparse%a,sparse%ia,sparse%ja,x_,x) #endif +#else + call csrtrsv('U','T','U',sparse%getdim(1),sparse%a,sparse%ia,sparse%ja,x_,x) +#endif #if (_VERBOSE>0) !$ write(sparse%unlog,'(1x,a,t30,a,f0.5)')'SOLVE LDLt CRS 1st triangular solve',': Elapsed time (s) = ',omp_get_wtime()-t2 !$ t2=omp_get_wtime() @@ -1275,11 +1308,15 @@ module subroutine solveldlt_s_crs(sparse,x,y) !$ t2=omp_get_wtime() #endif +#if _MKL_SPARSE #if(_DP==0) call mkl_scsrtrsv('U','N','U',sparse%getdim(1),sparse%a,sparse%ia,sparse%ja,x,x_) #else call mkl_dcsrtrsv('U','N','U',sparse%getdim(1),sparse%a,sparse%ia,sparse%ja,x,x_) #endif +#else + call csrtrsv('U','N','U',sparse%getdim(1),sparse%a,sparse%ia,sparse%ja,x,x_) +#endif #if (_VERBOSE>0) !$ write(sparse%unlog,'(1x,a,t30,a,f0.5)')'SOLVE LDLt CRS 2nd triangular solve',': Elapsed time (s) = ',omp_get_wtime()-t2 diff --git a/src/modsparse_helpers.f90 b/src/modsparse_helpers.f90 new file mode 100644 index 0000000..76fd1c8 --- /dev/null +++ b/src/modsparse_helpers.f90 @@ -0,0 +1,234 @@ +!> Module containing various helpers +!> Most likely all of them inefficient but should do the job + +module modsparse_helpers +#if (_DP==0) + use iso_fortran_env,only:output_unit,int32,int64,real32,real64,wp=>real32 +#else + use iso_fortran_env,only:output_unit,int32,int64,real32,real64,wp=>real64 +#endif + !$ use omp_lib + implicit none(type, external) + private + public :: csrsymv + public :: csrmm + public :: csrmv + public :: csrtrsv + + contains + +! Symmetric CSR matrix-vector product: y = A*x +subroutine csrsymv(uplo, n, a, ia, ja, x, y) + character(len=1), intent(in) :: uplo + integer, intent(in) :: n + integer(kind=int32), intent(in) :: ia(:) + integer(kind=int32), intent(in) :: ja(:) + real(kind=wp), intent(in) :: a(:) + real(kind=wp), intent(in) :: x(:) + real(kind=wp), intent(out) :: y(:) + + integer :: i, j + + y = 0._wp + + select case(uplo) + case ('U', 'u') + do i = 1, n + do j = ia(i), ia(i+1)-1 + y(i) = y(i) + a(j) * x(ja(j)) + if (ja(j) /= i) y(ja(j)) = y(ja(j)) + a(j) * x(i) + enddo + enddo + case ('L', 'l') + do i = 1, n + do j = ia(i), ia(i+1)-1 + y(i) = y(i) + a(j) * x(ja(j)) + if (ja(j) /= i) y(ja(j)) = y(ja(j)) + a(j) * x(i) + enddo + enddo + case default + error stop 'csrsymv: unsupported uplo' + end select + +end subroutine csrsymv + +! CSR matrix-dense matrix product: c = beta*c + alpha*op(A)*b +subroutine csrmm(transa, m, n, k, alpha, matdescra, a, ja, pntrb, pntre, b, ldb, beta, c, ldc) + character(len=1), intent(in) :: transa + integer, intent(in) :: m + integer, intent(in) :: n + integer, intent(in) :: k + real(kind=wp), intent(in) :: alpha + character(len=1), intent(in) :: matdescra(6) + real(kind=wp), intent(in) :: a(:) + integer(kind=int32), intent(in) :: ja(:) + integer(kind=int32), intent(in) :: pntrb(:) + integer(kind=int32), intent(in) :: pntre(:) + real(kind=wp), intent(in) :: b(:,:) + integer, intent(in) :: ldb + real(kind=wp), intent(in) :: beta + real(kind=wp), intent(inout) :: c(:,:) + integer, intent(in) :: ldc + + integer :: i, j, p + + if (transa == 'N' .or. transa == 'n') then + + c(1:m, 1:n) = beta * c(1:m, 1:n) + + select case (matdescra(1)) + case ('G', 'g', 'T', 't') + do j = 1, n + do i = 1, m + do p = pntrb(i), pntre(i)-1 + c(i,j) = c(i,j) + alpha * a(p) * b(ja(p),j) + end do + end do + end do + case ('S', 's') + do j = 1, n + do i = 1, m + do p = pntrb(i), pntre(i)-1 + c(i,j) = c(i,j) + alpha * a(p) * b(ja(p),j) + if (ja(p) /= i) c(ja(p),j) = c(ja(p),j) + alpha * a(p) * b(i,j) + end do + end do + end do + end select + + else + + select case (matdescra(1)) + case ('S', 's') + ! Symmetric: A^T = A + c(1:m, 1:n) = beta * c(1:m, 1:n) + do j = 1, n + do i = 1, m + do p = pntrb(i), pntre(i)-1 + c(i,j) = c(i,j) + alpha * a(p) * b(ja(p),j) + if (ja(p) /= i) c(ja(p),j) = c(ja(p),j) + alpha * a(p) * b(i,j) + end do + end do + end do + case ('G', 'g', 'T', 't') + c(1:k, 1:n) = beta * c(1:k, 1:n) + do j = 1, n + do i = 1, m + do p = pntrb(i), pntre(i)-1 + c(ja(p),j) = c(ja(p),j) + alpha * a(p) * b(i,j) + end do + end do + end do + end select + + end if + +end subroutine csrmm + +! General CSR matrix-vector product: y = beta*y + alpha*op(A)*x +subroutine csrmv(transa, m, k, alpha, matdescra, val, indx, pntrb, pntre, x, beta, y) + character(len=1), intent(in) :: transa + integer, intent(in) :: m + integer, intent(in) :: k + real(kind=wp), intent(in) :: alpha + real(kind=wp), intent(in) :: beta + character(len=1), intent(in) :: matdescra(:) + real(kind=wp), intent(in) :: val(:) + real(kind=wp), intent(in) :: x(:) + integer(kind=int32), intent(in) :: indx(:) + integer(kind=int32), intent(in) :: pntrb(:) + integer(kind=int32), intent(in) :: pntre(:) + real(kind=wp), intent(inout) :: y(:) + + integer :: i, j + + if (transa == 'N' .or. transa == 'n') then + y(1:m) = beta * y(1:m) + select case (matdescra(1)) + case ('G', 'g', 'T', 't') + do i = 1, m + do j = pntrb(i), pntre(i)-1 + y(i) = y(i) + alpha * val(j) * x(indx(j)) + end do + end do + case ('S', 's') + do i = 1, m + do j = pntrb(i), pntre(i)-1 + y(i) = y(i) + alpha * val(j) * x(indx(j)) + if (indx(j) /= i) y(indx(j)) = y(indx(j)) + alpha * val(j) * x(i) + end do + end do + case default + error stop 'csrmv: unsupported matdescra(1)' + end select + else + select case (matdescra(1)) + case ('G', 'g', 'T', 't') + y(1:k) = beta * y(1:k) + do i = 1, m + do j = pntrb(i), pntre(i)-1 + y(indx(j)) = y(indx(j)) + alpha * val(j) * x(i) + end do + end do + case ('S', 's') + y(1:m) = beta * y(1:m) + do i = 1, m + do j = pntrb(i), pntre(i)-1 + y(i) = y(i) + alpha * val(j) * x(indx(j)) + if (indx(j) /= i) y(indx(j)) = y(indx(j)) + alpha * val(j) * x(i) + end do + end do + case default + error stop 'csrmv: unsupported matdescra(1)' + end select + end if + +end subroutine csrmv + +! Upper triangular CSR solve: op(A)*y = x +! Diagonal is first entry in each row (sorted CSR assumed) +subroutine csrtrsv(uplo, transa, diag, m, a, ia, ja, x, y) + character(len=1), intent(in) :: uplo + character(len=1), intent(in) :: transa + character(len=1), intent(in) :: diag + integer, intent(in) :: m + real(kind=wp), intent(in) :: a(:) + integer(kind=int32), intent(in) :: ia(:) + integer(kind=int32), intent(in) :: ja(:) + real(kind=wp), intent(in) :: x(:) + real(kind=wp), intent(out) :: y(:) + + integer :: i, k + logical :: ldiag + + y = x + + select case(uplo) + case ('U', 'u') + ldiag = (diag == 'N' .or. diag == 'n') + + if (transa == 'N' .or. transa == 'n') then + ! Solve U*y = x; backward substitution + do i = m, 1, -1 + do k = ia(i)+1, ia(i+1)-1 + y(i) = y(i) - a(k) * y(ja(k)) + end do + if (ldiag) y(i) = y(i) / a(ia(i)) + end do + else + ! Solve U^T*y = x; forward substitution + do i = 1, m + if (ldiag) y(i) = y(i) / a(ia(i)) + do k = ia(i)+1, ia(i+1)-1 + y(ja(k)) = y(ja(k)) - a(k) * y(i) + end do + end do + end if + + case default + error stop 'internal error csrtrsv' + end select + +end subroutine csrtrsv + +end module modsparse_helpers From 8a466af5e4300108b59525b10a855f9c0cffa99c Mon Sep 17 00:00:00 2001 From: Jeremie Vandenplas Date: Fri, 3 Jul 2026 20:09:17 +0200 Subject: [PATCH 02/10] Update cpp processor --- Makefile | 6 ++++-- src/modsparse_crs.f90 | 16 ++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index bf36595..621e432 100644 --- a/Makefile +++ b/Makefile @@ -65,7 +65,9 @@ else endif ifeq ($(MKL_SPARSE), 1) - FFLAGS += -D_MKL_SPARSE + MKL_SPARSE=1 +else + MKL_SPARSE=0 endif @@ -88,7 +90,7 @@ else SPAINV=0 endif -FFLAGS += -D_DP=$(DP) -D_METIS=$(METIS) -D_PARDISO=$(PARDISO) -D_SPAINV=$(SPAINV) -D_VERBOSE=$(VERBOSE) +FFLAGS += -D_DP=$(DP) -D_METIS=$(METIS) -D_MKL_SPARSE=$(MKL_SPARSE) -D_PARDISO=$(PARDISO) -D_SPAINV=$(SPAINV) -D_VERBOSE=$(VERBOSE) FYPPFLAGS = diff --git a/src/modsparse_crs.f90 b/src/modsparse_crs.f90 index 6dcc441..c182039 100644 --- a/src/modsparse_crs.f90 +++ b/src/modsparse_crs.f90 @@ -1,7 +1,7 @@ submodule (modsparse) modsparse_crs use modrandom, only: setseed, snorm=>rand_stdnormal use modsparse_mkl, only: pardisoinit, pardiso -#if _MKL_SPARSE +#if (_MKL_SPARSE==1) use modsparse_mkl, only: mkl_scsrmv, mkl_dcsrmv & , mkl_scsrmm, mkl_dcsrmm & , mkl_scsrtrsv, mkl_dcsrtrsv & @@ -255,7 +255,7 @@ module subroutine harville_crs(sparse, ngibbs, nburn, diaginv, seed) endif do i = 1, ngibbs -#if _MKL_SPARSE +#if (_MKL_SPARSE==1) #if(_DP==0) call mkl_scsrsymv('U', n, a, sparse%ia, sparse%ja, xt, x) #else @@ -347,7 +347,7 @@ module subroutine multgenv_csr(sparse,alpha,trans,x,val,y) matdescra(4)='F' -#if _MKL_SPARSE +#if (_MKL_SPARSE==1) #if(_DP==0) call mkl_scsrmv(trans,sparse%dim1,sparse%dim2,alpha,matdescra& ,sparse%a,sparse%ja,sparse%ia(1:sparse%dim1),sparse%ia(2:sparse%dim1+1)& @@ -396,7 +396,7 @@ module subroutine multgenm_csr(sparse,alpha,trans,x,val,y) matdescra(4)='F' -#if _MKL_SPARSE +#if (_MKL_SPARSE==1) #if(_DP==0) call mkl_scsrmm(trans,sparse%dim1,size(y,2),sparse%dim2,& alpha,matdescra,sparse%a,sparse%ja,sparse%ia(1:sparse%dim1),sparse%ia(2:sparse%dim1+1),& @@ -1214,7 +1214,7 @@ module subroutine isolve_crs(sparse,x,y) !$ t2=omp_get_wtime() #endif -#if _MKL_SPARSE +#if (_MKL_SPARSE==1) #if(_DP==0) call mkl_scsrtrsv('U','T','N',sparse%getdim(1),sparse%a,sparse%ia,sparse%ja,x_,x) #else @@ -1229,7 +1229,7 @@ module subroutine isolve_crs(sparse,x,y) !$ t2=omp_get_wtime() #endif -#if _MKL_SPARSE +#if (_MKL_SPARSE==1) #if(_DP==0) call mkl_scsrtrsv('U','N','N',sparse%getdim(1),sparse%a,sparse%ia,sparse%ja,x,x_) #else @@ -1282,7 +1282,7 @@ module subroutine solveldlt_s_crs(sparse,x,y) !$ t2=omp_get_wtime() #endif -#if _MKL_SPARSE +#if (_MKL_SPARSE==1) #if(_DP==0) call mkl_scsrtrsv('U','T','U',sparse%getdim(1),sparse%a,sparse%ia,sparse%ja,x_,x) #else @@ -1308,7 +1308,7 @@ module subroutine solveldlt_s_crs(sparse,x,y) !$ t2=omp_get_wtime() #endif -#if _MKL_SPARSE +#if (_MKL_SPARSE==1) #if(_DP==0) call mkl_scsrtrsv('U','N','U',sparse%getdim(1),sparse%a,sparse%ia,sparse%ja,x,x_) #else From 476b1cab0470dc376e07aeba82bbb299d4f8a6bc Mon Sep 17 00:00:00 2001 From: Jeremie Vandenplas Date: Fri, 3 Jul 2026 20:11:00 +0200 Subject: [PATCH 03/10] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/modsparse_helpers.f90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modsparse_helpers.f90 b/src/modsparse_helpers.f90 index 76fd1c8..d9a1cd3 100644 --- a/src/modsparse_helpers.f90 +++ b/src/modsparse_helpers.f90 @@ -94,6 +94,8 @@ subroutine csrmm(transa, m, n, k, alpha, matdescra, a, ja, pntrb, pntre, b, ldb, end do end do end do + case default + error stop 'csrmm: unsupported matdescra(1)' end select else From f24a54d8a3c5dde8e3a7324dbe44e3db45a8c1ba Mon Sep 17 00:00:00 2001 From: Jeremie Vandenplas Date: Fri, 3 Jul 2026 20:11:18 +0200 Subject: [PATCH 04/10] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/modsparse_helpers.f90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modsparse_helpers.f90 b/src/modsparse_helpers.f90 index d9a1cd3..9526a6e 100644 --- a/src/modsparse_helpers.f90 +++ b/src/modsparse_helpers.f90 @@ -121,6 +121,8 @@ subroutine csrmm(transa, m, n, k, alpha, matdescra, a, ja, pntrb, pntre, b, ldb, end do end do end do + case default + error stop 'csrmm: unsupported matdescra(1)' end select end if From ce362745ab39719c34a8fac05708326fbd25b727 Mon Sep 17 00:00:00 2001 From: Jeremie Vandenplas Date: Fri, 3 Jul 2026 20:17:32 +0200 Subject: [PATCH 05/10] Addition of CI for intel 2026 --- .github/workflows/CI.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index eacd2b7..b6884c4 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -28,6 +28,7 @@ jobs: # - {compiler: gcc, version: 13} - {compiler: intel, version: '2024.2', mkl: '2024.2'} - {compiler: intel, version: '2024.1', mkl: '2024.1'} + - {compiler: intel, version: '2026.1', mkl: '2026.1'} - {compiler: intel-classic, version: '2021.9', mkl: '2021.4.0'} build: [cmake] env: From 242cccece89375fe62e097f35f1e862282fb93cd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 3 Jul 2026 18:22:50 +0000 Subject: [PATCH 06/10] Fix Intel 2026 CI toolchain setup --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index b6884c4..776431b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -28,7 +28,7 @@ jobs: # - {compiler: gcc, version: 13} - {compiler: intel, version: '2024.2', mkl: '2024.2'} - {compiler: intel, version: '2024.1', mkl: '2024.1'} - - {compiler: intel, version: '2026.1', mkl: '2026.1'} + - {compiler: intel, version: latest, mkl: '2026.1'} - {compiler: intel-classic, version: '2021.9', mkl: '2021.4.0'} build: [cmake] env: From f637a46e3411c6be0df646f1602dd0f2218850bf Mon Sep 17 00:00:00 2001 From: Jeremie Vandenplas Date: Fri, 3 Jul 2026 20:29:33 +0200 Subject: [PATCH 07/10] test CI --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 776431b..78485a0 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -47,7 +47,7 @@ jobs: run: pip install --upgrade fypp ninja - name: Setup Fortran compiler - uses: fortran-lang/setup-fortran@v1.6.1 + uses: fortran-lang/setup-fortran@v1.6.2 id: setup-fortran with: compiler: ${{ matrix.toolchain.compiler }} From a8b41895108985a7b416d28b9c7c2dc23738346a Mon Sep 17 00:00:00 2001 From: "openai-code-agent[bot]" <242516109+Codex@users.noreply.github.com> Date: Fri, 3 Jul 2026 18:35:21 +0000 Subject: [PATCH 08/10] Update CI Intel toolchain setup to latest-compatible `setup-fortran` Agent-Logs-Url: https://github.com/jvdp1/libsparse/sessions/7a1e829d-a2a0-4698-9beb-f339832fe678 Co-authored-by: jvdp1 <16455548+jvdp1@users.noreply.github.com> --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 78485a0..9f99401 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -47,7 +47,7 @@ jobs: run: pip install --upgrade fypp ninja - name: Setup Fortran compiler - uses: fortran-lang/setup-fortran@v1.6.2 + uses: fortran-lang/setup-fortran@v1.9.2 id: setup-fortran with: compiler: ${{ matrix.toolchain.compiler }} From 8c9fca991f99f09964181150bfb095cfdee154b6 Mon Sep 17 00:00:00 2001 From: "openai-code-agent[bot]" <242516109+Codex@users.noreply.github.com> Date: Fri, 3 Jul 2026 18:48:23 +0000 Subject: [PATCH 09/10] Harden Intel CI matrix for MKL 2026 by making `_MKL_SPARSE` explicit per toolchain Agent-Logs-Url: https://github.com/jvdp1/libsparse/sessions/5fd3d548-aec0-437b-ad75-a19feac179c3 Co-authored-by: jvdp1 <16455548+jvdp1@users.noreply.github.com> --- .github/workflows/CI.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9f99401..b4e90ee 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -26,10 +26,10 @@ jobs: # - {compiler: gcc, version: 11} # - {compiler: gcc, version: 12} # - {compiler: gcc, version: 13} - - {compiler: intel, version: '2024.2', mkl: '2024.2'} - - {compiler: intel, version: '2024.1', mkl: '2024.1'} - - {compiler: intel, version: latest, mkl: '2026.1'} - - {compiler: intel-classic, version: '2021.9', mkl: '2021.4.0'} + - {compiler: intel, version: '2024.2', mkl: '2024.2', mkl_sparse: '1'} + - {compiler: intel, version: '2024.1', mkl: '2024.1', mkl_sparse: '1'} + - {compiler: intel, version: latest, mkl: '2026.1', mkl_sparse: '0'} + - {compiler: intel-classic, version: '2021.9', mkl: '2021.4.0', mkl_sparse: '1'} build: [cmake] env: BUILD_DIR: ${{ matrix.build == 'cmake' && 'build' || '.' }} @@ -66,6 +66,7 @@ jobs: if: ${{ contains(matrix.build, 'cmake') }} run: >- cmake -Wdev + -DCMAKE_MKL_SPARSE=${{ matrix.toolchain.mkl_sparse }} -DCMAKE_SPAINV=0 -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$PWD/_dist From 0fce61d6c3dffde25eb987388ea544c8b14fb6a6 Mon Sep 17 00:00:00 2001 From: Jeremie Vandenplas Date: Fri, 3 Jul 2026 21:50:41 +0200 Subject: [PATCH 10/10] Fix makefile --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 621e432..98e6fc5 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ DEBUGENABLE=0 DPENABLE=1 METISENABLE=0 -MKL_SPARSE=1 +MKLSPARSEENABLE=1 PARDISOENABLE=1 SPAINVENABLE=1 VERBOSE=0 @@ -64,7 +64,7 @@ else METIS = 0 endif -ifeq ($(MKL_SPARSE), 1) +ifeq ($(MKLSPARSEENABLE), 1) MKL_SPARSE=1 else MKL_SPARSE=0