TaijaParallel
Documentation for TaijaParallel.
TaijaParallel.IsParallelTaijaParallel.NotParallelTaijaParallel.ProcessStyleTaijaParallel.ProcessStyleTaijaParallel.ProcessStyleTaijaParallel.ThreadsParallelizerTaijaBase.parallelizeTaijaBase.parallelizeTaijaParallel.MPIParallelizerTaijaParallel.chunk_obsTaijaParallel.load_with_retryTaijaParallel.split_by_countsTaijaParallel.split_countTaijaParallel.split_obsTaijaParallel.@with_parallelizer
TaijaParallel.IsParallel — Type
Processes that can be parallelized have this trait.
TaijaParallel.NotParallel — Type
By default all types of have this trait.
TaijaParallel.ProcessStyle — Type
A base type for a style of process.
TaijaParallel.ProcessStyle — Method
The evaluate function is parallelizable.
TaijaParallel.ProcessStyle — Method
The generate_counterfactual method is parallelizable.
TaijaParallel.ThreadsParallelizer — Type
The ThreadsParallelizer type is used to parallelize the evaluation of a function using Threads.@threads.
TaijaBase.parallelize — Method
TaijaBase.parallelize(
parallelizer::ThreadsParallelizer,
f::typeof(CounterfactualExplanations.Evaluation.evaluate),
args...;
kwargs...,
)Parallelizes the evaluation of f using Threads.@threads. This function is used to evaluate counterfactual explanations.
TaijaBase.parallelize — Method
TaijaBase.parallelize(
parallelizer::ThreadsParallelizer,
f::typeof(CounterfactualExplanations.generate_counterfactual),
args...;
kwargs...,
)Parallelizes the evaluation of f using Threads.@threads. This function is used to generate counterfactual explanations.
TaijaParallel.MPIParallelizer — Function
MPIParallelizerExposes the MPIParallelizer function from the MPIExt extension.
TaijaParallel.chunk_obs — Method
chunk_obs(obs::AbstractVector, n_each::Integer, n_groups::Integer)Split the vector of observations obs into chunks such that each chunk has n_each observations for each available CPU core (i.e. n_groups).
TaijaParallel.load_with_retry — Method
load_with_retry(filepath; max_attempts=5, delay=1.0)Load a file using Serialization.deserialize, retrying up to max_attempts times with exponential backoff.
TaijaParallel.split_by_counts — Method
split_by_counts(obs::AbstractVector, counts::AbstractVector)Return a vector of vectors of obs split by counts.
TaijaParallel.split_count — Method
split_count(N::Integer, n::Integer)Return a vector of n integers which are approximately equally sized and sum to N. Lifted from https://juliaparallel.org/MPI.jl/v0.20/examples/06-scatterv/.
TaijaParallel.split_obs — Method
split_obs(obs::AbstractVector, n::Integer)Return a vector of n group indices for obs.
TaijaParallel.@with_parallelizer — Macro
@with_parallelizer(parallelizer, expr)This macro can be used to parallelize a function call or block of code. The macro will check that the function is parallelizable and then call parallelize with the supplied parallelizer and expr.