Skip to content

Commit

Permalink
use @everywhere in distributed bootstrap example (#764)
Browse files Browse the repository at this point in the history
  • Loading branch information
palday committed Apr 23, 2024
1 parent 95a367d commit de39654
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion docs/src/bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,20 @@ For computers with many processors (as opposed to a single processor with severa

```@example Main
using Distributed
using ProgressMeter
# you already have 1 proc by default, so add the number of additional cores with `addprocs`
# you need at least as many RNGs as cores you want to use in parallel
# but you shouldn't use all of your cores because nested within this
# is the multithreading of the linear algebra
# addprocs(1)
@info "Currently using $(nprocs()) processors total and $(nworkers()) for work"
# Load the necessary packages on all workers
# For clusters, you will also need to make sure that the Julia
# environment (Project.toml) is set up and activated on each worker.
@everywhere begin
using ProgressMeter
using MixedModels
end
# copy everything to workers
@showprogress for w in workers()
remotecall_fetch(() -> coefnames(m2), w)
Expand Down

0 comments on commit de39654

Please sign in to comment.