MPI.jl
MPI.jl copied to clipboard
Avoid closures for custom operators
To support custom operators for PowerPC and ARM, we will need to avoid using closures as these are not supported (https://github.com/JuliaLang/julia/pull/34326 and https://github.com/JuliaLang/julia/issues/32154). There might be performance advantages on other platforms as well.
We currently skip the relevant tests on these platforms (#353)
Some options:
- convert
Op(f, T=Any)
to a generated function - write a macro that allows us to "declare" custom operator/type combinations, i.e.
would define a non-closure@Op f T
cfunction
forOp(::typeof(f),::Type{T})
Is there any progress on this issue? I just ran into it on my ARM/M1 laptop and would like to help getting it fixed. Unfortunately, I do not have the necessary chops to go about this alone, but I would be willing to lend a hand, run tests on an M1 etc. if that would be useful.
May be relevant: https://discourse.julialang.org/t/ann-cclosure-jl-c-closures-like-what-c-does/81234
For non-closures, we could use the same approach used by @yuyichao here https://github.com/JuliaMath/GSL.jl/pull/132/files#diff-ed5863a4bdd6189a79314f8c6cb0d3acefa0fe9235e7df221e6686fedb9efc08R40-R48 There is a bit of an explanation on how it works here: https://github.com/JuliaMath/GSL.jl/pull/130#issuecomment-1875799180
Ah, I don't think that will work.