Skip to content

Commit 6f9f98e

Browse files
committed
datadeps: Add TID to dagdebug statements
1 parent 563caef commit 6f9f98e

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

src/datadeps/queue.jl

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,10 @@ function distribute_task!(queue::DataDepsTaskQueue, state::DataDepsState, all_pr
405405
end
406406

407407
f = spec.fargs[1]
408+
tid = task.uid
408409
# FIXME: May not be correct to move this under uniformity
409410
#f.value = move(default_processor(), our_proc, value(f))
410-
@dagdebug nothing :spawn_datadeps "($(repr(value(f)))) Scheduling: $our_proc ($our_space)"
411+
@dagdebug tid :spawn_datadeps "($(repr(value(f)))) Scheduling: $our_proc ($our_space)"
411412

412413
# Copy raw task arguments for analysis
413414
# N.B. Used later for checking dependencies
@@ -434,13 +435,13 @@ function distribute_task!(queue::DataDepsTaskQueue, state::DataDepsState, all_pr
434435

435436
# Is the data written previously or now?
436437
if !arg_ws.may_alias
437-
@dagdebug nothing :spawn_datadeps "($(repr(value(f))))[$(idx-1)] Skipped copy-to (immutable)"
438+
@dagdebug tid :spawn_datadeps "($(repr(value(f))))[$(idx-1)] Skipped copy-to (immutable)"
438439
return arg
439440
end
440441

441442
# Is the data writeable?
442443
if !arg_ws.inplace_move
443-
@dagdebug nothing :spawn_datadeps "($(repr(value(f))))[$(idx-1)] Skipped copy-to (non-writeable)"
444+
@dagdebug tid :spawn_datadeps "($(repr(value(f))))[$(idx-1)] Skipped copy-to (non-writeable)"
444445
return arg
445446
end
446447

@@ -457,7 +458,7 @@ function distribute_task!(queue::DataDepsTaskQueue, state::DataDepsState, all_pr
457458
enqueue_copy_to!(state, our_space, arg_w, value(f), idx, our_scope, task, write_num)
458459
else
459460
@assert remainder isa NoAliasing "Expected NoAliasing, got $(typeof(remainder))"
460-
@dagdebug nothing :spawn_datadeps "($(repr(value(f))))[$(idx-1)][$dep_mod] Skipped copy-to (up-to-date): $our_space"
461+
@dagdebug tid :spawn_datadeps "($(repr(value(f))))[$(idx-1)][$dep_mod] Skipped copy-to (up-to-date): $our_space"
461462
end
462463
end
463464
return arg_remote
@@ -501,16 +502,16 @@ function distribute_task!(queue::DataDepsTaskQueue, state::DataDepsState, all_pr
501502
ainfo = aliasing!(state, our_space, arg_w)
502503
dep_mod = arg_w.dep_mod
503504
if dep.writedep
504-
@dagdebug nothing :spawn_datadeps "($(repr(value(f))))[$(idx-1)][$dep_mod] Syncing as writer"
505+
@dagdebug tid :spawn_datadeps "($(repr(value(f))))[$(idx-1)][$dep_mod] Syncing as writer"
505506
get_write_deps!(state, our_space, ainfo, write_num, syncdeps)
506507
else
507-
@dagdebug nothing :spawn_datadeps "($(repr(value(f))))[$(idx-1)][$dep_mod] Syncing as reader"
508+
@dagdebug tid :spawn_datadeps "($(repr(value(f))))[$(idx-1)][$dep_mod] Syncing as reader"
508509
get_read_deps!(state, our_space, ainfo, write_num, syncdeps)
509510
end
510511
end
511512
return
512513
end
513-
@dagdebug nothing :spawn_datadeps "($(repr(value(f)))) Task has $(length(syncdeps)) syncdeps"
514+
@dagdebug tid :spawn_datadeps "($(repr(value(f)))) Task has $(length(syncdeps)) syncdeps"
514515

515516
# Launch user's task
516517
new_fargs = map_or_ntuple(task_arg_ws) do idx
@@ -540,7 +541,7 @@ function distribute_task!(queue::DataDepsTaskQueue, state::DataDepsState, all_pr
540541
ainfo = aliasing!(state, our_space, arg_w)
541542
dep_mod = arg_w.dep_mod
542543
if dep.writedep
543-
@dagdebug nothing :spawn_datadeps "($(repr(value(f))))[$(idx-1)][$dep_mod] Task set as writer"
544+
@dagdebug tid :spawn_datadeps "($(repr(value(f))))[$(idx-1)][$dep_mod] Task set as writer"
544545
add_writer!(state, arg_w, our_space, ainfo, task, write_num)
545546
else
546547
add_reader!(state, arg_w, our_space, ainfo, task, write_num)

src/datadeps/remainders.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ function enqueue_remainder_copy_to!(state::DataDepsState, dest_space::MemorySpac
293293
# overwritten by more recent partial updates
294294
source_space = remainder_aliasing.space
295295

296-
@dagdebug nothing :spawn_datadeps "($(repr(f)))[$(idx-1)][$dep_mod] Enqueueing remainder copy-to for $(typeof(arg_w.arg))[$(arg_w.dep_mod)]: $source_space => $dest_space"
296+
@dagdebug task.uid :spawn_datadeps "($(repr(f)))[$(idx-1)][$dep_mod] Enqueueing remainder copy-to for $(typeof(arg_w.arg))[$(arg_w.dep_mod)]: $source_space => $dest_space"
297297

298298
# Get the source and destination arguments
299299
arg_dest = state.remote_args[dest_space][arg_w.arg]
@@ -308,7 +308,7 @@ function enqueue_remainder_copy_to!(state::DataDepsState, dest_space::MemorySpac
308308
empty!(remainder_aliasing.syncdeps) # We can't bring these to move!
309309
get_write_deps!(state, dest_space, target_ainfo, write_num, remainder_syncdeps)
310310

311-
@dagdebug nothing :spawn_datadeps "($(repr(f)))[$(idx-1)][$dep_mod] Remainder copy-to has $(length(remainder_syncdeps)) syncdeps"
311+
@dagdebug task.uid :spawn_datadeps "($(repr(f)))[$(idx-1)][$dep_mod] Remainder copy-to has $(length(remainder_syncdeps)) syncdeps"
312312

313313
# Launch the remainder copy task
314314
ctx = Sch.eager_context()
@@ -377,7 +377,7 @@ function enqueue_copy_to!(state::DataDepsState, dest_space::MemorySpace, arg_w::
377377
source_space = state.arg_owner[arg_w]
378378
target_ainfo = aliasing!(state, dest_space, arg_w)
379379

380-
@dagdebug nothing :spawn_datadeps "($(repr(f)))[$(idx-1)][$dep_mod] Enqueueing full copy-to for $(typeof(arg_w.arg))[$(arg_w.dep_mod)]: $source_space => $dest_space"
380+
@dagdebug task.uid :spawn_datadeps "($(repr(f)))[$(idx-1)][$dep_mod] Enqueueing full copy-to for $(typeof(arg_w.arg))[$(arg_w.dep_mod)]: $source_space => $dest_space"
381381

382382
# Get the source and destination arguments
383383
arg_dest = state.remote_args[dest_space][arg_w.arg]
@@ -390,7 +390,7 @@ function enqueue_copy_to!(state::DataDepsState, dest_space::MemorySpace, arg_w::
390390
get_read_deps!(state, source_space, source_ainfo, write_num, copy_syncdeps)
391391
get_write_deps!(state, dest_space, target_ainfo, write_num, copy_syncdeps)
392392

393-
@dagdebug nothing :spawn_datadeps "($(repr(f)))[$(idx-1)][$dep_mod] Full copy-to has $(length(copy_syncdeps)) syncdeps"
393+
@dagdebug task.uid :spawn_datadeps "($(repr(f)))[$(idx-1)][$dep_mod] Full copy-to has $(length(copy_syncdeps)) syncdeps"
394394

395395
# Launch the remainder copy task
396396
ctx = Sch.eager_context()

0 commit comments

Comments
 (0)