1
$\begingroup$

I have two computers, one has Mathematica 11.0, one has Mathematica 12.1.

I have created a .mx file using DumpSave at M12.1. I can read the .mx file using Get at that computer. and want to read it via Get at the machine with M11.0. However, Get doesn't show an error message, but the variable that is contained in the .mx is not in memory.

Is this a known problem?

My codes:

1) At M12.1:

testVar = x + y^2;
DumpSave[NotebookDirectory[] <> "mytestfile.mx", testVar]

I restart the kernel, and perform:

Get[NotebookDirectory[] <> "mytestfile.mx"]
Column@Thread@{Names["Global`*"], ByteCount[#] & /@ ToExpression /@ Names["Global`*"]}

shows the correct output "{testVar", 128}. Everything good.

2) At M11.0: Now I copy the mytestfile.mx to the other computer, and load it in the same instruction.

Get[NotebookDirectory[] <> "mytestfile.mx"]
Column@Thread@{Names["Global`*"], ByteCount[#] & /@ ToExpression /@ Names["Global`*"]}

No error, but the variable is not in memory. Not good.

Questions:

  • Is this a known bug?
  • Is it a mistake on my side?
  • Are there any workarounds? (it is impossible to recreate the .mx file at M11.0, it takes too long)
$\endgroup$
  • 1
    $\begingroup$ This is mentioned on the ref page for the MX format. Is there any way to open the MX in version 12.1 and save it to a different format? $\endgroup$ – Jason B. Jul 27 at 1:16
  • $\begingroup$ Can you move them the other direction? From 11.0 to 12.1? $\endgroup$ – CA Trevillian Jul 27 at 2:24
  • $\begingroup$ @JasonB. You are right, thanks a lot, it is written that MX files created by newer versions of the Wolfram System may not be usable by older versions.. I tried Save now, and it works (but made the files roughly twice the size, and they where already 100s of MBs). Do you have any explanation for this behaviour? $\endgroup$ – Mario Krenn Jul 27 at 3:02
  • 1
    $\begingroup$ Save is probably using a plain text format, which is version independent but larger than a binary format like MX $\endgroup$ – Jason B. Jul 27 at 3:21
2
$\begingroup$

I suspect that

Files written by DumpSave cannot be exchanged between operating systems that differ in $SystemWordLength.

which is quoted from the documentation article on DumpSace, is relevant to your problem. Evaluated $SystemWordLength on both computers. Are they different?

| improve this answer | |
$\endgroup$
  • $\begingroup$ Thanks for this. I checked, and $SystemWordLength=64 at both machines. $\endgroup$ – Mario Krenn Jul 27 at 2:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.