Skip to content

Commit 750ae1d

Browse files
committed
Better work type reporting
1 parent fc334d2 commit 750ae1d

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

turbine/code/lib/turbine.tcl

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,9 @@ namespace eval turbine {
226226

227227
if { $workers_running_sum >= $n_workers } {
228228
turbine_fail "Too many workers allocated to custom work types! \n" \
229-
"counts: " [ report_work_type_counts $n_workers_by_type ] "\n" \
230-
"Total workers: $n_workers \n" \
231-
"Custom workers: $workers_running_sum \n" \
229+
[ report_work_type_counts $n_workers_by_type ] "\n" \
230+
"Total workers: $n_workers" "\n" \
231+
"Custom workers: $workers_running_sum" "\n" \
232232
"Need at least one regular worker."
233233
}
234234

@@ -237,13 +237,19 @@ namespace eval turbine {
237237
dict set n_workers_by_type WORK $n_regular_workers
238238

239239
debug "WORKER TYPE COUNTS: $n_workers_by_type"
240-
240+
if { [ adlb::comm_rank ] == 0 } {
241+
getenv_integer TURBINE_DEBUG_WORKTYPES 0 debug_worktypes
242+
if $debug_worktypes {
243+
puts [ report_work_type_counts $n_workers_by_type ]
244+
}
245+
}
246+
241247
return [ dict create servers $n_servers workers $n_workers \
242248
workers_by_type $n_workers_by_type ]
243249
}
244250

245251
proc report_work_type_counts { n_workers_by_type } {
246-
set result [ list ]
252+
set result [ list "worktypes:" ]
247253
dict for { k v } $n_workers_by_type {
248254
lappend result "${k}:${v}"
249255
}
@@ -404,8 +410,9 @@ namespace eval turbine {
404410

405411
# Check that all executors in list have assigned workers and throw
406412
# error otherwise. Run after turbine::init
407-
proc check_can_execute { exec_names } {
413+
proc check_can_execute { args } {
408414
variable n_workers_by_type
415+
set exec_names $args
409416
foreach exec_name $exec_names {
410417
if { ( ! [ dict exists $n_workers_by_type $exec_name ] ) ||
411418
[ dict get $n_workers_by_type $exec_name ] <= 0 } {

0 commit comments

Comments
 (0)