Groups 75 of 99+ julia-users › Passing types in @parallel 2 posts by 1 author Jason Castiglione 11/19/15 I constructed my own type to store LDPC codes. The module is at https://github.com/jasontuna/LDPC It is stored in a Julia module and I load it with @everywhere using LDPC I would like to run several simulations in parallel calculating bit error rates for passing codewords through a particular channel. I am getting errors where functions defined in my notebook won't "notice" the LDPC type. I cut and paste the code for the type in a notebook, and then load the type with @everywhere and it works then. What should I do to get the type to load correctly by just using @everywhere for the module? Here is cut and paste of two simplified examples that have the same error: 1) I write the following in the IJulia notebook addprocs(6) @everywhere using Distributions @everywhere using LDPC LH = ldpcH(ones(UInt8,1000)*3,ones(UInt8,500)*6,true); @everywhere function llh(LH::ldpcH) return LH.n end @parallel (+) for j=1:100 llh(LH) end ############################### and the error I get for each worker looks like MethodError: `llh` has no method matching llh(::LDPC.ldpcH) Closest candidates are: llh(::LDPC.ldpcH) [inlined code] from In[10]:3 in anonymous at no file:1500 in anonymous at multi.jl:892 in run_work_thunk at multi.jl:645 [inlined code] from multi.jl:892 in anonymous at task.jl:63 while loading In[10], in expression starting on line 2 2) on the other hand if I write addprocs(6) @everywhere using Distributions @everywhere type ldpcH #for readability I did not cut and paste the contents end @everywhere function llh(LH::ldpcH) return LH.n end LH = ldpcH(ones(UInt8,1000)*3,ones(UInt8,500)*6,true); @parallel (+) for j=1:100 llh(LH) end everything works. Jason Castiglione 11/20/15 Figured it out. For some reason doing the following works, using LDPC @everywhere using LDPC - show quoted text -