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

JLD2 when using parallel computing is not working [Julia 1.4.0-DEV] #165

Closed
julien-vaes opened this issue Nov 21, 2019 · 4 comments · Fixed by #166
Closed

JLD2 when using parallel computing is not working [Julia 1.4.0-DEV] #165

julien-vaes opened this issue Nov 21, 2019 · 4 comments · Fixed by #166
Labels

Comments

@julien-vaes
Copy link

Hi all,

The issue I have is the following: when I run the following lines, which is the example given the documentation of JLD2, everything is fine:

using JLD2, FileIO
save("example.jld2", Dict("hello" => "world", "foo" => :bar))
load("example.jld2")

However, when using the Distributed package, i.e.

using Distributed
@everywhere using JLD2
@everywhere using FileIO
save("example.jld2", Dict("hello" => "world", "foo" => :bar))
load("example.jld2")

I have the following error, which arises when executing the last line:

MethodError: Cannot convert an object of type Type{Future} to an object of type Module
Closest candidates are:
  convert(::Type{T}, !Matched::T) where T at essentials.jl:170

Stacktrace:
 [1] handle_error(::MethodError, ::File{DataFormat{:JLD2}}) at /Users/jvaes/.julia/packages/FileIO/JAtC1/src/error_handling.jl:80
 [2] handle_exceptions(::Array{Any,1}, ::String) at /Users/jvaes/.julia/packages/FileIO/JAtC1/src/error_handling.jl:75
 [3] load(::File{DataFormat{:JLD2}}; options::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /Users/jvaes/.julia/packages/FileIO/JAtC1/src/loadsave.jl:193
 [4] load(::File{DataFormat{:JLD2}}) at /Users/jvaes/.julia/packages/FileIO/JAtC1/src/loadsave.jl:172
 [5] load(::String; options::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /Users/jvaes/.julia/packages/FileIO/JAtC1/src/loadsave.jl:118
 [6] load(::String) at /Users/jvaes/.julia/packages/FileIO/JAtC1/src/loadsave.jl:118
 [7] top-level scope at In[1]:5

Thanks in advance for your help!

@GregPlowman
Copy link
Contributor

I'm getting the same error.

using Distributed
using JLD2, FileIO
save("example.jld2", Dict("hello" => "world", "foo" => :bar))
load("example.jld2")

Errors on versions 0.1.4, 0.1.5, 0.1.6, 0.1.7.
Most recent error-free version is 0.1.3.

@DilumAluthge
Copy link
Member

Can you try the da/future branch of JLD2 and see if that fixes it.

I.e.

] add JLD2#da/future

@GregPlowman
Copy link
Contributor

Yes, that seems to fix it.
Thanks for your quick response!

@DilumAluthge
Copy link
Member

Alright, I believe that this is now fixed in JLD2 version 0.1.8.

I am closing this issue.

If you encounter this bug again on JLD2 version 0.1.8 or greater, please comment on this issue and I will reopen it. Alternatively, you can open a new issue.

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

Successfully merging a pull request may close this issue.

3 participants