Closed fincardona closed 3 years ago
This is interesting. We could change everywhere the type from {Vector,Array}
to Abstract{Vector,Array}
, but I don't know if the C library will like something different from the plain Array
type.
Can you use sdata()
on the shared array to get the underlying Array
?
The C library requires a dense (or maybe strided) in-memory array. There are many AbstractArrays that do not fit those requirements, so I think AbstractArray would be too wide a signature.
Note that this is not an issue anymore as FITSIO
now accepts StridedArray
s.
julia> s = SharedArray{Float64,2}((2,2), pids=workers());
julia> s .= reshape(eachindex(s), size(s))
2×2 SharedArray{Float64,2}:
1.0 3.0
2.0 4.0
julia> FITSIO.fitswrite("abc.fits", s) # works
julia> FITSIO.fitsread("abc.fits")
2×2 Array{Float64,2}:
1.0 3.0
2.0 4.0
That's great, thanks for checking (and your work on the strided arrays)! I'm going to close the ticket
Hello,
I have a parallel code that exploits the module
SharedArrays
but when I try to write aSharedArray
into a FITS file, I get the following error message:So, is it possible to add a method to make
FITSIO
compatible withSharedArrays
?