Allowing a DArray to do as standard Array does
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- julia
- Domaine
- distributed-systems
Piste de recherche
Commencez par le MWE et le chemin distribué matrice-vecteur dans src/linalg.jl, en particulier les lignes 107 et 111 indiquées par la trace de la pile. Reproduisez-le avec des workers Julia et comparez l’opération DArray au cas d’un Array local ; c’est terminé lorsque le calcul personnalisé Foo n’échoue plus sur les workers.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Dear All,
I'm considering the following MWE, which consists of creating a matrix and vector of a struct an doing a calculation on them. I import the relevant mathematical operators from base, and it just works. Next I addprocs and try it with DArray, and the same calculation fails. Is there a way to enable this kind of functionality? It's definitely possible that I'm barking up the wrong tree and there's a much better way of achieving this - please let me know!
using Distributed
import Base.+, Base.*, Base.zero
let
struct Foo{T<:Number}
x::T
end
Base.:+(a::Foo, b::Foo) = Foo(a.x + b.x)
Base.:*(a::Foo, b::Foo) = Foo(a.x * b.x)
Base.:zero(a::Foo{T}) where {T} = Foo(zero(T))
function runlocal()
A = [Foo(rand()) for i in 1:3, j in 1:3]
b = [Foo(rand()) for j in 1:3]
@show A * b
end
runlocal()
end
addprocs(2)
@everywhere using DistributedArrays
@everywhere let
struct Foo{T<:Number}
x::T
end
Base.:+(a::Foo, b::Foo) = Foo(a.x + b.x)
Base.:*(a::Foo, b::Foo) = Foo(a.x * b.x)
Base.:zero(a::Foo{T}) where {T} = Foo(zero(T))
function rundistributed()
A = @DArray [Foo(rand()) for i in 1:3, j in 1:3]
b = @DArray [Foo(rand()) for j in 1:3]
@show A * b
end
rundistributed()
end
Thanks,
James
Output:
ERROR: On worker 2:
MethodError: Cannot `convert` an object of type Int64 to an object of type Foo{Float64}
Closest candidates are:
convert(::Type{T}, ::T) where T at essentials.jl:154
Foo{Float64}(::Any) where T<:Number at REPL[6]:3 (method too new to be called from this world context.)
fill! at ./array.jl:283
#253 at /home/cookj/.julia/packages/DistributedArrays/f3HAT/src/linalg.jl:111
run_work_thunk at /home/cookj/builds/julia/usr/share/julia/stdlib/v1.0/Distributed/src/process_messages.jl:56
#remotecall_fetch#148 at /home/cookj/builds/julia/usr/share/julia/stdlib/v1.0/Distributed/src/remotecall.jl:364
remotecall_fetch at /home/cookj/builds/julia/usr/share/julia/stdlib/v1.0/Distributed/src/remotecall.jl:364
#remotecall_fetch#152 at /home/cookj/builds/julia/usr/share/julia/stdlib/v1.0/Distributed/src/remotecall.jl:406
remotecall_fetch at /home/cookj/builds/julia/usr/share/julia/stdlib/v1.0/Distributed/src/remotecall.jl:406 [inlined]
#252 at /home/cookj/.julia/packages/DistributedArrays/f3HAT/src/linalg.jl:107 [inlined]
#672 at ./asyncmap.jl:100
macro expansion at ./asyncmap.jl:235 [inlined]
#688 at ./task.jl:259
#remotecall_wait#154(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Function, ::Distributed.Worker, ::Module, ::Vararg{Any,N} where N) at /home/cookj/builds/julia/usr/share/julia/stdlib/v1.0/Distributed/src/remotecall.jl:421
remotecall_wait(::Function, ::Distributed.Worker, ::Module, ::Vararg{Any,N} where N) at /home/cookj/builds/julia/usr/share/julia/stdlib/v1.0/Distributed/src/remotecall.jl:412
#remotecall_wait#157(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Function, ::Int64, ::Module, ::Vararg{Any,N} where N) at /home/cookj/builds/julia/usr/share/julia/stdlib/v1.0/Distributed/src/remotecall.jl:433
remotecall_wait(::Function, ::Int64, ::Module, ::Vararg{Any,N} where N) at /home/cookj/builds/julia/usr/share/julia/stdlib/v1.0/Distributed/src/remotecall.jl:433
(::getfield(Distributed, Symbol("##163#165")){Module,Expr})() at ./task.jl:259
...and 2 more exception(s).
Stacktrace:
[1] sync_end(::Array{Any,1}) at ./task.jl:226
[2] macro expansion at ./task.jl:245 [inlined]
[3] remotecall_eval(::Module, ::Array{Int64,1}, ::Expr) at /home/cookj/builds/julia/usr/share/julia/stdlib/v1.0/Distributed/src/macros.jl:206
[4] top-level scope at /home/cookj/builds/julia/usr/share/julia/stdlib/v1.0/Distributed/src/macros.jl:190
- Langage dominant
- Julia
- Étoiles
- 205
- Forks
- 34
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de JuliaParallel/DistributedArrays.jl
-
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
JuliaParallel/DistributedArrays.jl#255 · 1 réaction ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 45/100
JuliaParallel/DistributedArrays.jl#239 · 1 réaction ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 45/100
JuliaParallel/DistributedArrays.jl#238 · 1 commentaire ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
-
Difficulté 4/5 3-5 jours Accessibilité débutants 30/100
Toutes les issues de JuliaParallel/DistributedArrays.jl
Issues similaires
-
path: splitext treats directory references and leading dots as extensionsPeut-être pris @Hiten0305l l’a pris aujourd’hui. Ouverte
Difficulté 2/5 Une demi-journée Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
JuliaParallel/Hwloc.jl#93 ·
-
Pleiades page: embedded solution at 7 sweeps reaches the order-7 collocation cap, not order 6Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
SciML/SciMLBenchmarks.jl#1996 ·
Les mainteneurs répondent en général sous 1 jour
-
Affine transformations of `JohnsonSU` could return a `JohnsonSU`Peut-être pris @devmotion l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
JuliaStats/Distributions.jl#2117 ·
Les mainteneurs répondent en général sous 2 jours
-
Difficult-group test writes to a closed IOStream, failing on Julia 1.14.0-beta1Peut-être pris @ChrisRackauckas l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
JuliaSymbolics/SymbolicIntegration.jl#162 · 1 commentaire ·