Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datadeps: Don't skip copy on no writedep #580

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/datadeps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -677,8 +677,8 @@ function distribute_tasks!(queue::DataDepsTaskQueue)
# Is the data written previously or now?
arg, deps = unwrap_inout(arg)
arg = arg isa DTask ? fetch(arg; raw=true) : arg
if !type_may_alias(typeof(arg)) || !has_writedep(state, arg, deps, task)
@dagdebug nothing :spawn_datadeps "($(repr(spec.f)))[$idx] Skipped copy-to (unwritten)"
if !type_may_alias(typeof(arg))
@dagdebug nothing :spawn_datadeps "($(repr(spec.f)))[$idx] Skipped copy-to (immutable)"
spec.args[idx] = pos => arg
continue
end
Expand Down Expand Up @@ -877,8 +877,8 @@ function distribute_tasks!(queue::DataDepsTaskQueue)
for arg in keys(astate.data_origin)
# Is the data previously written?
arg, deps = unwrap_inout(arg)
if !type_may_alias(typeof(arg)) || !has_writedep(state, arg, deps)
@dagdebug nothing :spawn_datadeps "Skipped copy-from (unwritten)"
if !type_may_alias(typeof(arg))
@dagdebug nothing :spawn_datadeps "Skipped copy-from (immutable)"
end

# Is the source of truth elsewhere?
Expand Down
4 changes: 2 additions & 2 deletions test/datadeps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function taskdeps_for_task(logs::Dict{Int,<:Dict}, tid::Int)
end
error("Task $tid not found in logs")
end
function test_task_dominators(logs::Dict, tid::Int, doms::Vector; all_tids::Vector=[], nondom_check::Bool=true)
function test_task_dominators(logs::Dict, tid::Int, doms::Vector; all_tids::Vector=[], nondom_check::Bool=false)
g = SimpleDiGraph()
tid_to_v = Dict{Int,Int}()
seen = Set{Int}()
Expand Down Expand Up @@ -165,7 +165,7 @@ function test_datadeps(;args_chunks::Bool,
end
tid_1, tid_2 = task_id.(ts)
test_task_dominators(logs, tid_1, []; all_tids=[tid_1, tid_2])
test_task_dominators(logs, tid_2, []; all_tids=[tid_1, tid_2])
test_task_dominators(logs, tid_2, []; all_tids=[tid_1, tid_2], nondom_check=false)

# R->W Aliasing
ts = []
Expand Down