-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for cfunction + closures on Apple M1 chip #72
Comments
I get this same error, but intermittent. If I re-run the function to compile it works sometimes. Like, literally do nothing else, just re-run 2 times in a row and it'll work the second time. Weird |
Yeah, this isn't great. The M1 is popular and ARM is probably going to only get more popular in the future. I think this should be less frequent in Polyester 0.6.8, as it should now be avoiding |
I'm getting also this error on Edit: Oh, I see #131 |
Interesting. Running your MWE on a Snapdragon chip laptop doesn't error.
So, here's the story how I arrived here: I was running this example from Thunderbolt.jl and I get a similar error to yours ERROR: cfunction: closures are not supported on this platform
Stacktrace:
[1] macro expansion
@ ~/.julia/packages/Polyester/eqrC9/src/batch.jl:36 [inlined]
[2] batch_closure
@ ~/.julia/packages/Polyester/eqrC9/src/batch.jl:29 [inlined]
[3] macro expansion
@ ~/.julia/packages/Polyester/eqrC9/src/batch.jl:186 [inlined]
[4] _batch_no_reserve
@ ~/.julia/packages/Polyester/eqrC9/src/batch.jl:168 [inlined]
[5] batch
@ ~/.julia/packages/Polyester/eqrC9/src/batch.jl:334 [inlined]
[6] macro expansion
@ ~/.julia/packages/Polyester/eqrC9/src/closure.jl:456 [inlined]
[7] _update_pealinear_operator_on_subdomain!(beas::Thunderbolt.EAVector{…}, sdh::SubDofHandler{…}, element_cache::Thunderbolt.AnalyticalCoefficientElementCache{…}, time::Float64, chunksize::Int64)
@ Thunderbolt ~/.julia/dev/Thunderbolt/src/discretization/operator.jl:542
[8] macro expansion
@ ~/.julia/dev/Thunderbolt/src/discretization/operator.jl:531 [inlined]
[9] macro expansion
@ ~/.julia/packages/TimerOutputs/NRdsv/src/TimerOutput.jl:253 [inlined]
[10] _update_operator!(op::Thunderbolt.PEALinearOperator{…}, b::Vector{…}, time::Float64)
@ Thunderbolt ~/.julia/dev/Thunderbolt/src/discretization/operator.jl:522
[11] update_operator!
@ ~/.julia/dev/Thunderbolt/src/discretization/operator.jl:510 [inlined]
[12] macro expansion
@ ~/.julia/dev/Thunderbolt/src/solver/time/euler.jl:160 [inlined]
[13] macro expansion
@ ~/.julia/packages/TimerOutputs/NRdsv/src/TimerOutput.jl:253 [inlined]
[14] setup_solver_cache(f::TransientDiffusionFunction{…}, solver::BackwardEulerSolver{…}, t₀::Float64)
@ Thunderbolt ~/.julia/dev/Thunderbolt/src/solver/time/euler.jl:157
[15] #construct_inner_cache#283
@ ~/.julia/dev/Thunderbolt/src/solver/time/time_integrator.jl:122 [inlined]
[16] construct_inner_cache
@ ~/.julia/dev/Thunderbolt/src/solver/time/time_integrator.jl:121 [inlined]
[17] (::Thunderbolt.OS.var"#27#28"{Vector{…}, @Kwargs{…}, GenericSplitFunction{…}, LieTrotterGodunov{…}, Tuple{…}})(i::Int64)
@ Thunderbolt.OS ~/.julia/dev/Thunderbolt/src/solver/operator_splitting/solver.jl:36
[18] ntuple
@ ./ntuple.jl:19 [inlined]
[19] construct_inner_cache(f::GenericSplitFunction{…}, alg::LieTrotterGodunov{…}; uparent::Vector{…}, u0::Vector{…}, kwargs::@Kwargs{…})
@ Thunderbolt.OS ~/.julia/dev/Thunderbolt/src/solver/operator_splitting/solver.jl:36
[20] construct_inner_cache
@ ~/.julia/dev/Thunderbolt/src/solver/operator_splitting/solver.jl:30 [inlined]
[21] construct_inner_cache(f::GenericSplitFunction{…}, alg::Thunderbolt.ReactionTangentController{…}; u0::Vector{…}, kwargs::@Kwargs{…})
@ Thunderbolt ~/.julia/dev/Thunderbolt/src/solver/time/rtc.jl:98
[22] construct_inner_cache
@ ~/.julia/dev/Thunderbolt/src/solver/time/rtc.jl:97 [inlined]
[23] #init_cache#310
@ ~/.julia/dev/Thunderbolt/src/solver/time/rtc.jl:93 [inlined]
[24] init_cache
@ ~/.julia/dev/Thunderbolt/src/solver/time/rtc.jl:88 [inlined]
[25] __init(::OperatorSplittingProblem{…}, ::Thunderbolt.ReactionTangentController{…}; dt::Float64, tstops::Tuple{}, saveat::Nothing, save_everystep::Bool, callback::Nothing, advance_to_tstop::Bool, save_func::Thunderbolt.OS.var"#11#13", dtchangeable::Bool, kwargs::@Kwargs{…})
@ Thunderbolt.OS ~/.julia/dev/Thunderbolt/src/solver/operator_splitting/integrator.jl:75
[26] __init
@ ~/.julia/dev/Thunderbolt/src/solver/operator_splitting/integrator.jl:46 [inlined]
[27] init_call(_prob::OperatorSplittingProblem{…}, args::Thunderbolt.ReactionTangentController{…}; merge_callbacks::Bool, kwargshandle::Nothing, kwargs::@Kwargs{…})
@ DiffEqBase ~/.julia/packages/DiffEqBase/HW4ge/src/solve.jl:543
[28] init_call
@ ~/.julia/packages/DiffEqBase/HW4ge/src/solve.jl:516 [inlined]
[29] #init_up#43
@ ~/.julia/packages/DiffEqBase/HW4ge/src/solve.jl:569 [inlined]
[30] init_up
@ ~/.julia/packages/DiffEqBase/HW4ge/src/solve.jl:564 [inlined]
[31] #init#41
@ ~/.julia/packages/DiffEqBase/HW4ge/src/solve.jl:557 [inlined]
[32] top-level scope
@ ~/.julia/dev/Thunderbolt/examples/conduction-velocity-benchmark.jl:83
Some type information was truncated. Use `show(err)` to see complete types. However, if I run the example twice it does not error :D |
Hi everyone,
it seems that the
@batch
macro in combination with closures does not on thearm64-apple-darwin21.2.0
platform (Apple silicon). Any chance this could be fixed?Here is a MWE:
which produces this error message:
running on this system/Julia version:
Thanks a bunch for looking into this!
The text was updated successfully, but these errors were encountered: