You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is probably intended, but I get strange errors, when trying to use loggers inside @floop
This code
using FLoops
functionfoo(ex =ThreadedEx())
@floop ex for i in1:10@info"" i Threads.threadid()
endend
produces error (during compilation, I didn't even had a chance to execute the code
ERROR: LoadError: deepcopy of Modules not supported
Stacktrace:
[1] FLoops ~/.julia/packages/FLoops/yli1G/src/macro.jl:51var"@floop"(__source__::LineNumberNode, __module__::Module, executor::Any, ex::Any)
[2] FLoops ~/.julia/packages/FLoops/yli1G/src/reduce.jl:269floop_parallel(ctx::FLoops.MacroContext, ex::Expr, simd::Bool, executor::Symbol)
[3] FLoops ~/.julia/packages/FLoops/yli1G/src/reduce.jl:385as_parallel_loop(ctx::FLoops.MacroContext, rf_arg::Symbol, coll::Expr, body0::Expr, simd::Bool
, executor::Symbol)
[4] ./deepcopy.jl:26 [inlined]
deepcopy
[5] Base ./deepcopy.jl:65deepcopy_internal(x::Any, stackdict::IdDict{Any, Any})
[6] Base ./deepcopy.jl:92deepcopy_internal(x::Vector{Any}, stackdict::IdDict{Any, Any})
[7] Base ./deepcopy.jl:105_deepcopy_array_t(x::Array, T::Type, stackdict::IdDict{Any, Any})
[8] Base ./deepcopy.jl:65deepcopy_internal(x::Any, stackdict::IdDict{Any, Any})
[9] Base ./deepcopy.jl:92deepcopy_internal(x::Vector{Any}, stackdict::IdDict{Any, Any})
[10] Base ./deepcopy.jl:105_deepcopy_array_t(x::Array, T::Type, stackdict::IdDict{Any, Any})
[11] Base ./deepcopy.jl:65deepcopy_internal(x::Any, stackdict::IdDict{Any, Any})
[12] Base ./deepcopy.jl:92deepcopy_internal(x::Vector{Any}, stackdict::IdDict{Any, Any})
[13] Base ./deepcopy.jl:105_deepcopy_array_t(x::Array, T::Type, stackdict::IdDict{Any, Any})
[14] Base ./deepcopy.jl:65deepcopy_internal(x::Any, stackdict::IdDict{Any, Any})
[15] Base ./deepcopy.jl:92deepcopy_internal(x::Vector{Any}, stackdict::IdDict{Any, Any})
[16] Base ./deepcopy.jl:105_deepcopy_array_t(x::Array, T::Type, stackdict::IdDict{Any, Any})
[17] Base ./deepcopy.jl:65deepcopy_internal(x::Any, stackdict::IdDict{Any, Any})
[18] Base ./deepcopy.jl:92deepcopy_internal(x::Vector{Any}, stackdict::IdDict{Any, Any})
[19] Base ./deepcopy.jl:105_deepcopy_array_t(x::Array, T::Type, stackdict::IdDict{Any, Any})
[20] Base ./deepcopy.jl:65deepcopy_internal(x::Any, stackdict::IdDict{Any, Any})
[21] Base ./deepcopy.jl:92deepcopy_internal(x::Vector{Any}, stackdict::IdDict{Any, Any})
[22] Base ./deepcopy.jl:105_deepcopy_array_t(x::Array, T::Type, stackdict::IdDict{Any, Any})
[23] Base ./deepcopy.jl:65deepcopy_internal(x::Any, stackdict::IdDict{Any, Any})
[24] Base ./deepcopy.jl:92deepcopy_internal(x::Vector{Any}, stackdict::IdDict{Any, Any})
[25] Base ./deepcopy.jl:105_deepcopy_array_t(x::Array, T::Type, stackdict::IdDict{Any, Any})
[26] Base ./deepcopy.jl:33deepcopy_internal(x::Module, stackdict::IdDict{Any, Any})
[27] Base ./error.jl:33error(s::String)
N.B.: ThreadsX do not have this problem
using ThreadsX
julia> ThreadsX.foreach(1:10) do i
@info"" i Threads.threadid()
end
[2021-08-0722:53:35] Info: i =1, Threads.threadid() =2
[2021-08-0722:53:35] Info: i =2, Threads.threadid() =3
[2021-08-0722:53:35] Info: i =9, Threads.threadid() =4
[2021-08-0722:53:35] Info: i =3, Threads.threadid() =1
[2021-08-0722:53:35] Info: i =5, Threads.threadid() =4
[2021-08-0722:53:35] Info: i =4, Threads.threadid() =3
[2021-08-0722:53:35] Info: i =6, Threads.threadid() =1
[2021-08-0722:53:35] Info: i =10, Threads.threadid() =2
[2021-08-0722:53:35] Info: i =7, Threads.threadid() =4
[2021-08-0722:53:35] Info: i =8, Threads.threadid() =3
The text was updated successfully, but these errors were encountered:
This is probably intended, but I get strange errors, when trying to use loggers inside
@floop
This code
produces error (during compilation, I didn't even had a chance to execute the code
N.B.:
ThreadsX
do not have this problemThe text was updated successfully, but these errors were encountered: