Skip to content

Commit a3a58fd

Browse files
committed
Merge branch 'master' of github.com:swift-lang/swift-t
2 parents 1f62967 + 8f90c00 commit a3a58fd

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

lb/code/src/server.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ xlb_server_init(const struct xlb_state *state)
152152
adlb_code code;
153153

154154
DEBUG("server_init()...");
155-
155+
156156
xlb_server_shutting_down = false;
157157

158158
list_i_init(&workers_shutdown);
@@ -416,10 +416,10 @@ static adlb_code xlb_process_ready_work(void)
416416
adlb_code rc;
417417
bool ready = false;
418418

419-
unused double t0 = MPI_Wtime();
420-
419+
unused double t0, t1;
421420
if (xlb_server_ready_work.count > 0)
422421
{
422+
t0 = MPI_Wtime();
423423
ready = true;
424424
DEBUG("xlb_process_ready_work(): count=%i",
425425
xlb_server_ready_work.count);
@@ -431,11 +431,10 @@ static adlb_code xlb_process_ready_work(void)
431431
ADLB_CHECK(rc);
432432
}
433433

434-
unused double t1 = MPI_Wtime();
435-
436434
if (ready)
437435
{
438-
INFO("xlb_process_ready_work(): %f", t1-t0);
436+
t1 = MPI_Wtime();
437+
DEBUG("xlb_process_ready_work(): %f", t1-t0);
439438
}
440439

441440
if (xlb_server_ready_work.size > 1024)

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)