JuliaDB saving arrays

I’m running a parameter sweep solving differential equations and trying to save the results, and have a couple questions:

  1. When I try to save a toy example as follows, I get an error that _impl is not defined for my arguments, seemingly implying that I can’t save a table that has an array as one of its elements. Is that the case? Do I need to unpack all the solutions so that the DB has timepoints and spacepoints as keys?
using JuliaDB
u = rand(10,11)
t = 1.0:10.0
param = 1.2
tab = table((u=u, t=t, param=param), pkey=[:param])

ERROR: MethodError: no method matching _impl(::Array{Float64,2}, ::StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}}, ::Float64)

(follow-up question: previously I’d been using JLD and found that saving a single DESolution object was prohibitively expensive because of all the code serialization or what-have-you, which is why here I’m just saving the u and t arrays. Given that JuliaDB supports saving objects of any type, would some of that overhead be mitigated by saving all the DESolutions into one big DB?)

  1. If I’m running this parameter sweep in parallel, will JuliaDB’s save method “just work”? My naive and hopeful reading of the documentation suggests it will work, but I’m not 100% sure.

(edit: momentarily posted wrong code; edit 2: twice)

1 Like

I solved question (1) myself: When making a table, all the values should be in arrays of the same shape. So my problem is solved by tab = table((u=[u], t=[t], param=[param]), pkey=[:param]).

Now I can blindly try the parallel saving in (2) and will update if it works!

edit: I’ve realized I have many assumptions packaged into wanting the save method to “just work,” so I’ll mark this as solved and ask more targeted questions as I’m able to formulate them.