Skip to content

Commit f9a8baf

Browse files
Merge pull request #52 from SciML/map
type-stable responsible map
2 parents 5f6c317 + ec9b4f4 commit f9a8baf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ensemble/basic_ensemble_solve.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,12 @@ function solve_batch(prob,alg,ensemblealg::EnsembleDistributed,II,pmap_batch_siz
183183
end
184184

185185
function responsible_map(f,II...)
186-
batch_data = []
186+
batch_data = Vector{Core.Compiler.return_type(f,Tuple{typeof.(getindex.(II,1))...})}(undef,length(II[1]))
187187
sizehint!(batch_data,length(II[1]))
188188
for i in 1:length(II[1])
189-
@inbounds push!(batch_data, f(getindex.(II,i)...))
189+
batch_data[i] = f(getindex.(II,i)...)
190190
end
191-
identity.(batch_data)
191+
batch_data
192192
end
193193

194194
function SciMLBase.solve_batch(prob,alg,::EnsembleSerial,II,pmap_batch_size;kwargs...)

0 commit comments

Comments
 (0)