Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

threadsafe? #139

Closed
ggggggggg opened this issue Aug 27, 2014 · 3 comments
Closed

threadsafe? #139

ggggggggg opened this issue Aug 27, 2014 · 3 comments

Comments

@ggggggggg
Copy link
Contributor

@everywhere using HDF5
@everywhere h5 = h5open("test.h5","w")
for j=1:10 
    g_create(h5,"$j")
    h5["$j/j"]=j
end
map(j->read(h5["$j/j"]), names(h5))
pmap(j->read(h5["$j/j"]), names(h5)) # this line craps out when julia is started with 'julia -p 3'

Is this something I should be able to get working? By default on OSX Homebrew installs the non-threadsafe version of HDF5 as far as I can tell. I tried to override with Homebrew.rm("HDF5") followed by ./brew install --force-bottle staticfloat/juliadeps/hdf5 --enable-threadsafe. It didn't fix it or even change the error that I get.

@simonster
Copy link
Member

Julia is not presently multithreaded. Those are separate processes. HDF5 does not support this for writing (writing from multiple processes simultaneously would probably corrupt it), but for reading you could open the file separately in each process.

@ggggggggg
Copy link
Contributor Author

Ok thanks. I'm going to have to do more than just add a p to my code.

@simonster
Copy link
Member

We could think about overloading Base.serialize for HDF5File/JLDFile, though, so that sending them to another process would automatically open the file there (or maybe throw an error if the file is opened for writing).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants