我正在探索 Julia 的并行计算并尝试了以下方法:
a=dzeros(5);a[1]=5
但刚刚收到此错误:
setindex! not defined for DArray{{Float64, 1, Array{Float64, 1}}
嗯,我以为手册上说setindex!
完全由DArray
。我错过了什么?
我使用的是 Windows 32 位 v0.2.1。
我也只是一个探索者,但读完之后Julia 的分布式数组文档 http://julia.readthedocs.org/en/release-0.2/manual/parallel-computing/#distributed-arrays,我尝试过这个似乎有效。
$ ./julia
_
_ _ _(_)_ | A fresh approach to technical computing
(_) | (_) (_) | Documentation: http://docs.julialang.org
_ _ _| |_ __ _ | Type "help()" to list help topics
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 0.3.0-prerelease+2703 (2014-04-22 18:57 UTC)
_/ |\__'_|_|_|\__'_| | Commit 942ae42* (0 days old master)
|__/ | i686-redhat-linux
julia> versioninfo()
Julia Version 0.3.0-prerelease+2703
Commit 942ae42* (2014-04-22 18:57 UTC)
Platform Info:
System: Linux (i686-redhat-linux)
CPU: Genuine Intel(R) CPU T2250 @ 1.73GHz
WORD_SIZE: 32
BLAS: libopenblas (DYNAMIC_ARCH NO_AFFINITY)
LAPACK: libopenblas
LIBM: libopenlibm
julia> a=dzeros(5)
5-element DArray{Float64,1,Array{Float64,1}}:
0.0
0.0
0.0
0.0
0.0
julia> localpart(a)[1]=5
5
julia> a
5-element DArray{Float64,1,Array{Float64,1}}:
5.0
0.0
0.0
0.0
0.0
julia>
看起来分布式数组不是“本地”的,除非你将它们设置为“本地”。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)