# Scoping is too confusing with custom package and modules to use \`pmap\`

**URL:** <https://discourse.julialang.org/t/scoping-is-too-confusing-with-custom-package-and-modules-to-use-pmap/53383>\
**Category:** General Usage\
**Tags:** parallel, pmap\
**Created:** [January 15, 2021, 1:04pm UTC](https://discourse.julialang.org/t/scoping-is-too-confusing-with-custom-package-and-modules-to-use-pmap/53383 "2021-01-15T13:04:57Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![iHany](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihany/32/18151_2.png) [@iHany](https://discourse.julialang.org/u/iHany)\
**Post date:** [January 15, 2021, 1:14pm UTC](https://discourse.julialang.org/t/scoping-is-too-confusing-with-custom-package-and-modules-to-use-pmap/53383/2 "2021-01-15T13:14:26Z")

</div>

I do not fully understand but [this way](https://discourse.julialang.org/t/custom-modules-with-distributed/14321/2) works for me.

More precisely, change `test/runtests.jl` to this:

```julia
using Distributed
addprocs()

@everywhere push!(LOAD_PATH, ".")
@everywhere using MyPackage

result = pmap(myfunc, 1:10)
@show result

```

- result

```nohighlight
julia> include("test/runtests.jl")
result = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
10-element Array{Int64,1}:
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10

```

---

_[View the full topic](https://discourse.julialang.org/t/scoping-is-too-confusing-with-custom-package-and-modules-to-use-pmap/53383)._
