Skip to content

Commit

Permalink
Rename prepareMultiStates to prepareMatrixStates
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
nHackel committed Aug 13, 2024
1 parent 450cac0 commit 06c8405
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/MultiThreading.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export SequentialState, MultiThreadingState, prepareMultiStates
export SequentialState, MultiThreadingState, prepareMatrixStates
abstract type AbstractMatrixSolverState{S} <: AbstractSolverState{S} end
mutable struct SequentialState{S, ST <: AbstractSolverState{S}} <: AbstractMatrixSolverState{S}
states::Vector{ST}
Expand All @@ -13,7 +13,7 @@ mutable struct MultiThreadingState{S, ST <: AbstractSolverState{S}} <: AbstractM
end

function init!(solver::AbstractLinearSolver, state::AbstractSolverState, b::AbstractMatrix; scheduler = SequentialState, kwargs...)
states = prepareMultiStates(solver, state, b)
states = prepareMatrixStates(solver, state, b)
multiState = scheduler(states)
solver.state = multiState
init!(solver, multiState, b; kwargs...)
Expand All @@ -24,11 +24,11 @@ function init!(solver::AbstractLinearSolver, state::AbstractMatrixSolverState, b
init!(solver, singleState, b; kwargs...)
end

function prepareMultiStates(solver::AbstractLinearSolver, state::AbstractSolverState, b::AbstractMatrix)
function prepareMatrixStates(solver::AbstractLinearSolver, state::AbstractSolverState, b::AbstractMatrix)
states = [deepcopy(state) for _ in 1:size(b, 2)]
return states
end
prepareMultiStates(solver::AbstractLinearSolver, state::Union{SequentialState, MultiThreadingState}, b::AbstractMatrix) = prepareMultiStates(solver, first(state.states), b)
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)
Expand Down

0 comments on commit 06c8405

Please sign in to comment.