Is there any way to save and load several lists of interpolating functions efficiently and cross-platform?
I want to save the resulting interpolating functions of NDSolve which takes very long to generate so next time I can just load the same result into Mathematica. The following is an example of lists of long interpolating functions:
s1 = Table[
NDSolve[{f''[x] == -k f[x], f[0] == 1, f'[0] == 0}, f, {x, 0, 100000}][[1]],
{k, 1, 10}
];
fl1 = f /. s1; (* 1st list of functions *)
s2 = Table[
NDSolve[{f''[x] == -k f[x], f[0] == 0, f'[0] == 1}, f, {x, 0, 100000}][[1]],
{k, 1, 10}
];
fl2 = f /. s2; (* 2nd list of functions *)
The sizes of them are ByteCount[{fl1, fl2}] 1,363,723,536 Bytes (about 1.3 GB) in memory.
The fastest way I know is to DumpSave them using
DumpSave["data.mx", {fl1, fl2}];
This only takes a few seconds. The file size is also about 1.3 GB.
Loading them back also takes a few second:
Quit[]
Get["data.mx"]
However, DumpSave is not cross-platform. The saved .mx file can't be read by other computers with different architectures/system. (At least, it doesn't work between Mathematica 10.2 and 10.4.)
I have tried using Save:
Save["data2.mx", {fl1, fl2}]
but this is too slow and computationally intensive. The file size also appears to be much bigger.
So is there other ways to save & load interpolating functions with efficiency similar to DumpSave?