Skip to content

Commit

Permalink
Remove sending to workers the functions since they should be sent before
Browse files Browse the repository at this point in the history
  • Loading branch information
ShlokG committed Aug 12, 2021
1 parent bb6487a commit cd38945
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/filters/tempered_particle_filter/correction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function weight_kernel!(coeff_terms::V, log_e_1_terms::V, log_e_2_terms::V,
if poolmodel
if parallel
sendto(workers(), s_t_nontemp = s_t_nontemp)
sendto(workers(), Ψ = Ψ)
# sendto(workers(), Ψ = Ψ) ## Should be sent to all workers before calling the function
measurement_closure(i::Int) = log(Ψ(s_t_nontemp[:,i])) # pred dens passed -> log it
@everywhere measurement_closure(i::Int) = log(Ψ(s_t_nontemp[:,i]))

Expand Down Expand Up @@ -60,10 +60,10 @@ function weight_kernel!(coeff_terms::V, log_e_1_terms::V, log_e_2_terms::V,
end
else
if parallel
# sendto(workers(), Ψ = Ψ) ## Should be sent to all workers before calling the function
sendto(workers(), y_t = y_t)
sendto(workers(), s_t_nontemp = s_t_nontemp)
sendto(workers(), inv_HH = inv_HH)
sendto(workers(), Ψ = Ψ)

function error_closure(i::Int)
error = y_t - Ψ(s_t_nontemp[:, i])
Expand Down
4 changes: 2 additions & 2 deletions src/filters/tempered_particle_filter/mutation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ function mutation!(Φ::Function, Ψ::Function, QQ::Matrix{Float64},
sendto(workers(), ϵ_t = ϵ_t)
sendto(workers(), dist_ϵ = dist_ϵ)
sendto(workers(), y_t = y_t)
sendto(workers(), Φ = Φ)
sendto(workers(), Ψ = Ψ)
# sendto(workers(), Φ = Φ) ## Should be sent to all workers before calling the function
# sendto(workers(), Ψ = Ψ) ## Should be sent to all workers before calling the function
sendto(workers(), scaled_inv_HH = scaled_inv_HH)

mh_steps_closure(i::Int) = mh_steps(Φ, Ψ, dist_ϵ, y_t, s_t1[:,i], s_t[:,i], ϵ_t[:,i],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ function tempered_particle_filter(data::AbstractArray, Φ::Function, Ψ::Functio
end
sendto(workers(), s_t1_temp = s_t1_temp)
sendto(workers(), ϵ_t = ϵ_t)
sendto(workers(), Φ = Φ)
# sendto(workers(), Φ = Φ) ## Should be sent to all workers before calling the function

state_transition_closure(i::Int) = Φ(s_t1_temp[:, i], ϵ_t[:, i])
@everywhere state_transition_closure(i::Int) = Φ(s_t1_temp[:, i], ϵ_t[:, i])
Expand Down

0 comments on commit cd38945

Please sign in to comment.