@@ -324,6 +324,8 @@ function distribute_tasks!(queue::DataDepsTaskQueue)
324
324
for (spec, task) in queue. seen_tasks[task_order]
325
325
our_proc = all_procs[proc_idx]
326
326
our_space = only (memory_spaces (our_proc))
327
+ our_procs = collect (processors (our_space))
328
+ our_scope = UnionScope (map (ExactScope, our_procs)... )
327
329
328
330
# Spawn copies before user's task, as necessary
329
331
@dagdebug nothing :spawn_datadeps " ($(spec. f) ) Scheduling: $our_proc ($our_space )"
@@ -346,7 +348,7 @@ function distribute_tasks!(queue::DataDepsTaskQueue)
346
348
# Add copy-to operation (depends on latest owner of arg)
347
349
@dagdebug nothing :spawn_datadeps " ($(spec. f) )[$idx ] Enqueueing copy-to: $data_space => $our_space "
348
350
arg_local = remote_args[data_space][arg]
349
- copy_to_scope = ExactScope (our_proc)
351
+ copy_to_scope = our_scope
350
352
copy_to_syncdeps = Set {Any} ()
351
353
get_write_deps! (arg, copy_to_syncdeps)
352
354
@dagdebug nothing :spawn_datadeps " ($(spec. f) )[$idx ] $(length (copy_to_syncdeps)) syncdeps"
@@ -380,7 +382,7 @@ function distribute_tasks!(queue::DataDepsTaskQueue)
380
382
end
381
383
end
382
384
@dagdebug nothing :spawn_datadeps " ($(spec. f) ) $(length (syncdeps)) syncdeps"
383
- task_scope = Dagger . ExactScope (our_proc)
385
+ task_scope = our_scope
384
386
spec. options = merge (spec. options, (;syncdeps, scope= task_scope))
385
387
enqueue! (upper_queue, spec=> task)
386
388
for (idx, (_, arg)) in enumerate (task_args)
@@ -413,7 +415,7 @@ function distribute_tasks!(queue::DataDepsTaskQueue)
413
415
arg_remote = remote_args[data_remote_space][arg]
414
416
@assert arg_remote != = arg_local
415
417
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))) ... )
417
419
copy_from_syncdeps = Set ()
418
420
get_write_deps! (arg, copy_from_syncdeps)
419
421
@dagdebug nothing :spawn_datadeps " $(length (copy_from_syncdeps)) syncdeps"
0 commit comments