Skip to content

Commit

Permalink
Add fault handler new proc to context
Browse files Browse the repository at this point in the history
  • Loading branch information
DrChainsaw committed Oct 1, 2020
1 parent 5e67f08 commit ebefe0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/fault-handler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ function handle_fault(ctx, state, thunk, oldproc, chan, node_order)

# Reschedule inputs from deadlist
newproc = OSProc(rand(workers()))
if newproc procs(ctx)
addprocs!(ctx, [newproc])
end
while length(deadlist) > 0
dt = popfirst!(deadlist)
if any((input in deadlist) for input in dt.inputs)
Expand Down
4 changes: 2 additions & 2 deletions src/scheduler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Sch
using Distributed
import MemPool: DRef

import ..Dagger: Context, Processor, Thunk, Chunk, OSProc, order, free!, dependents, noffspring, istask, inputs, affinity, tochunk, @dbg, @logmsg, timespan_start, timespan_end, unrelease, procs, move, choose_processor, execute!, rmprocs!
import ..Dagger: Context, Processor, Thunk, Chunk, OSProc, order, free!, dependents, noffspring, istask, inputs, affinity, tochunk, @dbg, @logmsg, timespan_start, timespan_end, unrelease, procs, move, choose_processor, execute!, rmprocs!, addprocs!

include("fault-handler.jl")

Expand Down Expand Up @@ -112,7 +112,7 @@ function compute_dag(ctx, d::Thunk; options=SchedulerOptions())
end

# Note: worker_state may be different things for different contexts. Don't touch it out here!
worker_state = assign_new_workers!(ctx ,ps, state, chan, node_order, worker_state)
worker_state = assign_new_workers!(ctx, ps, state, chan, node_order, worker_state)

if isempty(state.running)
# the block above fired only meta tasks
Expand Down

0 comments on commit ebefe0a

Please sign in to comment.