Skip to content

Commit

Permalink
Check for available procs list in function
Browse files Browse the repository at this point in the history
  • Loading branch information
DrChainsaw committed Oct 5, 2020
1 parent fd6eb8c commit e4efe56
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/scheduler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ function compute_dag(ctx, d::Thunk; options=SchedulerOptions())
continue
end

@assert !isempty(procs_to_use(ctx)) "No workers available available!!"

check_integrity(ctx)
# Check periodically for new workers in a parallel task so that we don't accidentally end up
# having to wait for 'take!(chan)' on some large task before new workers are put to work
# Lock is used to stop this task as soon as something pops out from the channel to minimize
Expand Down Expand Up @@ -174,6 +173,9 @@ function procs_to_use(ctx, options)
end
end

check_integrity(ctx) = check_integrity(ctx, ctx.options)
check_integrity(ctx, ::Any) = @assert !isempty(procs_to_use(ctx)) "No workers available!!"

# Main responsibility of this function is to check if new procs have been pushed to the context
function assign_new_procs!(ctx, state, chan, node_order, assignedprocs=[])
ps = procs_to_use(ctx)
Expand Down

0 comments on commit e4efe56

Please sign in to comment.