Giter Site home page Giter Site logo

Comments (3)

omlins avatar omlins commented on May 29, 2024 1

NotInitializedError: no macro or function of the module can be called before @init_parallel_stencil.

This error means that the call to macro @parallel_indices was found before any call to macro @init_parallel_stencil. Note that Julia macros are evaluated simply from top to bottom of a file, independent of the control flow of your application ( just like C pre-processor macros).

It cannot have anything to do with using parallel_indices instead of @parallel, except if there would be a well and long hidden bug.

Should this not allow you to solve your issue, please share a minimal "working" example that allows to reproduce it.

from parallelstencil.jl.

omlins avatar omlins commented on May 29, 2024

Having a great time using this package

Hi @DanW97 , I am glad to hear that!

that involves tagging some functions with @parallel_indices. During precompilation to test an example I have written it errors out as I obviously haven't created a stencil yet.

Could you share the error message, please?

from parallelstencil.jl.

DanW97 avatar DanW97 commented on May 29, 2024

Yeah sure

ERROR: LoadError: NotInitializedError: no macro or function of the module can be called before @init_parallel_stencil.
Stacktrace:
  [1] check_initialized()
    @ ParallelStencil ~/.julia/packages/ParallelStencil/3flwf/src/init_parallel_stencil.jl:68
  [2] var"@parallel_indices"(__source__::LineNumberNode, __module__::Module, args::Vararg{Any})
    @ ParallelStencil ~/.julia/packages/ParallelStencil/3flwf/src/init_parallel_stencil.jl:5
  [3] #macroexpand#51
    @ ./expr.jl:115 [inlined]
  [4] macroexpand
    @ ./expr.jl:114 [inlined]
  [5] docm(source::LineNumberNode, mod::Module, meta::Any, ex::Any, define::Bool) (repeats 2 times)
    @ Base.Docs ./docs/Docs.jl:537
  [6] (::DocStringExtensions.var"#32#33"{typeof(DocStringExtensions.template_hook)})(::LineNumberNode, ::Vararg{Any})
    @ DocStringExtensions ~/.julia/packages/DocStringExtensions/iscC8/src/templates.jl:11
  [7] var"@doc"(::LineNumberNode, ::Module, ::String, ::Vararg{Any})
    @ Core ./boot.jl:517
  [8] eval
    @ ./boot.jl:373 [inlined]
  [9] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String)
    @ Base ./loading.jl:1196
 [10] include_string(m::Module, txt::String, fname::String)
    @ Base ./loading.jl:1206
 [11] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Base ./essentials.jl:716
 [12] invokelatest(::Any, ::Any, ::Vararg{Any})
    @ Base ./essentials.jl:714
 [13] inlineeval(m::Module, code::String, code_line::Int64, code_column::Int64, file::String; softscope::Bool)
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.10/scripts/packages/VSCodeServer/src/eval.jl:211
 [14] (::VSCodeServer.var"#60#64"{Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.10/scripts/packages/VSCodeServer/src/eval.jl:155
 [15] withpath(f::VSCodeServer.var"#60#64"{Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams}, path::String)
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.10/scripts/packages/VSCodeServer/src/repl.jl:184
 [16] (::VSCodeServer.var"#59#63"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.10/scripts/packages/VSCodeServer/src/eval.jl:153
 [17] hideprompt(f::VSCodeServer.var"#59#63"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.10/scripts/packages/VSCodeServer/src/repl.jl:36
 [18] (::VSCodeServer.var"#58#62"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.10/scripts/packages/VSCodeServer/src/eval.jl:124
 [19] with_logstate(f::Function, logstate::Any)
    @ Base.CoreLogging ./logging.jl:511
 [20] with_logger
    @ ./logging.jl:623 [inlined]
 [21] (::VSCodeServer.var"#57#61"{VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.6.10/scripts/packages/VSCodeServer/src/eval.jl:201
 [22] #invokelatest#2
    @ ./essentials.jl:716 [inlined]
 [23] invokelatest(::Any)
    @ Base ./essentials.jl:714
 [24] macro expansion
    @ ~/.vscode/extensions/julialang.language-julia-1.6.10/scripts/packages/VSCodeServer/src/eval.jl:34 [inlined]
 [25] (::VSCodeServer.var"#55#56")()
    @ VSCodeServer ./task.jl:423
in expression starting at /home/dan/Njord/src/collisions.jl:32

The offending function within collisions.jl is

@parallel_indices (ix, iy, iz) function collide_bgk!::T, F::AbstractArray{T}, Feq::AbstractArray{T}) where {T <: AbstractFloat} 
    F[ix, iy, iz, :] -= ω * (F[ix, iy, iz, :] - Feq[ix, iy, iz, :])
    return
end

When running, I ran a script from the examples directory of my package, which has the necessary init commands as are at the top of the files within miniapps and it'd fail during precompilation.

from parallelstencil.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.