# Get an error when keep certain variables only on the main process

**URL:** <https://discourse.julialang.org/t/get-an-error-when-keep-certain-variables-only-on-the-main-process/35738>\
**Category:** Julia at Scale\
**Tags:** question\
**Created:** [March 8, 2020, 11:58pm UTC](https://discourse.julialang.org/t/get-an-error-when-keep-certain-variables-only-on-the-main-process/35738 "2020-03-08T23:58:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zxjroger](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zxjroger/32/11826_2.png) [@zxjroger](https://discourse.julialang.org/u/zxjroger)\
**Post date:** [March 8, 2020, 11:58pm UTC](https://discourse.julialang.org/t/get-an-error-when-keep-certain-variables-only-on-the-main-process/35738/1 "2020-03-08T23:58:08Z")

</div>

I am trying to learn parallel computing in Julia. I want to send something to every processes, but keep other things only at the main process. I had the following weird error.

My sample code is (for simplicity):

```julia
using Distributed
addprocs(3) # my computer has two cores four threads, so add extra 3 processes
@everywhere using Distributions
@everywhere N = 3 # this variable N should be in all processes

# for the following two lines, I only need them to be in the main process
push!(LOAD_PATH,"pwd()")
using MyModule # this is a module I created

```

When I run my code in Atom, I got the following error:

```julia
On worker 2:
ArgumentError: Package fake_data_simple_matching [top-level] is required but does not seem to be installed:
 - Run `Pkg.instantiate()` to install all recorded dependencies.

```

However, if I re-evaluate the last two lines, it does not report an error. I couldn’t find out the reason. I thought that if I do not add `@everywhere`, then the last two lines should automatically be evaluated by the main process.

I have another question. As a continuation of my code, I have

```julia
temp = MyModule.foo() # foo is a function in the module

```

I want to put `temp` on every processes. I understand that adding `@everywhere` before `temp` will not work because the module is only defined on the main process. So what function should I use to send `temp` to every process? Should I code as

```julia
@spawnat :any temp

```
