What is a recommended workflow for efficiently serialising results data after solving a JuMP model? The information in the numbers are the important thing, not preserving the Julia object structure.
For example, does anyone have experience using JLD2, say, compared to the standard library Serialization module?
What’s the motivation? As a log to check against in future? To post-process in some other format? I’d say you’re best off creating a well-defined structure like a data frame and saving that, rather than some ad-hoc serialization of the JuMP model.
Yes, to save at the end of solve, and to post-process later into different formats and summaries. I currently transform to a dictionary of dataframes (variable symbol => dataframe of variable values) then serialise that dictionary using Serialization. This is currently a bottleneck in the workflow due to the time for saving, and would appreciate ideas for “quickly” saving the variable values.
Did you profile why/where it’s a bottleneck? Is it constructing the dataframes? Seems unlikely that it’s writing them?
Thanks, those questions will help me focus the issue; it’s probably my variable → dataframes code is not scaling well
There’s an open issue for JuMP to implement the Tables.jl API to make this simpler: Tables.jl support for results · Issue #3096 · jump-dev/JuMP.jl · GitHub