Skip to content

Commit abff042

Browse files
fix distributed testing setup
1 parent 28a6572 commit abff042

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

test/downstream/distributed_ensemble.jl

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
using Distributed
22
addprocs(2)
33
println("There are $(nprocs()) processes")
4-
@everywhere using OrdinaryDiffEq
54

6-
@everywhere prob = ODEProblem((u,p,t)->1.01u,0.5,(0.0,1.0))
7-
@everywhere u0s = [rand()*prob.u0 for i in 1:2]
8-
@everywhere function prob_func(prob,i,repeat)
9-
println("Running trajectory $i")
10-
ODEProblem(prob.f,u0s[i],prob.tspan)
5+
@everywhere begin
6+
using Pkg
7+
Pkg.activate("downstream")
8+
Pkg.develop(PackageSpec(path=joinpath(pwd(), "..")))
9+
Pkg.instantiate()
10+
using OrdinaryDiffEq
11+
prob = ODEProblem((u,p,t)->1.01u,0.5,(0.0,1.0))
12+
u0s = [rand()*prob.u0 for i in 1:2]
13+
function prob_func(prob,i,repeat)
14+
println("Running trajectory $i")
15+
ODEProblem(prob.f,u0s[i],prob.tspan)
16+
end
1117
end
1218

1319
ensemble_prob = EnsembleProblem(prob, prob_func=prob_func)

0 commit comments

Comments
 (0)