# Saving JUMPArray to JLD or JLD2 file

**URL:** <https://discourse.julialang.org/t/saving-jumparray-to-jld-or-jld2-file/18033>\
**Category:** Optimization (Mathematical)\
**Tags:** question\
**Created:** [November 26, 2018, 8:14pm UTC](https://discourse.julialang.org/t/saving-jumparray-to-jld-or-jld2-file/18033 "2018-11-26T20:14:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![YoungFaithful](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/youngfaithful/32/6237_2.png) [@YoungFaithful](https://discourse.julialang.org/u/YoungFaithful)\
**Post date:** [November 26, 2018, 8:14pm UTC](https://discourse.julialang.org/t/saving-jumparray-to-jld-or-jld2-file/18033/1 "2018-11-26T20:14:06Z")

</div>

Hi, I’m facing the problem that trying to save a JUMPArray with JLD or JLD2 causes the error that it “cannot write pointers to JLD file”. Is there any way to save an entire JUMPArray to a file without decomposing it into its .innerArray and .indexsets? Thanks

---

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [November 26, 2018, 9:29pm UTC](https://discourse.julialang.org/t/saving-jumparray-to-jld-or-jld2-file/18033/2 "2018-11-26T21:29:10Z")

</div>

The problem is likely that you are trying to write a JuMPArray of variables, each of which have a reference to the model, which has a pointer to the solver.

Why are you trying to do this?

It is probably better to save the data needed to build the model, rather than the model itself.

You may also want to take a look at:

> [@Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757):
>
> Welcome to the Julia Discourse! We are enthusiastic about helping Julia programmers, both beginner and experienced. This public service announcement (PSA) outlines best practices when asking for help. Following these points makes it easier for us to help you and more likely you’ll get a prompt, useful answer. Keywords are highlighted to make it easier to refer to specific points. Choose a descriptive title that captures the key part of your question, eg “plots with multiple axes” instead of …

---

<div class="post-metadata">

**Author:** ![abulak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abulak/32/28314_2.png) [@abulak](https://discourse.julialang.org/u/abulak)\
**Post date:** [November 28, 2018, 3:20am UTC](https://discourse.julialang.org/t/saving-jumparray-to-jld-or-jld2-file/18033/3 "2018-11-28T03:20:05Z")

</div>

If You want to save the model have a look at [https://github.com/JuliaOpt/ConicBenchmarkUtilities.jl](https://github.com/JuliaOpt/ConicBenchmarkUtilities.jl)

---

<div class="post-metadata">

**Author:** ![YoungFaithful](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/youngfaithful/32/6237_2.png) [@YoungFaithful](https://discourse.julialang.org/u/YoungFaithful)\
**Post date:** [November 28, 2018, 4:07am UTC](https://discourse.julialang.org/t/saving-jumparray-to-jld-or-jld2-file/18033/4 "2018-11-28T04:07:06Z")

</div>

Thanks for your response! It was a very useful information that it points to the entire model. I now just solve the indexsets and innerArray data and it works perfectly. (For my next question I’ll also include your other advise.)
