I use Serialization.serialize() function to write julia objects on disk since I found it more efficient than other formats (like JLD2) and it’s for short term shortage so I can use the the same Julia runtime to read it back.
It works well except that SharedArray cannot be serialized properly. It seems that it may be just saving the pointers so the output file is very small even though I have a large array. Is there any to do this properly? I prefer not to translate it to a regular Array because it’s already large and I don’t have enough memory…
julia> using SharedArrays, Serialization
julia> A = SharedArray{Float64,2}((2,1000000));
julia> open("A.jo", "w") do file serialize(file, A) end
julia> stat("A.jo")
StatStruct(mode=0o100666, size=181)