ParallelStencil @init_parallel_stencil Workflow

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:

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:

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.

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.

1 Like

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

Yes, will do!