Skip to content

Commit e50ddbc

Browse files
hotfix ensembles due to kwargs
1 parent c045933 commit e50ddbc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/ensemble/basic_ensemble_solve.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ function __solve(prob::AbstractEnsembleProblem,
116116
u,converged = prob.reduction(u,batch_data,II)
117117
end
118118

119-
u = reduce(vcat, u)
120119
_u = tighten_container_eltype(u)
121120

122121
return EnsembleSolution(_u,elapsed_time,converged)
@@ -214,7 +213,8 @@ function solve_batch(prob,alg,ensemblealg::EnsembleThreads,II,pmap_batch_size;kw
214213
end
215214

216215
#batch_data = Vector{Core.Compiler.return_type(multithreaded_batch,Tuple{typeof(first(II))})}(undef,length(II))
217-
batch_data = []
216+
batch_data = Vector{Any}(undef,length(II))
217+
218218
let
219219
if length(II) == 1 || Threads.nthreads() == 1
220220
for batch_idx in axes(batch_data, 1)
@@ -293,7 +293,7 @@ function thread_monte(prob,II,alg,procid;kwargs...)
293293
end
294294

295295
#batch_data = Vector{Core.Compiler.return_type(multithreaded_batch,Tuple{typeof(first(II))})}(undef,length(II))
296-
batch_data = []
296+
batch_data = Vector{Any}(undef,length(II))
297297

298298
let
299299
if length(II) == 1 || Threads.nthreads() == 1

src/ensemble/ensemble_problems.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ end
1212

1313
DEFAULT_PROB_FUNC(prob,i,repeat) = prob
1414
DEFAULT_OUTPUT_FUNC(sol,i) = (sol,false)
15-
DEFAULT_REDUCTION(u,data,I) = push!(u, data), false
15+
DEFAULT_REDUCTION(u,data,I) = append!(u, data), false
1616
EnsembleProblem(prob;
1717
output_func = DEFAULT_OUTPUT_FUNC,
1818
prob_func= DEFAULT_PROB_FUNC,

0 commit comments

Comments
 (0)