Skip to content

Commit c045933

Browse files
revert compiler return types due to kwargs
1 parent b7346e4 commit c045933

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/ensemble/basic_ensemble_solve.jl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,14 @@ function solve_batch(prob,alg,ensemblealg::EnsembleDistributed,II,pmap_batch_siz
157157
batch_data = pmap(wp,II,batch_size=pmap_batch_size) do i
158158
batch_func(i,prob,alg;kwargs...)
159159
end
160-
map(identity,batch_data)
160+
tighten_container_eltype(batch_data)
161161
end
162162

163163
function solve_batch(prob,alg,::EnsembleSerial,II,pmap_batch_size;kwargs...)
164164
batch_data = map(II) do i
165165
batch_func(i,prob,alg;kwargs...)
166166
end
167-
batch_data
167+
tighten_container_eltype(batch_data)
168168
end
169169

170170
function solve_batch(prob,alg,ensemblealg::EnsembleThreads,II,pmap_batch_size;kwargs...)
@@ -213,7 +213,8 @@ function solve_batch(prob,alg,ensemblealg::EnsembleThreads,II,pmap_batch_size;kw
213213
_x[1]
214214
end
215215

216-
batch_data = Vector{Core.Compiler.return_type(multithreaded_batch,Tuple{typeof(first(II))})}(undef,length(II))
216+
#batch_data = Vector{Core.Compiler.return_type(multithreaded_batch,Tuple{typeof(first(II))})}(undef,length(II))
217+
batch_data = []
217218
let
218219
if length(II) == 1 || Threads.nthreads() == 1
219220
for batch_idx in axes(batch_data, 1)
@@ -225,7 +226,7 @@ function solve_batch(prob,alg,ensemblealg::EnsembleThreads,II,pmap_batch_size;kw
225226
end
226227
end
227228
end
228-
batch_data
229+
tighten_container_eltype(batch_data)
229230
end
230231

231232
function solve_batch(prob,alg,::EnsembleSplitThreads,II,pmap_batch_size;kwargs...)
@@ -291,7 +292,8 @@ function thread_monte(prob,II,alg,procid;kwargs...)
291292
_x[1]
292293
end
293294

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

296298
let
297299
if length(II) == 1 || Threads.nthreads() == 1
@@ -304,5 +306,5 @@ function thread_monte(prob,II,alg,procid;kwargs...)
304306
end
305307
end
306308
end
307-
batch_data
309+
tighten_container_eltype(batch_data)
308310
end

0 commit comments

Comments
 (0)