Hi there!
Test.jl and @testset
are saving my package in a funny way (and I don’t understand why yet). I am making a semi-automated performance checking package PerfChecker.jl
I use a method in the package with one of its argument being a function called pre_alloc
(see the error below). Probably due to environment issues on a distributed worker, the error below is raised.
The code is in /perf/allocs.jl
and it uses an env local to /perf/
The funny part is that it works perfectly fine within a test environment (such as the one in test/runtests.jl
).
Any idea of what is happening, and how can I make it work outside the (magical) test env?
Issue Allocations check works only within a test environment · Issue #2 · JuliaConstraints/PerfChecker.jl (github.com) is open to discuss it.
ERROR: LoadError: On worker 2:
UndefVarError: #pre_alloc not defined
Stacktrace:
[1] deserialize_datatype
@ C:\Users\jeanf\.julia\juliaup\julia-1.7.0-rc2+0~x64\share\julia\stdlib\v1.7\Serialization\src\Serialization.jl:1332
[2] handle_deserialize
@ C:\Users\jeanf\.julia\juliaup\julia-1.7.0-rc2+0~x64\share\julia\stdlib\v1.7\Serialization\src\Serialization.jl:854
[3] deserialize
@ C:\Users\jeanf\.julia\juliaup\julia-1.7.0-rc2+0~x64\share\julia\stdlib\v1.7\Serialization\src\Serialization.jl:801
[4] handle_deserialize
@ C:\Users\jeanf\.julia\juliaup\julia-1.7.0-rc2+0~x64\share\julia\stdlib\v1.7\Serialization\src\Serialization.jl:861
[5] deserialize
@ C:\Users\jeanf\.julia\juliaup\julia-1.7.0-rc2+0~x64\share\julia\stdlib\v1.7\Serialization\src\Serialization.jl:801
[6] deserialize_expr
@ C:\Users\jeanf\.julia\juliaup\julia-1.7.0-rc2+0~x64\share\julia\stdlib\v1.7\Serialization\src\Serialization.jl:1240
[7] handle_deserialize
@ C:\Users\jeanf\.julia\juliaup\julia-1.7.0-rc2+0~x64\share\julia\stdlib\v1.7\Serialization\src\Serialization.jl:881
[8] deserialize
@ C:\Users\jeanf\.julia\juliaup\julia-1.7.0-rc2+0~x64\share\julia\stdlib\v1.7\Serialization\src\Serialization.jl:801
[9] deserialize_expr
@ C:\Users\jeanf\.julia\juliaup\julia-1.7.0-rc2+0~x64\share\julia\stdlib\v1.7\Serialization\src\Serialization.jl:1240
[10] handle_deserialize
@ C:\Users\jeanf\.julia\juliaup\julia-1.7.0-rc2+0~x64\share\julia\stdlib\v1.7\Serialization\src\Serialization.jl:881
[11] deserialize
@ C:\Users\jeanf\.julia\juliaup\julia-1.7.0-rc2+0~x64\share\julia\stdlib\v1.7\Serialization\src\Serialization.jl:801
[12] #5
@ C:\Users\jeanf\.julia\juliaup\julia-1.7.0-rc2+0~x64\share\julia\stdlib\v1.7\Serialization\src\Serialization.jl:960
[13] ntupleany
@ .\ntuple.jl:43
[14] deserialize_tuple
@ C:\Users\jeanf\.julia\juliaup\julia-1.7.0-rc2+0~x64\share\julia\stdlib\v1.7\Serialization\src\Serialization.jl:960
[15] handle_deserialize
@ C:\Users\jeanf\.julia\juliaup\julia-1.7.0-rc2+0~x64\share\julia\stdlib\v1.7\Serialization\src\Serialization.jl:844
[16] deserialize
@ C:\Users\jeanf\.julia\juliaup\julia-1.7.0-rc2+0~x64\share\julia\stdlib\v1.7\Serialization\src\Serialization.jl:801 [inlined]
[17] deserialize_msg
@ C:\Users\jeanf\.julia\juliaup\julia-1.7.0-rc2+0~x64\share\julia\stdlib\v1.7\Distributed\src\messages.jl:87
[18] #invokelatest#2
@ .\essentials.jl:716 [inlined]
[19] invokelatest
@ .\essentials.jl:714 [inlined]
[20] message_handler_loop
@ C:\Users\jeanf\.julia\juliaup\julia-1.7.0-rc2+0~x64\share\julia\stdlib\v1.7\Distributed\src\process_messages.jl:169
[21] process_tcp_streams
@ C:\Users\jeanf\.julia\juliaup\julia-1.7.0-rc2+0~x64\share\julia\stdlib\v1.7\Distributed\src\process_messages.jl:126
[22] #99
@ .\task.jl:411
Stacktrace:
[1] remotecall_fetch(::Function, ::Distributed.Worker, ::Module, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Distributed C:\Users\jeanf\.julia\juliaup\julia-1.7.0-rc2+0~x64\share\julia\stdlib\v1.7\Distributed\src\remotecall.jl:449
[2] remotecall_fetch(::Function, ::Distributed.Worker, ::Module, ::Vararg{Any})
@ Distributed C:\Users\jeanf\.julia\juliaup\julia-1.7.0-rc2+0~x64\share\julia\stdlib\v1.7\Distributed\src\remotecall.jl:441
[3] #remotecall_fetch#158
@ C:\Users\jeanf\.julia\juliaup\julia-1.7.0-rc2+0~x64\share\julia\stdlib\v1.7\Distributed\src\remotecall.jl:476 [inlined]
[4] remotecall_fetch
@ C:\Users\jeanf\.julia\juliaup\julia-1.7.0-rc2+0~x64\share\julia\stdlib\v1.7\Distributed\src\remotecall.jl:476 [inlined]
[5] remotecall_eval(m::Module, pid::Int64, ex::Expr)
@ Distributed C:\Users\jeanf\.julia\juliaup\julia-1.7.0-rc2+0~x64\share\julia\stdlib\v1.7\Distributed\src\macros.jl:242
[6] top-level scope
@ C:\Users\jeanf\.julia\juliaup\julia-1.7.0-rc2+0~x64\share\julia\stdlib\v1.7\Distributed\src\macros.jl:203
[7] eval
@ .\boot.jl:373 [inlined]
[8] alloc_check(title::String, dependencies::Vector{Module}, targets::Vector{Module}, pre_alloc::Function, alloc::Function; path::String)
@ PerfChecker C:\Users\jeanf\.julia\packages\PerfChecker\U7mGz\src\allocations.jl:21
[9] top-level scope
@ C:\Users\jeanf\.julia\dev\PerfChecker\perf\allocs.jl:15
[10] include(fname::String)
@ Base.MainInclude .\client.jl:451
[11] top-level scope
@ REPL[11]:1
in expression starting at C:\Users\jeanf\.julia\dev\PerfChecker\perf\allocs.jl:15