# @everywhere effect region / distributed calculation

**URL:** https://discourse.julialang.org/t/everywhere-effect-region-distributed-calculation/75359
**Category:** General Usage
**Tags:** question, distributed
**Created:** [January 28, 2022, 1:30pm UTC](https://discourse.julialang.org/t/everywhere-effect-region-distributed-calculation/75359 "2022-01-28T13:30:09Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![xspeng](https://avatars.discourse-cdn.com/v4/letter/x/90ced4/32.png) [@xspeng](https://discourse.julialang.org/u/xspeng)
#### Post date: [January 28, 2022, 1:30pm UTC](https://discourse.julialang.org/t/everywhere-effect-region-distributed-calculation/75359/1 "2022-01-28T13:30:09Z")

</div>

Hi, I have a problem with distributed calculation, here is a small example can reflect my question

```julia
@everywhere begin
    function f(x, b)
        return x^2 + sum(b)
    end
end

@everywhere using Distributed, SharedArrays

function example(a) # without parameter a, this works well, with parameter a, it reminds a not defined 

    @everywhere begin
        xmin = 0.0
        xmax = 10.0
        datapoints = 10
        xtemp = range(xmin, xmax, length = datapoints + 1)
        b = [1, a]
    end

    rel = SharedVector{Float64}(datapoints + 1)
    @sync @distributed for i = 1:datapoints+1
        rel[i] = f(xtemp[i], b)
    end
    return rel
end

c = example(1)

```

Don’t know why it cannot identify a, any suggestions ?
