Skip to content

Commit

Permalink
make couplingTimes abort if any replicate exceeds maxit
Browse files Browse the repository at this point in the history
  • Loading branch information
awllee committed Aug 14, 2019
1 parent a7f525a commit ed6fe96
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/couplingTime.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,22 @@ function couplingTimes(model::SMCModel, lM::F, N::Int64, n::Int64,
end
vs::Vector{Int64} = Vector{Int64}(undef, m)
p = Progress(div(m, nt), 10)
abort = false
Threads.@threads for i in 1:m
tid = Threads.threadid()
abort && break
vs[i] = couplingTime(model, lM, ccsmcios[tid], algorithm,
independentInitialization, rngCouple, maxit)
if vs[i] == 0
abort = true
end
tid == 1 && update!(p, i)
end
return vs
if abort
return [missing]
else
return vs
end
end

function couplingTimes(model::SMCModel, N::Int64, n::Int64, m::Int64,
Expand Down

0 comments on commit ed6fe96

Please sign in to comment.