Skip to content
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

ParallelStencil on 1.10 #125

Closed
albert-de-montserrat opened this issue Nov 13, 2023 · 6 comments
Closed

ParallelStencil on 1.10 #125

albert-de-montserrat opened this issue Nov 13, 2023 · 6 comments

Comments

@albert-de-montserrat
Copy link
Contributor

I have been testing Julia 1.10 (betas and rc1), and ParallelStencil doesn't seem to work. The @init_parallel_stencil seems not to do anything.

@omlins
Copy link
Owner

omlins commented Nov 14, 2023

Thanks for reporting, I have seen this issue and thought already about some ways to solve it. :)

@luraess
Copy link
Collaborator

luraess commented Nov 30, 2023

Can we prioritise this

@albert-de-montserrat
Copy link
Contributor Author

albert-de-montserrat commented Dec 4, 2023

I haven't fully tested if it has any side effects, and probably not very elegant or ideal, but this seems to fix it

const __is_initialized = Ref{Bool}(false)
const _package         = Ref{Symbol}(PKG_NONE)
const _numbertype      = Ref{DataType}(NUMBERTYPE_NONE)
const _ndims           = Ref{Integer}(NDIMS_NONE)
const _inbounds        = Ref{Bool}(false)
const _memopt          = Ref{Bool}(false)

let
    global _is_initialized, set_initialized, set_package, get_package, set_numbertype, get_numbertype, set_ndims, get_ndims, set_inbounds, get_inbounds, set_memopt, get_memopt, check_initialized, check_already_initialized
    _is_initialized::Bool       = __is_initialized[]  
    set_initialized(flag::Bool) = (__is_initialized[] = flag)
    is_initialized()            = __is_initialized[]
    set_package(pkg::Symbol)    = (_package[] = pkg)
    get_package()               = _package[]
    set_numbertype(T::DataType) = (_numbertype[] = T)
    get_numbertype()            = _numbertype[]
    set_ndims(n::Integer)       = (_ndims[] = n)
    get_ndims()                 = _ndims[]
    set_inbounds(flag::Bool)    = (_inbounds[] = flag)
    get_inbounds()              = _inbounds[]
    set_memopt(flag::Bool)      = (_memopt[] = flag)
    get_memopt()                = _memopt[]
   # etc... everything else below remains the same
end

@omlins
Copy link
Owner

omlins commented Dec 11, 2023

I haven't fully tested if it has any side effects, and probably not very elegant or ideal, but this seems to fix it

const __is_initialized = Ref{Bool}(false)
const _package         = Ref{Symbol}(PKG_NONE)
const _numbertype      = Ref{DataType}(NUMBERTYPE_NONE)
const _ndims           = Ref{Integer}(NDIMS_NONE)
const _inbounds        = Ref{Bool}(false)
const _memopt          = Ref{Bool}(false)

let
    global _is_initialized, set_initialized, set_package, get_package, set_numbertype, get_numbertype, set_ndims, get_ndims, set_inbounds, get_inbounds, set_memopt, get_memopt, check_initialized, check_already_initialized
    _is_initialized::Bool       = __is_initialized[]  
    set_initialized(flag::Bool) = (__is_initialized[] = flag)
    is_initialized()            = __is_initialized[]
    set_package(pkg::Symbol)    = (_package[] = pkg)
    get_package()               = _package[]
    set_numbertype(T::DataType) = (_numbertype[] = T)
    get_numbertype()            = _numbertype[]
    set_ndims(n::Integer)       = (_ndims[] = n)
    get_ndims()                 = _ndims[]
    set_inbounds(flag::Bool)    = (_inbounds[] = flag)
    get_inbounds()              = _inbounds[]
    set_memopt(flag::Bool)      = (_memopt[] = flag)
    get_memopt()                = _memopt[]
   # etc... everything else below remains the same
end

Thanks for your idea, @albert-de-montserrat ! I'm actually working on this issue and my idea would be to create a solution that relies on extensions and preferences. As soon as I have something for you to try, I will share it with you. My goal is also to solve all the packaging difficulties in the same go...

@omlins
Copy link
Owner

omlins commented Dec 14, 2023

The root cause for it is this bug in Julia 1.10: JuliaLang/julia#52531

@omlins
Copy link
Owner

omlins commented Jan 3, 2024

This issue was solved here: JuliaLang/julia#52531

@omlins omlins closed this as completed Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants