Skip to content

Commit 3f4a60c

Browse files
committed
fixup! fixup! Enhance DArray Distribution with Processor Assignment
1 parent df398e2 commit 3f4a60c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/array/alloc.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ function stage(ctx, a::AllocateArray)
8282
args = a.want_index ? (i, size(x)) : (size(x),)
8383

8484
if isnothing(a.procgrid)
85-
scope = nothing
85+
scope = get_options(:compute_scope, get_options(:scope, DefaultScope()))
8686
else
8787
scope = ExactScope(a.procgrid[CartesianIndex(mod1.(Tuple(I), size(a.procgrid))...)])
8888
end

src/array/darray.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,11 +458,11 @@ function stage(ctx::Context, d::Distribute)
458458
# TODO: fix hashing
459459
#hash = uhash(idx, Base.hash(Distribute, Base.hash(d.data)))
460460
if isnothing(d.procgrid)
461-
options = Options(compute_scope=nothing)
461+
scope = get_options(:compute_scope, get_options(:scope, DefaultScope()))
462462
else
463463
scope = ExactScope(d.procgrid[CartesianIndex(mod1.(Tuple(I), size(d.procgrid))...)])
464-
options = Options(compute_scope=scope)
465464
end
465+
options = Options(compute_scope=scope)
466466
Dagger.spawn(options, shape, chunks...) do shape, parts...
467467
if prod(shape) == 0
468468
return Array{T}(undef, shape)
@@ -478,7 +478,7 @@ function stage(ctx::Context, d::Distribute)
478478
#hash = uhash(c, Base.hash(Distribute, Base.hash(d.data)))
479479
c = d.domainchunks[I]
480480
if isnothing(d.procgrid)
481-
scope = nothing
481+
scope = get_options(:compute_scope, get_options(:scope, DefaultScope()))
482482
else
483483
scope = ExactScope(d.procgrid[CartesianIndex(mod1.(Tuple(I), size(d.procgrid))...)])
484484
end

0 commit comments

Comments
 (0)