Skip to content

Commit

Permalink
enable single call
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-lara committed Sep 28, 2023
1 parent 5f7736c commit 0d78a5d
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion src/lodf_calculations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,27 @@ function _pardiso_sequential_LODF!(
return

Check warning on line 174 in src/lodf_calculations.jl

View check run for this annotation

Codecov / codecov/patch

src/lodf_calculations.jl#L170-L174

Added lines #L170 - L174 were not covered by tests
end

function _pardiso_single_LODF!(
lodf_t::Matrix{Float64},
A::SparseArrays.SparseMatrixCSC{Float64, Int},
ptdf_denominator_t::Matrix{Float64},
chunk_size::Int = DEFAULT_LODF_CHUNK_SIZE,
)
linecount = size(lodf_t, 1)
ps = Pardiso.MKLPardisoSolver()
Pardiso.pardisoinit(ps)
#Pardiso.set_msglvl!(ps, Pardiso.MESSAGE_LEVEL_ON)
Pardiso.pardiso(
ps,
lodf_t,
A,
ptdf_denominator_t,
)
Pardiso.set_phase!(ps, Pardiso.RELEASE_ALL)
return
end


function _calculate_LODF_matrix_MKLPardiso(
a::SparseArrays.SparseMatrixCSC{Int8, Int},
ptdf::Matrix{Float64},
Expand All @@ -193,7 +214,11 @@ function _calculate_LODF_matrix_MKLPardiso(
end
lodf_t = zeros(linecount, linecount)
A = SparseArrays.sparse(m_I, m_I, m_V)
_pardiso_sequential_LODF!(lodf_t, A, ptdf_denominator_t)
if linecount > DEFAULT_LODF_CHUNK_SIZE
_pardiso_sequential_LODF!(lodf_t, A, ptdf_denominator_t)

Check warning on line 218 in src/lodf_calculations.jl

View check run for this annotation

Codecov / codecov/patch

src/lodf_calculations.jl#L218

Added line #L218 was not covered by tests
else
_pardiso_single_LODF!(lodf_t, A, ptdf_denominator_t)
end
lodf_t[LinearAlgebra.diagind(lodf_t)] .= -1.0
return lodf_t
end
Expand Down

0 comments on commit 0d78a5d

Please sign in to comment.