# ParallelStencil @init\_parallel\_stencil Workflow

**URL:** <https://discourse.julialang.org/t/parallelstencil-init-parallel-stencil-workflow/115713>\
**Category:** Modelling & Simulations\
**Created:** [June 16, 2024, 10:21am UTC](https://discourse.julialang.org/t/parallelstencil-init-parallel-stencil-workflow/115713 "2024-06-16T10:21:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdm204](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jdm204/32/39289_2.png) [@jdm204](https://discourse.julialang.org/u/jdm204)\
**Post date:** [June 16, 2024, 10:21am UTC](https://discourse.julialang.org/t/parallelstencil-init-parallel-stencil-workflow/115713/1 "2024-06-16T10:21:57Z")

</div>

Hi, ParallelStencil is great, but I’ve ran into a development pain point and was wondering if anyone can guide me.

Say I’m developing a package that exports a `diffuse!` function that calculates an iteration of diffusion using a `@parallel` function.

I believe I have to have lines like:

```julia
using ParallelStencil
@init_parallel_stencil(Threads, Float64, 3);

```

inside the package, otherwise I get errors when `using MyPackage` because `MyPackage` contains `@parallel function` definitions.

The problem is during development, when I change package code (after activating its environment and `using MyPackage`), I get an error due to Revise reloading my package code, which looks like this:

```julia
NotInitializedError: no ParallelStencil macro or function can be called before @init_parallel_stencil in each module (missing call in MyPackage)

```

meaning I have to restart Julia after essentially each change in `MyPackage`.

---

<div class="post-metadata">

**Author:** ![samo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/samo/32/35398_2.png) [@samo](https://discourse.julialang.org/u/samo)\
**Post date:** [June 16, 2024, 1:44pm UTC](https://discourse.julialang.org/t/parallelstencil-init-parallel-stencil-workflow/115713/2 "2024-06-16T13:44:19Z")

</div>

Hi @jdm204 , thanks for sharing your issue.  
From your description alone I’m not completely sure where the issue is. Looking at the error message, it seems to me like Revise is cleaning out the ParallelStencil initialization and does then not restore it. If that so, I think this would need to be fixed in Revise.

---

<div class="post-metadata">

**Author:** ![samo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/samo/32/35398_2.png) [@samo](https://discourse.julialang.org/u/samo)\
**Post date:** [June 17, 2024, 8:58am UTC](https://discourse.julialang.org/t/parallelstencil-init-parallel-stencil-workflow/115713/3 "2024-06-17T08:58:36Z")

</div>

Can you open up an issue in Revise.jl and put me in copy?

---

<div class="post-metadata">

**Author:** ![jdm204](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jdm204/32/39289_2.png) [@jdm204](https://discourse.julialang.org/u/jdm204)\
**Post date:** [June 17, 2024, 9:46am UTC](https://discourse.julialang.org/t/parallelstencil-init-parallel-stencil-workflow/115713/4 "2024-06-17T09:46:39Z")

</div>

Yes, will do!
