Skip to content

Commit

Permalink
auto add packages for now if they aren't available
Browse files Browse the repository at this point in the history
  • Loading branch information
tlnagy committed May 11, 2016
1 parent 2fdca4b commit 0cd1c39
Showing 1 changed file with 18 additions and 12 deletions.
30 changes: 18 additions & 12 deletions src/run.jl
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
using DataFrames
using Distributions
using HypothesisTests
using StatsBase
using Iterators

# these packages are used in the simulations and must be loaded on
# all workers
@everywhere using DataFrames
@everywhere using Distributions
@everywhere using HypothesisTests
@everywhere using StatsBase
packages = [:DataFrames,
:Distributions,
:HypothesisTests,
:StatsBase,
:Iterators]
all_workers = packages[1:4]
installed = Pkg.installed()
for package in packages
try
Pkg.installed(string(package))
eval(:(using $package))
if package in all_workers
eval(:(@everywhere using $package))
end
catch
Pkg.add(string(package))
end
end

# load all simulations files on all workers
@everywhere function include_all()
Expand Down

0 comments on commit 0cd1c39

Please sign in to comment.