Skip to content

Commit

Permalink
Allow matrix measurement states to exchange scheduler between calls
Browse files Browse the repository at this point in the history
  • Loading branch information
nHackel committed Aug 13, 2024
1 parent ce6af00 commit 53a86b2
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/MultiThreading.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ function init!(solver::AbstractLinearSolver, state::AbstractSolverState, b::Abst
states = prepareMatrixStates(solver, state, b)
multiState = scheduler(states)
solver.state = multiState
init!(solver, multiState, b; kwargs...)
for (i, s) in enumerate(solver.state.states)
init!(solver, s, b[:, i]; kwargs...)
end
solver.state.active .= true
end
function init!(solver::AbstractLinearSolver, state::AbstractMatrixSolverState, b::AbstractVector; kwargs...)
singleState = first(state.states)
Expand All @@ -30,12 +33,6 @@ function prepareMatrixStates(solver::AbstractLinearSolver, state::AbstractSolver
end
prepareMatrixStates(solver::AbstractLinearSolver, state::Union{SequentialState, MultiThreadingState}, b::AbstractMatrix) = prepareMatrixStates(solver, first(state.states), b)

function init!(solver::AbstractLinearSolver, state::AbstractMatrixSolverState, b::AbstractMatrix; kwargs...)
for (i, s) in enumerate(state.states)
init!(solver, s, b[:, i]; kwargs...)
end
state.active .= true
end

function iterate(solver::S, state::AbstractMatrixSolverState) where {S <: AbstractLinearSolver}
activeIdx = findall(state.active)
Expand Down

0 comments on commit 53a86b2

Please sign in to comment.