PerezHz / PlanetaryEphemeris.jl

Solar System ephemeris Taylor integrator based on JPL DE430/431 dynamical model
Other
21 stars 6 forks source link

`UndefVarError` when running `scripts/integrate_ephemeris.jl` with the new version of taylorize #9

Closed LuEdRaMo closed 1 year ago

LuEdRaMo commented 1 year ago

https://github.com/PerezHz/PlanetaryEphemeris.jl/pull/8 adapts the changes introduced by https://github.com/PerezHz/TaylorIntegration.jl/pull/156; however, when running scripts/integrate_ephemeris.jl I get the following error:

ERROR: TaskFailedException
Stacktrace:
 [1] wait
   @ .\task.jl:322 [inlined]
 [2] threading_run(func::Function)
   @ Base.Threads .\threadingconstructs.jl:34
 [3] jetcoeffs!
   @ .\threadingconstructs.jl:93 [inlined]
 [4] jetcoeffs!(#unused#::Val{PlanetaryEphemeris.DE430!}, t::Taylor1{Float64}, q::Vector{Taylor1{Float64}}, dq::Vector{Taylor1{Float64}}, params::Tuple{Int64, Float64}, __ralloc::TaylorIntegration.RetAlloc{Taylor1{Float64}})
   @ PlanetaryEphemeris .\none:0
 [5] top-level scope
   @ REPL[27]:1

    nested task error: UndefVarError: Rb2p not defined
    Stacktrace:
     [1] (::PlanetaryEphemeris.var"#795#threadsfor_fun#54"{Taylor1{Float64}, Taylor1{Float64}, Int64, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Art64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Vector{Taylor1{Float64}}, Taylor1{Float64}, Taylor1{Float64}, Taylor1{Float64}, Taylor1{Float64}, Int64, UnitRange{Int64}})(onethread::Bool)
       @ PlanetaryEphemeris .\threadingconstructs.jl:81
     [2] (::PlanetaryEphemeris.var"#795#threadsfor_fun#54"{Taylor1{Float64}, Taylor1{Float64}, Int64, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Array{Taylor1{Float64}, 3}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Matrix{Taylor1{Float64}}, Vector{Taylor1{Float64}}, Taylor1{Float64}, Taylor1{Float64}, Taylor1{Float64}, Taylor1{Float64}, Int64, UnitRange{Int64}})()
       @ PlanetaryEphemeris .\threadingconstructs.jl:48

The problem seems to rely on the fact that the specialized method of TaylorIntegration._allocate_jetcoeffs! defines Rb2p but the specialized method of TaylorIntegration.jetcoeffs! do not. The code generated by taylorize for the PlanetaryEphemeris.DE430! function can be found in https://github.com/LuEdRaMo/PlanetaryEphemeris.jl/blob/d67148c7e32d63d365e727ad620c9f2f186ad782/src/jetcoeffs.jl.

lbenet commented 1 year ago

Thanks for reporting @LuEdRaMo; I'll have a look on this in the next following days.

lbenet commented 1 year ago

@LuEdRaMo, can you give a try again using the macro? I just pushed a new commit (https://github.com/PerezHz/TaylorIntegration.jl/pull/156/commits/b5bc66e994f108c770570aab2fd7fde74654bf75) to TaylorIntegration, which allows having 4-index arrays, which I think it is the reason for the problem; previously, only up to 3-index arrays were handled.

LuEdRaMo commented 1 year ago

As it is right now scripts/integrate_ephemeris.jl throws the exact same error. I think it has to do with this comment https://github.com/PerezHz/TaylorIntegration.jl/pull/156#issuecomment-1381067772.

LuEdRaMo commented 1 year ago

After https://github.com/PerezHz/TaylorIntegration.jl/pull/156/commits/7194fe005b49feb65e117cf5a48a9580e6708deb scripts/integrate_ephemeris.jl runs with no problem.

lbenet commented 1 year ago

Closing, since this was solved by #156 (see this comment).