Skip to content

Commit e3b2632

Browse files
committed
datadeps: Loosen task scopes
1 parent 9bc94fc commit e3b2632

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: src/datadeps.jl

+5-3
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,8 @@ function distribute_tasks!(queue::DataDepsTaskQueue)
324324
for (spec, task) in queue.seen_tasks[task_order]
325325
our_proc = all_procs[proc_idx]
326326
our_space = only(memory_spaces(our_proc))
327+
our_procs = collect(processors(our_space))
328+
our_scope = UnionScope(map(ExactScope, our_procs)...)
327329

328330
# Spawn copies before user's task, as necessary
329331
@dagdebug nothing :spawn_datadeps "($(spec.f)) Scheduling: $our_proc ($our_space)"
@@ -346,7 +348,7 @@ function distribute_tasks!(queue::DataDepsTaskQueue)
346348
# Add copy-to operation (depends on latest owner of arg)
347349
@dagdebug nothing :spawn_datadeps "($(spec.f))[$idx] Enqueueing copy-to: $data_space => $our_space"
348350
arg_local = remote_args[data_space][arg]
349-
copy_to_scope = ExactScope(our_proc)
351+
copy_to_scope = our_scope
350352
copy_to_syncdeps = Set{Any}()
351353
get_write_deps!(arg, copy_to_syncdeps)
352354
@dagdebug nothing :spawn_datadeps "($(spec.f))[$idx] $(length(copy_to_syncdeps)) syncdeps"
@@ -380,7 +382,7 @@ function distribute_tasks!(queue::DataDepsTaskQueue)
380382
end
381383
end
382384
@dagdebug nothing :spawn_datadeps "($(spec.f)) $(length(syncdeps)) syncdeps"
383-
task_scope = Dagger.ExactScope(our_proc)
385+
task_scope = our_scope
384386
spec.options = merge(spec.options, (;syncdeps, scope=task_scope))
385387
enqueue!(upper_queue, spec=>task)
386388
for (idx, (_, arg)) in enumerate(task_args)
@@ -413,7 +415,7 @@ function distribute_tasks!(queue::DataDepsTaskQueue)
413415
arg_remote = remote_args[data_remote_space][arg]
414416
@assert arg_remote !== arg_local
415417
data_local_proc = first(processors(data_local_space))
416-
copy_from_scope = ExactScope(data_local_proc)
418+
copy_from_scope = UnionScope(map(ExactScope, collect(processors(data_local_space)))...)
417419
copy_from_syncdeps = Set()
418420
get_write_deps!(arg, copy_from_syncdeps)
419421
@dagdebug nothing :spawn_datadeps "$(length(copy_from_syncdeps)) syncdeps"

0 commit comments

Comments
 (0)