Skip to content

Commit 0b9f7a3

Browse files
committed
Make creation of output buffer much faster
1 parent ab8435d commit 0b9f7a3

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/buffers.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ is_init_callable(::Union{DataType,UnionAll}) = Val{true}()
4343
array_from_init(::Nothing, buftype, bufsize) = zeros(buftype, bufsize)
4444
array_from_init(init, buftype, bufsize) = array_from_init(init, is_init_callable(init), buftype, bufsize)
4545
array_from_init(init, ::Val{true}, buftype, bufsize) = buftype[init() for _ in CartesianIndices(bufsize)]
46-
array_from_init(init, ::Val{false}, buftype, bufsize) = buftype[init for _ in CartesianIndices(bufsize)]
46+
array_from_init(init, ::Val{false}, buftype, bufsize) = fill(convert(buftype, init), bufsize)
4747

4848
#buftype_from_init(_,ia) =
4949

src/distribute.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function split_dim_reasons(op,lr,outars)
4646
for (spec,ar) in zip(op.outspecs,outars)
4747
foreach(1:ndims(lr)) do idim
4848
if is_output_chunk_overlap(spec,ar,idim,lr)
49-
@warn "Overlapping output chunks in dimension $idim"
49+
op.f.red === nothing && @warn "Overlapping output chunks in dimension $idim"
5050
push!(ret[idim],:output_chunk)
5151
end
5252
if is_output_reducedim(spec,ar,idim)

src/graphs.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ end
308308
function graph_fuse_ready(g::MwopGraph)
309309
label = zeros(Int, maximum(keys(g.nodes)))
310310
Graphs.connected_components!(label, g)
311-
_, d = Graphs.components(label)
312-
length(g.connections) == count(>(0), keys(d))
311+
comps, _ = Graphs.components(label)
312+
length(g.connections) == count(i -> length(i) > 1, comps)
313313
end
314314

315315

src/runner.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@ end
171171
function default_loopbody(inow, op, inbuffers_pure, outbuffers, threaded, outars, cb, runfilter, piddir)
172172
@debug "inow = ", inow
173173
if all(c -> need_run(inow, c), runfilter)
174-
inbuffers_wrapped = read_range.((inow,),op.inars,inbuffers_pure);
175-
outbuffers_now = extract_outbuffer.((inow,),op.outspecs,op.f.init,op.f.buftype,outbuffers)
174+
inbuffers_wrapped = read_range.((inow,), op.inars, inbuffers_pure)
175+
outbuffers_now = extract_outbuffer.((inow,), op.outspecs, op.f.init, op.f.buftype, outbuffers)
176176
run_block(op,inow,inbuffers_wrapped,outbuffers_now,threaded)
177177
put_buffer.((inow,),outbuffers_now,outars,(piddir,))
178178
clean_aggregator.(outbuffers)

0 commit comments

Comments
 (0)