@@ -61,13 +61,13 @@ function set_failed!(state, origin, thunk=origin)
61
61
end
62
62
63
63
" Internal utility, useful for debugging scheduler state."
64
- function print_sch_status (state, thunk)
64
+ function print_sch_status (state, thunk; kwargs ... )
65
65
iob = IOBuffer ()
66
- print_sch_status (iob, state, thunk)
66
+ print_sch_status (iob, state, thunk; kwargs ... )
67
67
seek (iob, 0 )
68
68
write (stderr , iob)
69
69
end
70
- function print_sch_status (io:: IO , state, thunk; offset= 0 , limit= 5 )
70
+ function print_sch_status (io:: IO , state, thunk; offset= 0 , limit= 5 , max_inputs = 3 )
71
71
function status_string (node)
72
72
status = " "
73
73
if node in state. errored
@@ -79,15 +79,25 @@ function print_sch_status(io::IO, state, thunk; offset=0, limit=5)
79
79
status *= " R"
80
80
elseif haskey (state. cache, node)
81
81
status *= " C"
82
+ elseif node in state. finished
83
+ status *= " F"
82
84
else
83
85
status *= " ?"
84
86
end
85
87
status
86
88
end
87
- offset == 0 && print (io, " ($(status_string (thunk)) ) " )
89
+ if offset == 0
90
+ println (io, " Ready ($(length (state. ready)) ): $(join (map (t-> t. id, state. ready), ' ,' )) " )
91
+ println (io, " Running: ($(length (state. running)) ): $(join (map (t-> t. id, collect (state. running)), ' ,' )) " )
92
+ print (io, " ($(status_string (thunk)) ) " )
93
+ end
88
94
println (io, " $(thunk. id) : $(thunk. f) " )
89
- for input in thunk. inputs
95
+ for (idx, input) in enumerate ( thunk. inputs)
90
96
input isa Thunk || continue
97
+ if idx > max_inputs
98
+ println (io, repeat (' ' , offset+ 2 ), " …" )
99
+ break
100
+ end
91
101
status = status_string (input)
92
102
if haskey (state. waiting, thunk) && input in state. waiting[thunk]
93
103
status *= " W"
@@ -99,7 +109,7 @@ function print_sch_status(io::IO, state, thunk; offset=0, limit=5)
99
109
status *= " d"
100
110
end
101
111
if haskey (state. futures, input)
102
- status *= " f$(length (state. futures[input])) "
112
+ status *= " f( $(length (state. futures[input]) ) )"
103
113
end
104
114
print (io, repeat (' ' , offset+ 2 ), " ($status ) " )
105
115
if limit > 0
0 commit comments