Closed bgctw closed 2 years ago
Hi @bgctw,
This is very odd. I've never seen this before and not sure how this could happen. (Can't reproduce it either)
You could try a few things:
/tmp
Thanks, indeed the file location makes a difference. In my code above I did not write to /tmp
but to a local tmp dir (no slash).
However, I am starting julia from a directory in a shared file system. If I replace the filename with a location that points to the local harddrive attached to the server, JLD2 works as expected.
When I write the file on the server (shared file system) and copy and open it on my local machine, it reads the problemenatic zeros. Hence, the problem seems to be with writing the file.
How do I write using the IOStream backend?
does not work: JLD2.jldsave{IOStream}(fname1; a)
A colleague told me, that he encountered problems using mmap on the server.
You may ignore my frustration: The issue is, that such wrong behavior of JLD2 (or mmap) can go unnoticed without a warning. I could solve my original problem by replacing JLD2 with julia serialization. Using the local scratch is not an option, I need the shared file system. This behavior caused me so much time of debugging at the wrong place so that I cannot trust it any more. It lends evidence for the recent critics of Julia being not reliable.
does not work: JLD2.jldsave{IOStream}(fname1; a) Thanks for pointing this out. This is an error in the documentation. I will fix it right away.
jldsave(fn, IOStream; a)
A colleague told me, that he encountered problems using mmap on the server.
I'm sorry you are experiencing these issues. mmap
is known to be difficult on shared file systems.
However, there is nothing that JLD2 can do about this, as mmap
is essentially provided by the operating system.
(If this is reproducible, you could consider contacting your system administrator)
I cannot store and re-read a simple array:
This happens in a temporary environment where only added JLD2:
I cannot reproduce this error on my local machine. It happens on a remote linux server at work with more memory, but where I have only limited rights. Are there requirements of system libraries, that I can request the admins to check?