Skip to content

Commit

Permalink
remove probing
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-lara committed Sep 15, 2023
1 parent 7c2d6d5 commit 4b075c5
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/ptdf_calculations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,8 @@ function _calculate_PTDF_matrix_MKLPardiso(
"Distibuted slack is not supported for systems with multiple reference buses.",
)
elseif isempty(dist_slack) && length(ref_bus_positions) != buscount
v1 = @elapsed Pardiso.pardiso(ps, PTDFm_t[valid_ix, :], ABA, full_BA)
v2 = @elapsed PTDFm_t[valid_ix, :] .= full_BA
@error v1 v2
Pardiso.pardiso(ps, PTDFm_t[valid_ix, :], ABA, full_BA)
PTDFm_t[valid_ix, :] .= full_BA
return PTDFm_t
elseif length(dist_slack) == buscount
@info "Distributed bus"
Expand All @@ -329,7 +328,7 @@ function _calculate_PTDF_matrix_MKLPardiso(
else
error("Distributed bus specification doesn't match the number of buses.")
end
Pardiso.set_phase!(ps, Pardiso.RELEASE_ALL)
# Pardiso.set_phase!(ps, Pardiso.RELEASE_ALL)
return
end

Expand All @@ -352,10 +351,8 @@ function calculate_PTDF_matrix_MKLPardiso(
bus_lookup::Dict{Int, Int},
dist_slack::Vector{Float64})
A, ref_bus_positions = calculate_A_matrix(branches, buses)
BA, vals1 = @timed calculate_BA_matrix(branches, bus_lookup)
PTDFm, vals2 = @timed _calculate_PTDF_matrix_MKLPardiso(A, BA, ref_bus_positions, dist_slack)
@error "BA time $vals1"
@error "MKL time $vals2"
BA = calculate_BA_matrix(branches, bus_lookup)
PTDFm = _calculate_PTDF_matrix_MKLPardiso(A, BA, ref_bus_positions, dist_slack)
return PTDFm, A
end

Expand Down

0 comments on commit 4b075c5

Please sign in to comment.