Revise.jl icon indicating copy to clipboard operation
Revise.jl copied to clipboard

Unable to Revise a package using ParallelStencil.jl

Open jdm204 opened this issue 8 months ago • 0 comments

Hi, Revise is brilliant. I've ran into an issue revising package code that uses ParallelStencil.

ParallelStencil provides macros such as @parallel to annotate functions with, but before these annotations can be used, an initialisation macro must be run first, so I have this at the top level of my package:

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

before including other files with @parallel calls.

My development workflow involves activiating MyPackage environment, using MyPackage, and then testing out bits of code in the REPL, editing the package, Revise reloads, back to the REPL, etc.

The problem is, this workflow breaks when using Revise and ParallelStencil in combination, as upon the first code change in the session (not necessarily to any ParallelStencil-involved code), Revise does its thing, but I get an error:

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

That I didn't call the init macro, despite it appearing before any other ParallelStencil macros in my package.

CC @omlins who thought this might be a Revise issue

jdm204 avatar Jun 17 '24 09:06 jdm204