Skip to content

Commit aeaa495

Browse files
Reduce EnsembleThreads overhead
This removes the batch handling and directly uses tmap. Doing an immediate merge because testing locally. This needs a downstream fix to the tmap adjoint overload which is already setup. Fixes SciML/DiffEqBase.jl#658
1 parent 6fc3798 commit aeaa495

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "SciMLBase"
22
uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
33
authors = ["Chris Rackauckas <[email protected]> and contributors"]
4-
version = "1.12.1"
4+
version = "1.13.0"
55

66
[deps]
77
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"

src/ensemble/basic_ensemble_solve.jl

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -208,18 +208,11 @@ function solve_batch(prob,alg,ensemblealg::EnsembleThreads,II,pmap_batch_size;kw
208208
else
209209
probs = prob.prob
210210
end
211-
212-
#
213-
batch_size = length(II)÷nthreads
214-
batch_data = tmap(1:nthreads) do i
215-
if i == nthreads
216-
I_local = II[(batch_size*(i-1)+1):end]
217-
else
218-
I_local = II[(batch_size*(i-1)+1):(batch_size*i)]
219-
end
220-
solve_batch(prob,alg,EnsembleSerial(),I_local,pmap_batch_size;kwargs...)
211+
212+
batch_data = tmap(II) do i
213+
batch_func(i,prob,alg;kwargs...)
221214
end
222-
tighten_container_eltype(reduce(vcat,batch_data))
215+
tighten_container_eltype(batch_data)
223216
end
224217

225218
function tmap(f,args...)

0 commit comments

Comments
 (0)